mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
chore: Update langchain and langchain/openai packages (#15804)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
|
||||
import { OpenAIEmbeddings } from '@langchain/openai';
|
||||
import { AzureOpenAIEmbeddings } from '@langchain/openai';
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
type INodeType,
|
||||
@@ -143,7 +143,7 @@ export class EmbeddingsAzureOpenAi implements INodeType {
|
||||
options.timeout = undefined;
|
||||
}
|
||||
|
||||
const embeddings = new OpenAIEmbeddings({
|
||||
const embeddings = new AzureOpenAIEmbeddings({
|
||||
azureOpenAIApiDeploymentName: modelName,
|
||||
// instance name only needed to set base url
|
||||
azureOpenAIApiInstanceName: !credentials.endpoint ? credentials.resourceName : undefined,
|
||||
|
||||
@@ -228,14 +228,12 @@ export class EmbeddingsOpenAi implements INodeType {
|
||||
configuration.baseURL = credentials.url as string;
|
||||
}
|
||||
|
||||
const embeddings = new OpenAIEmbeddings(
|
||||
{
|
||||
modelName: this.getNodeParameter('model', itemIndex, 'text-embedding-3-small') as string,
|
||||
openAIApiKey: credentials.apiKey as string,
|
||||
...options,
|
||||
},
|
||||
const embeddings = new OpenAIEmbeddings({
|
||||
modelName: this.getNodeParameter('model', itemIndex, 'text-embedding-3-small') as string,
|
||||
openAIApiKey: credentials.apiKey as string,
|
||||
...options,
|
||||
configuration,
|
||||
);
|
||||
});
|
||||
|
||||
return {
|
||||
response: logWrapper(embeddings, this),
|
||||
|
||||
Reference in New Issue
Block a user