feat(Embeddings OpenAI Node, Embeddings Azure OpenAI Node): Add dimensions option (#11773)

This commit is contained in:
Mutasem Aldmour 2024-11-18 15:53:07 +01:00 committed by GitHub
parent a544b74d87
commit de01a8a01d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 62 additions and 0 deletions

View file

@ -87,6 +87,36 @@ export class EmbeddingsAzureOpenAi implements INodeType {
'Maximum amount of time a request is allowed to take in seconds. Set to -1 for no timeout.', 'Maximum amount of time a request is allowed to take in seconds. Set to -1 for no timeout.',
type: 'number', type: 'number',
}, },
{
displayName: 'Dimensions',
name: 'dimensions',
default: undefined,
description:
'The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.',
type: 'options',
options: [
{
name: '256',
value: 256,
},
{
name: '512',
value: 512,
},
{
name: '1024',
value: 1024,
},
{
name: '1536',
value: 1536,
},
{
name: '3072',
value: 3072,
},
],
},
], ],
}, },
], ],
@ -105,6 +135,7 @@ export class EmbeddingsAzureOpenAi implements INodeType {
batchSize?: number; batchSize?: number;
stripNewLines?: boolean; stripNewLines?: boolean;
timeout?: number; timeout?: number;
dimensions?: number | undefined;
}; };
if (options.timeout === -1) { if (options.timeout === -1) {

View file

@ -135,6 +135,36 @@ export class EmbeddingsOpenAi implements INodeType {
type: 'collection', type: 'collection',
default: {}, default: {},
options: [ options: [
{
displayName: 'Dimensions',
name: 'dimensions',
default: undefined,
description:
'The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.',
type: 'options',
options: [
{
name: '256',
value: 256,
},
{
name: '512',
value: 512,
},
{
name: '1024',
value: 1024,
},
{
name: '1536',
value: 1536,
},
{
name: '3072',
value: 3072,
},
],
},
{ {
displayName: 'Base URL', displayName: 'Base URL',
name: 'baseURL', name: 'baseURL',
@ -179,6 +209,7 @@ export class EmbeddingsOpenAi implements INodeType {
batchSize?: number; batchSize?: number;
stripNewLines?: boolean; stripNewLines?: boolean;
timeout?: number; timeout?: number;
dimensions?: number | undefined;
}; };
if (options.timeout === -1) { if (options.timeout === -1) {