mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -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',
|
default: 'embed-english-v2.0',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'Embed-English-v2.0(4096 Dimensions)',
|
name: 'Embed-English-Light-v2.0 (1024 Dimensions)',
|
||||||
value: 'embed-english-v2.0',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Embed-English-Light-v2.0(1024 Dimensions)',
|
|
||||||
value: 'embed-english-light-v2.0',
|
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',
|
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> {
|
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
|
||||||
this.logger.verbose('Supply data for embeddings Cohere');
|
this.logger.verbose('Supply data for embeddings Cohere');
|
||||||
const modelName = this.getNodeParameter('modelName', itemIndex, 'embed-english-v2.0') as string;
|
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({
|
const embeddings = new CohereEmbeddings({
|
||||||
apiKey: credentials.apiKey as string,
|
apiKey: credentials.apiKey,
|
||||||
model: modelName,
|
model: modelName,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue