mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
feat(Embeddings Cohere Node): Add v3 Cohere models (#9887)
This commit is contained in:
parent
957b2d6108
commit
403e19b3e3
|
@ -67,17 +67,33 @@ export class EmbeddingsCohere implements INodeType {
|
|||
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)',
|
||||
name: 'Embed-English-Light-v2.0 (1024 Dimensions)',
|
||||
value: 'embed-english-light-v2.0',
|
||||
},
|
||||
{
|
||||
name: 'Embed-Multilingual-v2.0(768 Dimensions)',
|
||||
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 a new issue