Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix/AzureOpenAIEmbeddingError #215

Merged
merged 1 commit into from
May 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ class AzureOpenAIEmbedding_Embeddings implements INode {
],
default: '2023-03-15-preview'
},
{
label: 'Batch Size',
name: 'batchSize',
type: 'number',
default: '1',
optional: true,
additionalParams: true
},
{
label: 'Timeout',
name: 'timeout',
Expand All @@ -70,6 +78,7 @@ 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 batchSize = nodeData.inputs?.batchSize as string
const timeout = nodeData.inputs?.timeout as string

const obj: Partial<OpenAIEmbeddingsParams> & Partial<AzureOpenAIInput> = {
Expand All @@ -79,6 +88,7 @@ class AzureOpenAIEmbedding_Embeddings implements INode {
azureOpenAIApiVersion
}

if (batchSize) obj.batchSize = parseInt(batchSize, 10)
if (timeout) obj.timeout = parseInt(timeout, 10)

const model = new OpenAIEmbeddings(obj)
Expand Down