[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:
Jingun Jung
2024-08-27 00:12:04 +09:00
committed by GitHub
parent a781576f16
commit ea680484d3
@@ -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)