chore: Update Langchain to 0.3 (no-changelog) (#10958)

This commit is contained in:
oleg
2024-09-25 11:21:54 +02:00
committed by GitHub
parent 36c472ee0a
commit af20ccbbad
12 changed files with 1454 additions and 1261 deletions

View File

@@ -1,4 +1,5 @@
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
import { ChatBedrockConverse } from '@langchain/aws';
import {
NodeConnectionType,
type IExecuteFunctions,
@@ -6,13 +7,8 @@ import {
type INodeTypeDescription,
type SupplyData,
} from 'n8n-workflow';
import { BedrockChat } from '@langchain/community/chat_models/bedrock';
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
// Dependencies needed underneath the hood. We add them
// here only to track where what dependency is used
import '@aws-sdk/credential-provider-node';
import '@aws-sdk/client-bedrock-runtime';
import '@aws-sdk/client-sso-oidc';
import { N8nLlmTracing } from '../N8nLlmTracing';
export class LmChatAwsBedrock implements INodeType {
@@ -144,7 +140,7 @@ export class LmChatAwsBedrock implements INodeType {
maxTokensToSample: number;
};
const model = new BedrockChat({
const model = new ChatBedrockConverse({
region: credentials.region as string,
model: modelName,
temperature: options.temperature,