mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
[FEATURE] Add "base path" to Azure OpenAI embeddings node (#3086)
Add "base path" to Azure OpenAI embeddings node #3048 Co-authored-by: Jingun Jung <jingun.jung@wedx.cc>
This commit is contained in:
@@ -44,6 +44,13 @@ class AzureOpenAIEmbedding_Embeddings implements INode {
|
|||||||
type: 'number',
|
type: 'number',
|
||||||
optional: true,
|
optional: true,
|
||||||
additionalParams: true
|
additionalParams: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'BasePath',
|
||||||
|
name: 'basepath',
|
||||||
|
type: 'string',
|
||||||
|
optional: true,
|
||||||
|
additionalParams: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -51,6 +58,7 @@ class AzureOpenAIEmbedding_Embeddings implements INode {
|
|||||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||||
const batchSize = nodeData.inputs?.batchSize as string
|
const batchSize = nodeData.inputs?.batchSize as string
|
||||||
const timeout = nodeData.inputs?.timeout as string
|
const timeout = nodeData.inputs?.timeout as string
|
||||||
|
const basePath = nodeData.inputs?.basepath as string
|
||||||
|
|
||||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||||
const azureOpenAIApiKey = getCredentialParam('azureOpenAIApiKey', credentialData, nodeData)
|
const azureOpenAIApiKey = getCredentialParam('azureOpenAIApiKey', credentialData, nodeData)
|
||||||
@@ -62,7 +70,8 @@ class AzureOpenAIEmbedding_Embeddings implements INode {
|
|||||||
azureOpenAIApiKey,
|
azureOpenAIApiKey,
|
||||||
azureOpenAIApiInstanceName,
|
azureOpenAIApiInstanceName,
|
||||||
azureOpenAIApiDeploymentName,
|
azureOpenAIApiDeploymentName,
|
||||||
azureOpenAIApiVersion
|
azureOpenAIApiVersion,
|
||||||
|
azureOpenAIBasePath: basePath
|
||||||
}
|
}
|
||||||
|
|
||||||
if (batchSize) obj.batchSize = parseInt(batchSize, 10)
|
if (batchSize) obj.batchSize = parseInt(batchSize, 10)
|
||||||
|
|||||||
Reference in New Issue
Block a user