mirror of
https://github.com/n8n-io/n8n.git
synced 2024-08-16 16:40:30 +03:00
feat(Embeddings Cohere Node): Add v3 Cohere models (#9887)
This commit is contained in:
parent
957b2d6108
commit
403e19b3e3
@ -66,18 +66,34 @@ export class EmbeddingsCohere implements INodeType {
|
||||
'The model which will generate the embeddings. <a href="https://docs.cohere.com/docs/models">Learn more</a>.',
|
||||
default: 'embed-english-v2.0',
|
||||
options: [
|
||||
{
|
||||
name: 'Embed-English-v2.0(4096 Dimensions)',
|
||||
value: 'embed-english-v2.0',
|
||||
},
|
||||
{
|
||||
name: 'Embed-English-Light-v2.0 (1024 Dimensions)',
|
||||
value: 'embed-english-light-v2.0',
|
||||
},
|
||||
{
|
||||
name: 'Embed-English-Light-v3.0 (384 Dimensions)',
|
||||
value: 'embed-english-light-v3.0',
|
||||
},
|
||||
{
|
||||
name: 'Embed-English-v2.0 (4096 Dimensions)',
|
||||
value: 'embed-english-v2.0',
|
||||
},
|
||||
{
|
||||
name: 'Embed-English-v3.0 (1024 Dimensions)',
|
||||
value: 'embed-english-v3.0',
|
||||
},
|
||||
{
|
||||
name: 'Embed-Multilingual-Light-v3.0 (384 Dimensions)',
|
||||
value: 'embed-multilingual-light-v3.0',
|
||||
},
|
||||
{
|
||||
name: 'Embed-Multilingual-v2.0 (768 Dimensions)',
|
||||
value: 'embed-multilingual-v2.0',
|
||||
},
|
||||
{
|
||||
name: 'Embed-Multilingual-v3.0 (1024 Dimensions)',
|
||||
value: 'embed-multilingual-v3.0',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
@ -86,9 +102,9 @@ export class EmbeddingsCohere implements INodeType {
|
||||
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
|
||||
this.logger.verbose('Supply data for embeddings Cohere');
|
||||
const modelName = this.getNodeParameter('modelName', itemIndex, 'embed-english-v2.0') as string;
|
||||
const credentials = await this.getCredentials('cohereApi');
|
||||
const credentials = (await this.getCredentials('cohereApi')) as { apiKey: string };
|
||||
const embeddings = new CohereEmbeddings({
|
||||
apiKey: credentials.apiKey as string,
|
||||
apiKey: credentials.apiKey,
|
||||
model: modelName,
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user