add modelName selection into Azure

This commit is contained in:
chungyau97
2023-05-12 08:43:00 +07:00
parent bb3e6e3bf8
commit b0e9387087
3 changed files with 85 additions and 0 deletions
@@ -27,6 +27,23 @@ class AzureOpenAIEmbedding_Embeddings implements INode {
name: 'azureOpenAIApiKey',
type: 'password'
},
{
label: 'Model Name',
name: 'modelName',
type: 'options',
options: [
{
label: 'text-embedding-ada-002',
name: 'text-embedding-ada-002'
},
{
label: 'text-search-ada-doc-001',
name: 'text-search-ada-doc-001'
}
],
default: 'text-embedding-ada-002',
optional: true
},
{
label: 'Azure OpenAI Api Instance Name',
name: 'azureOpenAIApiInstanceName',
@@ -74,11 +91,13 @@ class AzureOpenAIEmbedding_Embeddings implements INode {
const azureOpenAIApiInstanceName = nodeData.inputs?.azureOpenAIApiInstanceName as string
const azureOpenAIApiDeploymentName = nodeData.inputs?.azureOpenAIApiDeploymentName as string
const azureOpenAIApiVersion = nodeData.inputs?.azureOpenAIApiVersion as string
const modelName = nodeData.inputs?.modelName as string
const stripNewLines = nodeData.inputs?.stripNewLines as boolean
const batchSize = nodeData.inputs?.batchSize as string
const timeout = nodeData.inputs?.timeout as string
const obj: Partial<OpenAIEmbeddingsParams> & Partial<AzureOpenAIInput> = {
modelName,
azureOpenAIApiKey,
azureOpenAIApiInstanceName,
azureOpenAIApiDeploymentName,