diff --git a/package.json b/package.json index 44bec31d0b9b9..34b0ed9fa9b9f 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "xml2js": "^0.5.0", "cpy@8>globby": "^11.1.0", "qqjs>globby": "^11.1.0", - "@langchain/core": "^0.1.8" + "@langchain/core": "0.1.41" }, "patchedDependencies": { "typedi@0.10.0": "patches/typedi@0.10.0.patch", diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts index 62cc6edbd8f11..ea148c493cbb7 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts @@ -6,9 +6,9 @@ import { } from 'n8n-workflow'; import { initializeAgentExecutorWithOptions } from 'langchain/agents'; -import type { BaseChatMemory } from 'langchain/memory'; -import type { BaseOutputParser } from 'langchain/schema/output_parser'; -import { PromptTemplate } from 'langchain/prompts'; +import type { BaseChatMemory } from '@langchain/community/memory/chat_memory'; +import type { BaseOutputParser } from '@langchain/core/output_parsers'; +import { PromptTemplate } from '@langchain/core/prompts'; import { CombiningOutputParser } from 'langchain/output_parsers'; import { isChatInstance, diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts index bcfe28a02a992..b2cc7b68a0b4a 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts @@ -7,11 +7,11 @@ import { import type { AgentExecutorInput } from 'langchain/agents'; import { AgentExecutor, OpenAIAgent } from 'langchain/agents'; -import type { BaseOutputParser } from 'langchain/schema/output_parser'; -import { PromptTemplate } from 'langchain/prompts'; +import type { BaseOutputParser } from '@langchain/core/output_parsers'; +import { PromptTemplate } from '@langchain/core/prompts'; import { CombiningOutputParser } from 'langchain/output_parsers'; import { BufferMemory, type BaseChatMemory } from 'langchain/memory'; -import { ChatOpenAI } from 'langchain/chat_models/openai'; +import { ChatOpenAI } from '@langchain/openai'; import { getConnectedTools, getOptionalOutputParsers, diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts index 735041556816b..3912dffadf01b 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts @@ -5,10 +5,10 @@ import { NodeOperationError, } from 'n8n-workflow'; -import type { BaseOutputParser } from 'langchain/schema/output_parser'; -import { PromptTemplate } from 'langchain/prompts'; +import type { BaseOutputParser } from '@langchain/core/output_parsers'; +import { PromptTemplate } from '@langchain/core/prompts'; import { CombiningOutputParser } from 'langchain/output_parsers'; -import type { BaseChatModel } from 'langchain/chat_models/base'; +import type { BaseChatModel } from '@langchain/core/language_models/chat_models'; import { PlanAndExecuteAgentExecutor } from 'langchain/experimental/plan_and_execute'; import { getConnectedTools, diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts index 02b34996630ba..e8f5ea0b5d910 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts @@ -7,10 +7,10 @@ import { import { AgentExecutor, ChatAgent, ZeroShotAgent } from 'langchain/agents'; import type { BaseLanguageModel } from 'langchain/base_language'; -import type { BaseOutputParser } from 'langchain/schema/output_parser'; -import { PromptTemplate } from 'langchain/prompts'; +import type { BaseOutputParser } from '@langchain/core/output_parsers'; +import { PromptTemplate } from '@langchain/core/prompts'; import { CombiningOutputParser } from 'langchain/output_parsers'; -import type { BaseChatModel } from 'langchain/chat_models/base'; +import type { BaseChatModel } from '@langchain/core/language_models/chat_models'; import { getConnectedTools, getOptionalOutputParsers, diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts index eae37cb7f9bee..783a0a86a4bce 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts @@ -3,13 +3,14 @@ import { type INodeExecutionData, NodeConnectionType, NodeOperationError, + type IDataObject, } from 'n8n-workflow'; import { SqlDatabase } from 'langchain/sql_db'; import type { SqlCreatePromptArgs } from 'langchain/agents/toolkits/sql'; import { SqlToolkit, createSqlAgent } from 'langchain/agents/toolkits/sql'; -import type { BaseLanguageModel } from 'langchain/dist/base_language'; -import type { BaseChatMemory } from 'langchain/memory'; +import type { BaseLanguageModel } from '@langchain/core/language_models/base'; +import type { BaseChatMemory } from '@langchain/community/memory/chat_memory'; import type { DataSource } from '@n8n/typeorm'; import { getPromptInputByType, serializeChatHistory } from '../../../../../utils/helpers'; @@ -123,7 +124,7 @@ export async function sqlAgentAgentExecute( chatHistory = serializeChatHistory(messages); } - let response; + let response: IDataObject; try { response = await agentExecutor.call({ input, @@ -131,10 +132,10 @@ export async function sqlAgentAgentExecute( chatHistory, }); } catch (error) { - if (error.message?.output) { - response = error.message; + if ((error.message as IDataObject)?.output) { + response = error.message as IDataObject; } else { - throw new NodeOperationError(this.getNode(), error.message, { itemIndex: i }); + throw new NodeOperationError(this.getNode(), error.message as string, { itemIndex: i }); } } diff --git a/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/utils.ts b/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/utils.ts index 575444193c2de..3202fa875ea57 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/utils.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/utils.ts @@ -1,6 +1,6 @@ import { zodToJsonSchema } from 'zod-to-json-schema'; import type { OpenAI as OpenAIClient } from 'openai'; -import type { StructuredTool } from 'langchain/tools'; +import type { StructuredTool } from '@langchain/core/tools'; // Copied from langchain(`langchain/src/tools/convert_to_openai.ts`) // since these functions are not exported diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts index c23dc97cce462..6272e1b6aad6f 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts @@ -8,19 +8,19 @@ import type { INodeTypeDescription, } from 'n8n-workflow'; -import type { BaseLanguageModel } from 'langchain/base_language'; +import type { BaseLanguageModel } from '@langchain/core/language_models/base'; import { AIMessagePromptTemplate, PromptTemplate, SystemMessagePromptTemplate, HumanMessagePromptTemplate, ChatPromptTemplate, -} from 'langchain/prompts'; -import type { BaseOutputParser } from 'langchain/schema/output_parser'; +} from '@langchain/core/prompts'; +import type { BaseOutputParser } from '@langchain/core/output_parsers'; import { CombiningOutputParser } from 'langchain/output_parsers'; import { LLMChain } from 'langchain/chains'; -import type { BaseChatModel } from 'langchain/chat_models/base'; -import { HumanMessage } from 'langchain/schema'; +import type { BaseChatModel } from '@langchain/core/language_models/chat_models'; +import { HumanMessage } from '@langchain/core/messages'; import { getTemplateNoticeField } from '../../../utils/sharedFields'; import { getOptionalOutputParsers, @@ -92,6 +92,7 @@ async function getChainPromptTemplate( llm: BaseLanguageModel | BaseChatModel, messages?: MessagesTemplate[], formatInstructions?: string, + query?: string, ) { const queryTemplate = new PromptTemplate({ template: `{query}${formatInstructions ? '\n{formatInstructions}' : ''}`, @@ -129,7 +130,15 @@ async function getChainPromptTemplate( }), ); - parsedMessages.push(new HumanMessagePromptTemplate(queryTemplate)); + const lastMessage = parsedMessages[parsedMessages.length - 1]; + // If the last message is a human message and it has an array of content, we need to add the query to the last message + if (lastMessage instanceof HumanMessage && Array.isArray(lastMessage.content)) { + const humanMessage = new HumanMessagePromptTemplate(queryTemplate); + const test = await humanMessage.format({ query }); + lastMessage.content.push({ text: test.content.toString(), type: 'text' }); + } else { + parsedMessages.push(new HumanMessagePromptTemplate(queryTemplate)); + } return ChatPromptTemplate.fromMessages(parsedMessages); } @@ -146,6 +155,7 @@ async function createSimpleLLMChain( llm, prompt, }); + const response = (await chain.call({ query, signal: context.getExecutionCancelSignal(), @@ -167,6 +177,8 @@ async function getChain( itemIndex, llm, messages, + undefined, + query, ); // If there are no output parsers, create a simple LLM chain and execute the query @@ -187,6 +199,7 @@ async function getChain( llm, messages, formatInstructions, + query, ); const chain = prompt.pipe(llm).pipe(combinedOutputParser); diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts index 09230b8ed694e..07017dcf37471 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts @@ -8,8 +8,8 @@ import { } from 'n8n-workflow'; import { RetrievalQAChain } from 'langchain/chains'; -import type { BaseLanguageModel } from 'langchain/dist/base_language'; -import type { BaseRetriever } from 'langchain/schema/retriever'; +import type { BaseLanguageModel } from '@langchain/core/language_models/base'; +import type { BaseRetriever } from '@langchain/core/retrievers'; import { getTemplateNoticeField } from '../../../utils/sharedFields'; import { getPromptInputByType } from '../../../utils/helpers'; diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts index f97fb4d1ecb3a..a5d19432774e8 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts @@ -9,9 +9,9 @@ import { import type { SummarizationChainParams } from 'langchain/chains'; import { loadSummarizationChain } from 'langchain/chains'; -import type { BaseLanguageModel } from 'langchain/dist/base_language'; -import type { Document } from 'langchain/document'; -import { PromptTemplate } from 'langchain/prompts'; +import type { BaseLanguageModel } from '@langchain/core/language_models/base'; +import type { Document } from '@langchain/core/documents'; +import { PromptTemplate } from '@langchain/core/prompts'; import { N8nJsonLoader } from '../../../../utils/N8nJsonLoader'; import { N8nBinaryLoader } from '../../../../utils/N8nBinaryLoader'; import { getTemplateNoticeField } from '../../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts index d8aaa992a1af7..6c9aa29bb4847 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts @@ -9,8 +9,8 @@ import type { } from 'n8n-workflow'; import { loadSummarizationChain } from 'langchain/chains'; -import type { BaseLanguageModel } from 'langchain/dist/base_language'; -import type { Document } from 'langchain/document'; +import type { BaseLanguageModel } from '@langchain/core/language_models/base'; +import type { Document } from '@langchain/core/documents'; import type { TextSplitter } from 'langchain/text_splitter'; import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter'; import { N8nJsonLoader } from '../../../../utils/N8nJsonLoader'; diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/helpers.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/helpers.ts index e24e21b77ffd9..2a00d836e8f87 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/helpers.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/helpers.ts @@ -1,6 +1,5 @@ import type { SummarizationChainParams } from 'langchain/chains'; -import { PromptTemplate } from 'langchain/prompts'; - +import { PromptTemplate } from '@langchain/core/prompts'; interface ChainTypeOptions { combineMapPrompt?: string; prompt?: string; diff --git a/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts b/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts index 145b6d1f74cb3..30b205e9daf9b 100644 --- a/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts @@ -15,7 +15,7 @@ import { import { getSandboxContext } from 'n8n-nodes-base/dist/nodes/Code/Sandbox'; import { JavaScriptSandbox } from 'n8n-nodes-base/dist/nodes/Code/JavaScriptSandbox'; import { standardizeOutput } from 'n8n-nodes-base/dist/nodes/Code/utils'; -import type { Tool } from 'langchain/tools'; +import type { Tool } from '@langchain/core/tools'; import { makeResolverFromLegacyOptions } from '@n8n/vm2'; import { logWrapper } from '../../utils/logWrapper'; @@ -36,7 +36,7 @@ const connectorTypes = { [NodeConnectionType.Main]: 'Main', }; -const defaultCodeExecute = `const { PromptTemplate } = require('langchain/prompts'); +const defaultCodeExecute = `const { PromptTemplate } = require('@langchain/core/prompts'); const query = 'Tell me a joke'; const prompt = PromptTemplate.fromTemplate(query); diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.ts index f27591200bcfd..67c916153ec4a 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { BedrockEmbeddings } from 'langchain/embeddings/bedrock'; +import { BedrockEmbeddings } from '@langchain/community/embeddings/bedrock'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.ts index e4503665a6c0b..49942b786ac74 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.ts @@ -7,7 +7,7 @@ import { type SupplyData, } from 'n8n-workflow'; -import { OpenAIEmbeddings } from 'langchain/embeddings/openai'; +import { OpenAIEmbeddings } from '@langchain/openai'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.ts index 0186bb8256d60..94800eb9323a5 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { CohereEmbeddings } from 'langchain/embeddings/cohere'; +import { CohereEmbeddings } from '@langchain/cohere'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; @@ -89,7 +89,7 @@ export class EmbeddingsCohere implements INodeType { const credentials = await this.getCredentials('cohereApi'); const embeddings = new CohereEmbeddings({ apiKey: credentials.apiKey as string, - modelName, + model: modelName, }); return { diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsGooglePalm/EmbeddingsGooglePalm.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsGooglePalm/EmbeddingsGooglePalm.node.ts index 7059eb6e15662..32cbd8822d065 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsGooglePalm/EmbeddingsGooglePalm.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsGooglePalm/EmbeddingsGooglePalm.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { GooglePaLMEmbeddings } from 'langchain/embeddings/googlepalm'; +import { GooglePaLMEmbeddings } from '@langchain/community/embeddings/googlepalm'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.ts index a2fc288b6332a..4adc8d6014d6f 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { HuggingFaceInferenceEmbeddings } from 'langchain/embeddings/hf'; +import { HuggingFaceInferenceEmbeddings } from '@langchain/community/embeddings/hf'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.ts index b2d388e6b41a4..b0cf8277714ef 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { OllamaEmbeddings } from 'langchain/embeddings/ollama'; +import { OllamaEmbeddings } from '@langchain/community/embeddings/ollama'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; import { ollamaDescription, ollamaModel } from '../../llms/LMOllama/description'; diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.ts index eddacc2f1e3fa..fa4387629948a 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.ts @@ -9,7 +9,7 @@ import { } from 'n8n-workflow'; import type { ClientOptions } from 'openai'; -import { OpenAIEmbeddings } from 'langchain/embeddings/openai'; +import { OpenAIEmbeddings } from '@langchain/openai'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.ts index cdadbdfabf819..d6824831fa873 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.ts @@ -1,16 +1,53 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { NodeConnectionType, + type INodeProperties, type IExecuteFunctions, type INodeType, type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { ChatAnthropic } from 'langchain/chat_models/anthropic'; +import { ChatAnthropic } from '@langchain/anthropic'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; +const modelField: INodeProperties = { + displayName: 'Model', + name: 'model', + type: 'options', + // eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items + options: [ + { + name: 'Claude 3 Opus(20240229)', + value: 'claude-3-opus-20240229', + }, + { + name: 'Claude 3 Sonnet(20240229)', + value: 'claude-3-sonnet-20240229', + }, + { + name: 'LEGACY: Claude 2', + value: 'claude-2', + }, + { + name: 'LEGACY: Claude 2.1', + value: 'claude-2.1', + }, + { + name: 'LEGACY: Claude Instant 1.2', + value: 'claude-instant-1.2', + }, + { + name: 'LEGACY: Claude Instant 1', + value: 'claude-instant-1', + }, + ], + description: + 'The model which will generate the completion. Learn more.', + default: 'claude-2', +}; + export class LmChatAnthropic implements INodeType { description: INodeTypeDescription = { displayName: 'Anthropic Chat Model', @@ -18,7 +55,7 @@ export class LmChatAnthropic implements INodeType { name: 'lmChatAnthropic', icon: 'file:anthropic.svg', group: ['transform'], - version: 1, + version: [1, 1.1], description: 'Language Model Anthropic', defaults: { name: 'Anthropic Chat Model', @@ -35,6 +72,7 @@ export class LmChatAnthropic implements INodeType { }, ], }, + alias: ['claude', 'sonnet', 'opus'], }, // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], @@ -50,30 +88,21 @@ export class LmChatAnthropic implements INodeType { properties: [ getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiChain]), { - displayName: 'Model', - name: 'model', - type: 'options', - options: [ - { - name: 'Claude 2', - value: 'claude-2', + ...modelField, + displayOptions: { + show: { + '@version': [1], }, - { - name: 'Claude 2.1', - value: 'claude-2.1', - }, - { - name: 'Claude Instant 1.2', - value: 'claude-instant-1.2', - }, - { - name: 'Claude Instant 1', - value: 'claude-instant-1', + }, + }, + { + ...modelField, + default: 'claude-3-sonnet-20240229', + displayOptions: { + hide: { + '@version': [1], }, - ], - description: - 'The model which will generate the completion. Learn more.', - default: 'claude-2', + }, }, { displayName: 'Options', @@ -86,7 +115,7 @@ export class LmChatAnthropic implements INodeType { { displayName: 'Maximum Number of Tokens', name: 'maxTokensToSample', - default: 32768, + default: 4096, description: 'The maximum number of tokens to generate in the completion', type: 'number', }, @@ -126,12 +155,20 @@ export class LmChatAnthropic implements INodeType { const credentials = await this.getCredentials('anthropicApi'); const modelName = this.getNodeParameter('model', itemIndex) as string; - const options = this.getNodeParameter('options', itemIndex, {}) as object; + const options = this.getNodeParameter('options', itemIndex, {}) as { + maxTokensToSample?: number; + temperature: number; + topK: number; + topP: number; + }; const model = new ChatAnthropic({ anthropicApiKey: credentials.apiKey as string, modelName, - ...options, + maxTokens: options.maxTokensToSample, + temperature: options.temperature, + topK: options.topK, + topP: options.topP, }); return { diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMChatOllama/LmChatOllama.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMChatOllama/LmChatOllama.node.ts index d30bf3ef147b9..b5314b067be3f 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMChatOllama/LmChatOllama.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMChatOllama/LmChatOllama.node.ts @@ -7,8 +7,7 @@ import { type SupplyData, } from 'n8n-workflow'; -import { ChatOllama } from 'langchain/chat_models/ollama'; -// import { ChatAnthropic } from 'langchain/chat_models/anthropic'; +import { ChatOllama } from '@langchain/community/chat_models/ollama'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; import { ollamaModel, ollamaOptions, ollamaDescription } from '../LMOllama/description'; diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts index 838a5266693d0..e69f726d40671 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts @@ -7,8 +7,7 @@ import { type SupplyData, } from 'n8n-workflow'; -import type { ClientOptions } from 'openai'; -import { ChatOpenAI } from 'langchain/chat_models/openai'; +import { ChatOpenAI, type ClientOptions } from '@langchain/openai'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMCohere/LmCohere.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMCohere/LmCohere.node.ts index 0fb8aed2caa81..8c127bb5efaa5 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMCohere/LmCohere.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMCohere/LmCohere.node.ts @@ -7,7 +7,7 @@ import { type SupplyData, } from 'n8n-workflow'; -import { Cohere } from 'langchain/llms/cohere'; +import { Cohere } from '@langchain/cohere'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMOllama/LmOllama.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMOllama/LmOllama.node.ts index 6af03aa7424aa..8904d5b3b6eca 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMOllama/LmOllama.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMOllama/LmOllama.node.ts @@ -7,7 +7,7 @@ import { type SupplyData, } from 'n8n-workflow'; -import { Ollama } from 'langchain/llms/ollama'; +import { Ollama } from '@langchain/community/llms/ollama'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; import { ollamaDescription, ollamaModel, ollamaOptions } from './description'; diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMOpenAi/LmOpenAi.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMOpenAi/LmOpenAi.node.ts index 3f6a94d65e2c4..55398a60b12e3 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMOpenAi/LmOpenAi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMOpenAi/LmOpenAi.node.ts @@ -8,8 +8,7 @@ import type { ILoadOptionsFunctions, } from 'n8n-workflow'; -import type { ClientOptions } from 'openai'; -import { OpenAI } from 'langchain/llms/openai'; +import { OpenAI, type ClientOptions } from '@langchain/openai'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.ts index 65fb25fc1d413..43092ab917b79 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.ts @@ -7,7 +7,7 @@ import { type SupplyData, } from 'n8n-workflow'; -import { HuggingFaceInference } from 'langchain/llms/hf'; +import { HuggingFaceInference } from '@langchain/community/llms/hf'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.ts index 166f0bebedba3..d3ab0796c5205 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { ChatBedrock } from 'langchain/chat_models/bedrock'; +import { BedrockChat } from '@langchain/community/chat_models/bedrock'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; // Dependencies needed underneath the hood. We add them @@ -149,7 +149,7 @@ export class LmChatAwsBedrock implements INodeType { maxTokensToSample: number; }; - const model = new ChatBedrock({ + const model = new BedrockChat({ region: credentials.region as string, model: modelName, temperature: options.temperature, diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.ts index 764b92312136e..dad7643c6d655 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.ts @@ -7,8 +7,8 @@ import { type SupplyData, } from 'n8n-workflow'; -import type { ClientOptions } from 'openai'; -import { ChatOpenAI } from 'langchain/chat_models/openai'; +import type { ClientOptions } from '@langchain/openai'; +import { ChatOpenAI } from '@langchain/openai'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmChatGooglePalm/LmChatGooglePalm.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmChatGooglePalm/LmChatGooglePalm.node.ts index b250c6be70e55..b7d3eb8eda8bb 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmChatGooglePalm/LmChatGooglePalm.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmChatGooglePalm/LmChatGooglePalm.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { ChatGooglePaLM } from 'langchain/chat_models/googlepalm'; +import { ChatGooglePaLM } from '@langchain/community/chat_models/googlepalm'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmGooglePalm/LmGooglePalm.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmGooglePalm/LmGooglePalm.node.ts index 9b88fd3fcaedb..a47001ba3b532 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmGooglePalm/LmGooglePalm.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmGooglePalm/LmGooglePalm.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { GooglePaLM } from 'langchain/llms/googlepalm'; +import { GooglePaLM } from '@langchain/community/llms/googlepalm'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts index d287be1a1312d..9d8b220f493fb 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts @@ -7,8 +7,8 @@ import { type INodeType, type INodeTypeDescription, } from 'n8n-workflow'; -import type { BaseChatMemory } from 'langchain/memory'; -import type { BaseMessage } from 'langchain/schema'; +import type { BaseChatMemory } from '@langchain/community/memory/chat_memory'; +import type { BaseMessage } from '@langchain/core/messages'; function simplifyMessages(messages: BaseMessage[]) { const chunkedMessages = []; diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryManager/MemoryManager.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryManager/MemoryManager.node.ts index c1d91a26d0ef0..ef20fb041f816 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryManager/MemoryManager.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryManager/MemoryManager.node.ts @@ -7,8 +7,8 @@ import type { INodeType, INodeTypeDescription, } from 'n8n-workflow'; -import type { BaseChatMemory } from 'langchain/memory'; -import { AIMessage, SystemMessage, HumanMessage, type BaseMessage } from 'langchain/schema'; +import type { BaseChatMemory } from '@langchain/community/memory/chat_memory'; +import { AIMessage, SystemMessage, HumanMessage, type BaseMessage } from '@langchain/core/messages'; type MessageRole = 'ai' | 'system' | 'user'; interface MessageRecord { diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts index a50bdc0ec0375..9b2f46fb30dd4 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts @@ -7,7 +7,7 @@ import { type SupplyData, } from 'n8n-workflow'; -import { MotorheadMemory } from 'langchain/memory'; +import { MotorheadMemory } from '@langchain/community/memory/motorhead_memory'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; import { sessionIdOption, sessionKeyProperty } from '../descriptions'; diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.ts index 1758ebfa18ec0..d139bd31e365a 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.ts @@ -8,8 +8,8 @@ import { NodeConnectionType, } from 'n8n-workflow'; import { BufferMemory } from 'langchain/memory'; -import type { RedisChatMessageHistoryInput } from 'langchain/stores/message/redis'; -import { RedisChatMessageHistory } from 'langchain/stores/message/redis'; +import type { RedisChatMessageHistoryInput } from '@langchain/redis'; +import { RedisChatMessageHistory } from '@langchain/redis'; import type { RedisClientOptions } from 'redis'; import { createClient } from 'redis'; import { logWrapper } from '../../../utils/logWrapper'; diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryXata/MemoryXata.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryXata/MemoryXata.node.ts index baeee639f97e7..e5c9dc4c35611 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryXata/MemoryXata.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryXata/MemoryXata.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; import type { IExecuteFunctions, INodeType, INodeTypeDescription, SupplyData } from 'n8n-workflow'; -import { XataChatMessageHistory } from 'langchain/stores/message/xata'; +import { XataChatMessageHistory } from '@langchain/community/stores/message/xata'; import { BufferMemory } from 'langchain/memory'; import { BaseClient } from '@xata.io/client'; import { logWrapper } from '../../../utils/logWrapper'; diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryZep/MemoryZep.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryZep/MemoryZep.node.ts index 8de27cb8bab2c..c600e4432d700 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryZep/MemoryZep.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryZep/MemoryZep.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { ZepMemory } from 'langchain/memory/zep'; +import { ZepMemory } from '@langchain/community/memory/zep'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; import { sessionIdOption, sessionKeyProperty } from '../descriptions'; diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts index 0e495913481ee..97c86506b7f1d 100644 --- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts @@ -7,8 +7,8 @@ import { type SupplyData, } from 'n8n-workflow'; import { OutputFixingParser } from 'langchain/output_parsers'; -import type { BaseOutputParser } from 'langchain/schema/output_parser'; -import type { BaseLanguageModel } from 'langchain/base_language'; +import type { BaseOutputParser } from '@langchain/core/output_parsers'; +import type { BaseLanguageModel } from '@langchain/core/language_models/base'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/ItemListOutputParser.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/ItemListOutputParser.ts index ec2173f9243a0..7e596a2b6859f 100644 --- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/ItemListOutputParser.ts +++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/ItemListOutputParser.ts @@ -1,4 +1,4 @@ -import { BaseOutputParser, OutputParserException } from 'langchain/schema/output_parser'; +import { BaseOutputParser, OutputParserException } from '@langchain/core/output_parsers'; export class ItemListOutputParser extends BaseOutputParser { lc_namespace = ['n8n-nodes-langchain', 'output_parsers', 'list_items']; diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts index e4fa7abfc8c1d..33f1d9b558181 100644 --- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts @@ -13,7 +13,7 @@ import { parseSchema } from 'json-schema-to-zod'; import { z } from 'zod'; import type { JSONSchema7 } from 'json-schema'; import { StructuredOutputParser } from 'langchain/output_parsers'; -import { OutputParserException } from 'langchain/schema/output_parser'; +import { OutputParserException } from '@langchain/core/output_parsers'; import get from 'lodash/get'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts index 1ab65194ceeee..2526ecb861e74 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts @@ -9,8 +9,8 @@ import { import { ContextualCompressionRetriever } from 'langchain/retrievers/contextual_compression'; import { LLMChainExtractor } from 'langchain/retrievers/document_compressors/chain_extract'; -import type { BaseLanguageModel } from 'langchain/base_language'; -import type { BaseRetriever } from 'langchain/schema/retriever'; +import type { BaseLanguageModel } from '@langchain/core/language_models/base'; +import type { BaseRetriever } from '@langchain/core/retrievers'; import { logWrapper } from '../../../utils/logWrapper'; diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts index 6939eec6092d4..d594c3a28588a 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts @@ -8,8 +8,8 @@ import { } from 'n8n-workflow'; import { MultiQueryRetriever } from 'langchain/retrievers/multi_query'; -import type { BaseLanguageModel } from 'langchain/base_language'; -import type { BaseRetriever } from 'langchain/schema/retriever'; +import type { BaseLanguageModel } from '@langchain/core/language_models/base'; +import type { BaseRetriever } from '@langchain/core/retrievers'; import { logWrapper } from '../../../utils/logWrapper'; diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts index 92a33538afc09..9dd5dff58aa71 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import type { VectorStore } from 'langchain/vectorstores/base'; +import type { VectorStore } from '@langchain/core/vectorstores'; import { logWrapper } from '../../../utils/logWrapper'; export class RetrieverVectorStore implements INodeType { diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts index baa6c39912681..4f1d288e8308e 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts @@ -11,8 +11,8 @@ import type { SupplyData, } from 'n8n-workflow'; -import { BaseRetriever, type BaseRetrieverInput } from 'langchain/schema/retriever'; -import { Document } from 'langchain/document'; +import { BaseRetriever, type BaseRetrieverInput } from '@langchain/core/retrievers'; +import { Document } from '@langchain/core/documents'; import type { SetField, SetNodeOptions } from 'n8n-nodes-base/dist/nodes/Set/v2/helpers/interfaces'; import * as manual from 'n8n-nodes-base/dist/nodes/Set/v2/manual.mode'; diff --git a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts index 450276afea963..1807ad9f52996 100644 --- a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts @@ -6,11 +6,31 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import type { RecursiveCharacterTextSplitterParams } from 'langchain/text_splitter'; +import type { + RecursiveCharacterTextSplitterParams, + SupportedTextSplitterLanguage, +} from 'langchain/text_splitter'; import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; +const supportedLanguages: SupportedTextSplitterLanguage[] = [ + 'cpp', + 'go', + 'java', + 'js', + 'php', + 'proto', + 'python', + 'rst', + 'ruby', + 'rust', + 'scala', + 'swift', + 'markdown', + 'latex', + 'html', +]; export class TextSplitterRecursiveCharacterTextSplitter implements INodeType { description: INodeTypeDescription = { displayName: 'Recursive Character Text Splitter', @@ -54,6 +74,23 @@ export class TextSplitterRecursiveCharacterTextSplitter implements INodeType { type: 'number', default: 0, }, + { + displayName: 'Options', + name: 'options', + placeholder: 'Add Option', + description: 'Additional options to add', + type: 'collection', + default: {}, + options: [ + { + displayName: 'Split Code', + name: 'splitCode', + default: 'markdown', + type: 'options', + options: supportedLanguages.map((lang) => ({ name: lang, value: lang })), + }, + ], + }, ], }; @@ -62,7 +99,11 @@ export class TextSplitterRecursiveCharacterTextSplitter implements INodeType { const chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number; const chunkOverlap = this.getNodeParameter('chunkOverlap', itemIndex) as number; - + const splitCode = this.getNodeParameter( + 'options.splitCode', + itemIndex, + null, + ) as SupportedTextSplitterLanguage | null; const params: RecursiveCharacterTextSplitterParams = { // TODO: These are the default values, should we allow the user to change them? separators: ['\n\n', '\n', ' ', ''], @@ -70,8 +111,13 @@ export class TextSplitterRecursiveCharacterTextSplitter implements INodeType { chunkOverlap, keepSeparator: false, }; + let splitter: RecursiveCharacterTextSplitter; - const splitter = new RecursiveCharacterTextSplitter(params); + if (splitCode && supportedLanguages.includes(splitCode)) { + splitter = RecursiveCharacterTextSplitter.fromLanguage(splitCode, params); + } else { + splitter = new RecursiveCharacterTextSplitter(params); + } return { response: logWrapper(splitter, this), diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts index 78e70e9d57263..df7cb91a586db 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts @@ -12,7 +12,7 @@ import { getSandboxContext } from 'n8n-nodes-base/dist/nodes/Code/Sandbox'; import { JavaScriptSandbox } from 'n8n-nodes-base/dist/nodes/Code/JavaScriptSandbox'; import { PythonSandbox } from 'n8n-nodes-base/dist/nodes/Code/PythonSandbox'; -import { DynamicTool } from 'langchain/tools'; +import { DynamicTool } from '@langchain/core/tools'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; export class ToolCode implements INodeType { diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolSerpApi/ToolSerpApi.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolSerpApi/ToolSerpApi.node.ts index 77147abdc2868..9a474175473de 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolSerpApi/ToolSerpApi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolSerpApi/ToolSerpApi.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { SerpAPI } from 'langchain/tools'; +import { SerpAPI } from '@langchain/community/tools/serpapi'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolWikipedia/ToolWikipedia.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolWikipedia/ToolWikipedia.node.ts index bc8ff97c0a268..a85d18adaa4a6 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolWikipedia/ToolWikipedia.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolWikipedia/ToolWikipedia.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { WikipediaQueryRun } from 'langchain/tools'; +import { WikipediaQueryRun } from '@langchain/community/tools/wikipedia_query_run'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.ts index ab9f5d43e8792..1a77d067c5a08 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.ts @@ -6,7 +6,7 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import { WolframAlphaTool } from 'langchain/tools'; +import { WolframAlphaTool } from '@langchain/community/tools/wolframalpha'; import { logWrapper } from '../../../utils/logWrapper'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts index de6d9350ed2f4..f69c0f5b0d372 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts @@ -13,7 +13,7 @@ import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; import type { SetField, SetNodeOptions } from 'n8n-nodes-base/dist/nodes/Set/v2/helpers/interfaces'; import * as manual from 'n8n-nodes-base/dist/nodes/Set/v2/manual.mode'; -import { DynamicTool } from 'langchain/tools'; +import { DynamicTool } from '@langchain/core/tools'; import get from 'lodash/get'; import isObject from 'lodash/isObject'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/ChatTrigger.node.ts b/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/ChatTrigger.node.ts index 5ac79f74e1ea3..386479e569966 100644 --- a/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/ChatTrigger.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/ChatTrigger.node.ts @@ -7,7 +7,7 @@ import { NodeConnectionType, } from 'n8n-workflow'; import { pick } from 'lodash'; -import type { BaseChatMemory } from 'langchain/memory'; +import type { BaseChatMemory } from '@langchain/community/memory/chat_memory'; import { createPage } from './templates'; import { validateAuth } from './GenericFunctions'; import type { LoadPreviousSessionChatOption } from './types'; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts index 39f89bfce5a9f..c9c1b560b9c17 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts @@ -7,7 +7,7 @@ import { type INodeTypeDescription, } from 'n8n-workflow'; import type { Document } from 'langchain/document'; -import type { Embeddings } from 'langchain/embeddings/base'; +import type { Embeddings } from '@langchain/core/embeddings'; import type { N8nJsonLoader } from '../../../utils/N8nJsonLoader'; import { processDocuments } from '../shared/processDocuments'; import { MemoryVectorStoreManager } from '../shared/MemoryVectorStoreManager'; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.ts index 1359e13f865e6..c85a245073edd 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.ts @@ -6,7 +6,7 @@ import { type INodeType, type INodeTypeDescription, } from 'n8n-workflow'; -import type { Embeddings } from 'langchain/embeddings/base'; +import type { Embeddings } from '@langchain/core/embeddings'; import { MemoryVectorStoreManager } from '../shared/MemoryVectorStoreManager'; import { logWrapper } from '../../../utils/logWrapper'; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.ts index 9c0c9ccbbae8f..156932beca65e 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.ts @@ -1,6 +1,6 @@ import { NodeOperationError, type INodeProperties } from 'n8n-workflow'; -import type { PineconeLibArgs } from 'langchain/vectorstores/pinecone'; -import { PineconeStore } from 'langchain/vectorstores/pinecone'; +import type { PineconeStoreParams } from '@langchain/pinecone'; +import { PineconeStore } from '@langchain/pinecone'; import { Pinecone } from '@pinecone-database/pinecone'; import { createVectorStoreNode } from '../shared/createVectorStoreNode'; import { metadataFilterField } from '../../../utils/sharedFields'; @@ -87,11 +87,10 @@ export const VectorStorePinecone = createVectorStoreNode({ const client = new Pinecone({ apiKey: credentials.apiKey as string, - environment: credentials.environment as string, }); const pineconeIndex = client.Index(index); - const config: PineconeLibArgs = { + const config: PineconeStoreParams = { namespace: options.pineconeNamespace ?? undefined, pineconeIndex, filter, @@ -111,10 +110,9 @@ export const VectorStorePinecone = createVectorStoreNode({ const client = new Pinecone({ apiKey: credentials.apiKey as string, - environment: credentials.environment as string, }); - const indexes = (await client.listIndexes()).map((i) => i.name); + const indexes = ((await client.listIndexes()).indexes ?? []).map((i) => i.name); if (!indexes.includes(index)) { throw new NodeOperationError(context.getNode(), `Index ${index} not found`, { diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts index 3f89de79e15fd..b024f9b09bd49 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts @@ -5,10 +5,11 @@ import { type INodeExecutionData, NodeConnectionType, } from 'n8n-workflow'; -import { PineconeStore } from 'langchain/vectorstores/pinecone'; +import type { Embeddings } from '@langchain/core/embeddings'; +import type { Document } from '@langchain/core/documents'; + +import { PineconeStore } from '@langchain/pinecone'; import { Pinecone } from '@pinecone-database/pinecone'; -import type { Embeddings } from 'langchain/embeddings/base'; -import type { Document } from 'langchain/document'; import type { N8nJsonLoader } from '../../../utils/N8nJsonLoader'; import { processDocuments } from '../shared/processDocuments'; import { pineconeIndexRLC } from '../shared/descriptions'; @@ -115,7 +116,6 @@ export class VectorStorePineconeInsert implements INodeType { const client = new Pinecone({ apiKey: credentials.apiKey as string, - environment: credentials.environment as string, }); const pineconeIndex = client.Index(index); diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.ts index daec8ef06e5c8..c4ac6e3754cb1 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.ts @@ -5,10 +5,11 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import type { PineconeLibArgs } from 'langchain/vectorstores/pinecone'; -import { PineconeStore } from 'langchain/vectorstores/pinecone'; +import type { PineconeStoreParams } from '@langchain/pinecone'; +import { PineconeStore } from '@langchain/pinecone'; import { Pinecone } from '@pinecone-database/pinecone'; -import type { Embeddings } from 'langchain/embeddings/base'; + +import type { Embeddings } from '@langchain/core/embeddings'; import { logWrapper } from '../../../utils/logWrapper'; import { metadataFilterField } from '../../../utils/sharedFields'; import { getMetadataFiltersValues } from '../../../utils/helpers'; @@ -99,11 +100,10 @@ export class VectorStorePineconeLoad implements INodeType { const client = new Pinecone({ apiKey: credentials.apiKey as string, - environment: credentials.environment as string, }); const pineconeIndex = client.Index(index); - const config: PineconeLibArgs = { + const config: PineconeStoreParams = { namespace: namespace || undefined, pineconeIndex, filter: getMetadataFiltersValues(this, itemIndex), diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.ts index 3a08dfdc421f2..f183d1b1fe9e6 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.ts @@ -1,6 +1,6 @@ import { type INodeProperties } from 'n8n-workflow'; -import type { QdrantLibArgs } from 'langchain/vectorstores/qdrant'; -import { QdrantVectorStore } from 'langchain/vectorstores/qdrant'; +import type { QdrantLibArgs } from '@langchain/community/vectorstores/qdrant'; +import { QdrantVectorStore } from '@langchain/community/vectorstores/qdrant'; import type { Schemas as QdrantSchemas } from '@qdrant/js-client-rest'; import { createVectorStoreNode } from '../shared/createVectorStoreNode'; import { qdrantCollectionRLC } from '../shared/descriptions'; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.ts index b4ceae05485b2..ebeacd9a33f87 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.ts @@ -1,6 +1,6 @@ import { NodeOperationError, type INodeProperties } from 'n8n-workflow'; import { createClient } from '@supabase/supabase-js'; -import { SupabaseVectorStore } from 'langchain/vectorstores/supabase'; +import { SupabaseVectorStore } from '@langchain/community/vectorstores/supabase'; import { createVectorStoreNode } from '../shared/createVectorStoreNode'; import { metadataFilterField } from '../../../utils/sharedFields'; import { supabaseTableNameRLC } from '../shared/descriptions'; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts index c374b083f94a7..d2e772af9e4f3 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts @@ -5,10 +5,10 @@ import { type INodeExecutionData, NodeConnectionType, } from 'n8n-workflow'; -import type { Embeddings } from 'langchain/embeddings/base'; -import type { Document } from 'langchain/document'; +import type { Embeddings } from '@langchain/core/embeddings'; +import type { Document } from '@langchain/core/documents'; import { createClient } from '@supabase/supabase-js'; -import { SupabaseVectorStore } from 'langchain/vectorstores/supabase'; +import { SupabaseVectorStore } from '@langchain/community/vectorstores/supabase'; import type { N8nJsonLoader } from '../../../utils/N8nJsonLoader'; import { processDocuments } from '../shared/processDocuments'; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.ts index 9592c1c06ea83..267277b36ec89 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.ts @@ -5,10 +5,10 @@ import { type SupplyData, NodeConnectionType, } from 'n8n-workflow'; -import type { Embeddings } from 'langchain/embeddings/base'; +import type { Embeddings } from '@langchain/core/embeddings'; import { createClient } from '@supabase/supabase-js'; -import type { SupabaseLibArgs } from 'langchain/vectorstores/supabase'; -import { SupabaseVectorStore } from 'langchain/vectorstores/supabase'; +import type { SupabaseLibArgs } from '@langchain/community/vectorstores/supabase'; +import { SupabaseVectorStore } from '@langchain/community/vectorstores/supabase'; import { logWrapper } from '../../../utils/logWrapper'; import { metadataFilterField } from '../../../utils/sharedFields'; import { getMetadataFiltersValues } from '../../../utils/helpers'; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.ts index 8795efa27f1ab..4f999bb16fc55 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.ts @@ -1,7 +1,7 @@ import type { IDataObject, INodeProperties } from 'n8n-workflow'; import { NodeOperationError } from 'n8n-workflow'; -import type { IZepConfig } from 'langchain/vectorstores/zep'; -import { ZepVectorStore } from 'langchain/vectorstores/zep'; +import type { IZepConfig } from '@langchain/community/vectorstores/zep'; +import { ZepVectorStore } from '@langchain/community/vectorstores/zep'; import { createVectorStoreNode } from '../shared/createVectorStoreNode'; import { metadataFilterField } from '../../../utils/sharedFields'; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts index 36cfecf5768be..53606927700b2 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts @@ -5,9 +5,9 @@ import { type INodeExecutionData, NodeConnectionType, } from 'n8n-workflow'; -import { ZepVectorStore } from 'langchain/vectorstores/zep'; -import type { Embeddings } from 'langchain/embeddings/base'; -import type { Document } from 'langchain/document'; +import { ZepVectorStore } from '@langchain/community/vectorstores/zep'; +import type { Embeddings } from '@langchain/core/embeddings'; +import type { Document } from '@langchain/core/documents'; import type { N8nJsonLoader } from '../../../utils/N8nJsonLoader'; import { processDocuments } from '../shared/processDocuments'; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.ts index c0e50221d50f8..56313e1634da6 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.ts @@ -5,9 +5,9 @@ import { type INodeTypeDescription, type SupplyData, } from 'n8n-workflow'; -import type { IZepConfig } from 'langchain/vectorstores/zep'; -import { ZepVectorStore } from 'langchain/vectorstores/zep'; -import type { Embeddings } from 'langchain/embeddings/base'; +import type { IZepConfig } from '@langchain/community/vectorstores/zep'; +import { ZepVectorStore } from '@langchain/community/vectorstores/zep'; +import type { Embeddings } from '@langchain/core/embeddings'; import { metadataFilterField } from '../../../utils/sharedFields'; import { getMetadataFiltersValues } from '../../../utils/helpers'; import { logWrapper } from '../../../utils/logWrapper'; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/MemoryVectorStoreManager.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/MemoryVectorStoreManager.ts index 4cc022aafed28..806a5129c55eb 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/MemoryVectorStoreManager.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/MemoryVectorStoreManager.ts @@ -1,5 +1,5 @@ -import type { Document } from 'langchain/document'; -import type { Embeddings } from 'langchain/embeddings/base'; +import type { Document } from '@langchain/core/documents'; +import type { Embeddings } from '@langchain/core/embeddings'; import { MemoryVectorStore } from 'langchain/vectorstores/memory'; export class MemoryVectorStoreManager { diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts index 409fae30abd35..e9045bd107309 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts @@ -1,6 +1,6 @@ /* eslint-disable n8n-nodes-base/node-filename-against-convention */ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ -import type { VectorStore } from 'langchain/vectorstores/base'; +import type { VectorStore } from '@langchain/core/vectorstores'; import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; import type { INodeCredentialDescription, @@ -13,8 +13,8 @@ import type { ILoadOptionsFunctions, INodeListSearchResult, } from 'n8n-workflow'; -import type { Embeddings } from 'langchain/embeddings/base'; -import type { Document } from 'langchain/document'; +import type { Embeddings } from '@langchain/core/embeddings'; +import type { Document } from '@langchain/core/documents'; import { logWrapper } from '../../../utils/logWrapper'; import type { N8nJsonLoader } from '../../../utils/N8nJsonLoader'; import type { N8nBinaryLoader } from '../../../utils/N8nBinaryLoader'; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/methods/listSearch.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/methods/listSearch.ts index d606a0db05c20..f12ff5d5cf0b9 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/methods/listSearch.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/methods/listSearch.ts @@ -7,12 +7,11 @@ export async function pineconeIndexSearch(this: ILoadOptionsFunctions) { const client = new Pinecone({ apiKey: credentials.apiKey as string, - environment: credentials.environment as string, }); const indexes = await client.listIndexes(); - const results = indexes.map((index) => ({ + const results = (indexes.indexes ?? []).map((index) => ({ name: index.name, value: index.name, })); diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/processDocuments.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/processDocuments.ts index 9a4d8a77f5d4c..5a3847d6911a1 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/processDocuments.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/processDocuments.ts @@ -1,4 +1,4 @@ -import type { Document } from 'langchain/document'; +import type { Document } from '@langchain/core/documents'; import type { INodeExecutionData } from 'n8n-workflow'; import { N8nJsonLoader } from '../../../utils/N8nJsonLoader'; import { N8nBinaryLoader } from '../../../utils/N8nBinaryLoader'; diff --git a/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/assistant/create.operation.ts b/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/assistant/create.operation.ts index 3e34aed9e26f7..aa511a3ca44f8 100644 --- a/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/assistant/create.operation.ts +++ b/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/assistant/create.operation.ts @@ -170,7 +170,7 @@ export async function execute(this: IExecuteFunctions, i: number): Promise { - const connectedTools = ((await ctx.getInputConnectionData(NodeConnectionType.AiTool, 0)) as Tool[]) || []; + const connectedTools = + ((await ctx.getInputConnectionData(NodeConnectionType.AiTool, 0)) as Tool[]) || []; - if (!enforceUniqueNames) return connectedTools; + if (!enforceUniqueNames) return connectedTools; - const seenNames = new Set(); + const seenNames = new Set(); - for (const tool of connectedTools) { - if (!(tool instanceof DynamicTool)) continue; + for (const tool of connectedTools) { + if (!(tool instanceof DynamicTool)) continue; - const { name } = tool; - if (seenNames.has(name)) { - throw new NodeOperationError( - ctx.getNode(), - `You have multiple tools with the same name: '${name}', please rename them to avoid conflicts`, - ); - } - seenNames.add(name); - } + const { name } = tool; + if (seenNames.has(name)) { + throw new NodeOperationError( + ctx.getNode(), + `You have multiple tools with the same name: '${name}', please rename them to avoid conflicts`, + ); + } + seenNames.add(name); + } - return connectedTools; + return connectedTools; }; diff --git a/packages/@n8n/nodes-langchain/utils/logWrapper.ts b/packages/@n8n/nodes-langchain/utils/logWrapper.ts index 37b19b6324b34..c4bb7e59e8198 100644 --- a/packages/@n8n/nodes-langchain/utils/logWrapper.ts +++ b/packages/@n8n/nodes-langchain/utils/logWrapper.ts @@ -1,25 +1,29 @@ import { NodeOperationError, NodeConnectionType } from 'n8n-workflow'; import type { ConnectionTypes, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow'; -import { Tool } from 'langchain/tools'; -import type { ChatResult, InputValues, BaseMessage } from 'langchain/schema'; -import { BaseChatMessageHistory } from 'langchain/schema'; -import type { BaseChatModel } from 'langchain/chat_models/base'; -import type { CallbackManagerForLLMRun } from 'langchain/callbacks'; - -import { Embeddings } from 'langchain/embeddings/base'; -import { VectorStore } from 'langchain/vectorstores/base'; -import type { Document } from 'langchain/document'; +import { Tool } from '@langchain/core/tools'; +import type { BaseMessage } from '@langchain/core/messages'; +import type { InputValues, MemoryVariables, OutputValues } from '@langchain/core/memory'; +import type { ChatResult } from '@langchain/core/outputs'; +import { BaseChatMessageHistory } from '@langchain/core/chat_history'; +import type { BaseChatModel } from '@langchain/core/language_models/chat_models'; +import type { + CallbackManagerForLLMRun, + BaseCallbackConfig, + Callbacks, +} from '@langchain/core/callbacks/manager'; + +import { Embeddings } from '@langchain/core/embeddings'; +import { VectorStore } from '@langchain/core/vectorstores'; +import type { Document } from '@langchain/core/documents'; import { TextSplitter } from 'langchain/text_splitter'; -import type { BaseDocumentLoader } from 'langchain/document_loaders/base'; -import type { BaseCallbackConfig, Callbacks } from 'langchain/dist/callbacks/manager'; -import { BaseLLM } from 'langchain/llms/base'; -import { BaseChatMemory } from 'langchain/memory'; -import type { MemoryVariables, OutputValues } from 'langchain/dist/memory/base'; -import { BaseRetriever } from 'langchain/schema/retriever'; -import type { FormatInstructionsOptions } from 'langchain/schema/output_parser'; -import { BaseOutputParser, OutputParserException } from 'langchain/schema/output_parser'; +import { BaseLLM } from '@langchain/core/language_models/llms'; +import { BaseChatMemory } from '@langchain/community/memory/chat_memory'; +import { BaseRetriever } from '@langchain/core/retrievers'; +import type { FormatInstructionsOptions } from '@langchain/core/output_parsers'; +import { BaseOutputParser, OutputParserException } from '@langchain/core/output_parsers'; import { isObject } from 'lodash'; +import type { BaseDocumentLoader } from 'langchain/dist/document_loaders/base'; import { N8nJsonLoader } from './N8nJsonLoader'; import { N8nBinaryLoader } from './N8nBinaryLoader'; import { isChatInstance, logAiEvent } from './helpers'; @@ -524,6 +528,7 @@ export function logWrapper( } } + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return (target as any)[prop]; }, }); diff --git a/packages/editor-ui/src/components/RunDataAi/useAiContentParsers.ts b/packages/editor-ui/src/components/RunDataAi/useAiContentParsers.ts index 723e53b040b04..50d5ccf558772 100644 --- a/packages/editor-ui/src/components/RunDataAi/useAiContentParsers.ts +++ b/packages/editor-ui/src/components/RunDataAi/useAiContentParsers.ts @@ -95,20 +95,21 @@ const outputTypeParsers: { ) { interface MessageContent { type: string; + text?: string; image_url?: { url: string; }; } let message = content.kwargs.content; if (Array.isArray(message)) { - const messageContent = message[0] as { - type?: string; - image_url?: { url: string }; - }; - if (messageContent?.type === 'image_url') { - message = `![Input image](${messageContent.image_url?.url})`; - } - message = message as MessageContent[]; + message = (message as MessageContent[]) + .map((item) => { + if (item?.type === 'image_url') { + return `![Input image](${item.image_url?.url})`; + } + return item.text; + }) + .join('\n'); } if (Object.keys(content.kwargs.additional_kwargs).length) { message += ` (${JSON.stringify(content.kwargs.additional_kwargs)})`; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b294605ef15fb..6700df4c63609 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,7 +22,7 @@ overrides: xml2js: ^0.5.0 cpy@8>globby: ^11.1.0 qqjs>globby: ^11.1.0 - '@langchain/core': ^0.1.8 + '@langchain/core': 0.1.41 patchedDependencies: '@sentry/cli@2.17.0': @@ -194,12 +194,30 @@ importers: '@huggingface/inference': specifier: 2.6.4 version: 2.6.4 + '@langchain/anthropic': + specifier: ^0.1.3 + version: 0.1.3 + '@langchain/cohere': + specifier: ^0.0.5 + version: 0.0.5 + '@langchain/community': + specifier: ^0.0.34 + version: 0.0.34(@aws-sdk/client-bedrock-runtime@3.454.0)(@aws-sdk/credential-provider-node@3.451.0)(@getzep/zep-js@0.9.0)(@google-ai/generativelanguage@0.2.1)(@huggingface/inference@2.6.4)(@pinecone-database/pinecone@2.0.1)(@qdrant/js-client-rest@1.7.0)(@supabase/supabase-js@2.38.5)(@xata.io/client@0.28.0)(cohere-ai@6.2.2)(html-to-text@9.0.5)(lodash@4.17.21)(pg@8.11.3)(redis@4.6.12) '@langchain/core': - specifier: ^0.1.8 - version: 0.1.8 + specifier: 0.1.41 + version: 0.1.41 '@langchain/mistralai': - specifier: 0.0.6 - version: 0.0.6 + specifier: 0.0.7 + version: 0.0.7 + '@langchain/openai': + specifier: ^0.0.16 + version: 0.0.16 + '@langchain/pinecone': + specifier: ^0.0.3 + version: 0.0.3 + '@langchain/redis': + specifier: ^0.0.2 + version: 0.0.2 '@n8n/typeorm': specifier: 0.3.20-3 version: 0.3.20-3(mssql@9.1.1)(pg@8.11.3)(redis@4.6.12)(sqlite3@5.1.7) @@ -207,8 +225,8 @@ importers: specifier: 3.9.20 version: 3.9.20 '@pinecone-database/pinecone': - specifier: 1.1.2 - version: 1.1.2 + specifier: 2.0.1 + version: 2.0.1 '@qdrant/js-client-rest': specifier: 1.7.0 version: 1.7.0(typescript@5.3.2) @@ -216,8 +234,8 @@ importers: specifier: 2.38.5 version: 2.38.5 '@xata.io/client': - specifier: 0.25.3 - version: 0.25.3(typescript@5.3.2) + specifier: 0.28.0 + version: 0.28.0(typescript@5.3.2) basic-auth: specifier: 2.0.1 version: 2.0.1 @@ -240,8 +258,8 @@ importers: specifier: 1.2.0 version: 1.2.0 langchain: - specifier: 0.0.198 - version: 0.0.198(@aws-sdk/client-bedrock-runtime@3.454.0)(@aws-sdk/credential-provider-node@3.451.0)(@getzep/zep-js@0.9.0)(@google-ai/generativelanguage@0.2.1)(@huggingface/inference@2.6.4)(@pinecone-database/pinecone@1.1.2)(@qdrant/js-client-rest@1.7.0)(@supabase/supabase-js@2.38.5)(@xata.io/client@0.25.3)(axios@1.6.7)(cohere-ai@6.2.2)(d3-dsv@2.0.0)(epub2@3.0.1)(html-to-text@9.0.5)(lodash@4.17.21)(mammoth@1.6.0)(pdf-parse@1.1.1)(pg@8.11.3)(redis@4.6.12) + specifier: 0.1.25 + version: 0.1.25(@aws-sdk/client-bedrock-runtime@3.454.0)(@aws-sdk/credential-provider-node@3.451.0)(@getzep/zep-js@0.9.0)(@google-ai/generativelanguage@0.2.1)(@huggingface/inference@2.6.4)(@pinecone-database/pinecone@2.0.1)(@qdrant/js-client-rest@1.7.0)(@supabase/supabase-js@2.38.5)(@xata.io/client@0.28.0)(axios@1.6.7)(cohere-ai@6.2.2)(d3-dsv@2.0.0)(epub2@3.0.1)(html-to-text@9.0.5)(lodash@4.17.21)(mammoth@1.6.0)(pdf-parse@1.1.1)(pg@8.11.3)(redis@4.6.12) lodash: specifier: 4.17.21 version: 4.17.21 @@ -258,8 +276,8 @@ importers: specifier: workspace:* version: link:../../workflow openai: - specifier: 4.20.0 - version: 4.20.0 + specifier: 4.26.1 + version: 4.26.1 pdf-parse: specifier: 1.1.1 version: 1.1.1 @@ -275,6 +293,9 @@ importers: temp: specifier: 0.9.4 version: 0.9.4 + tmp-promise: + specifier: 3.0.3 + version: 3.0.3 zod: specifier: 3.22.4 version: 3.22.4 @@ -1602,6 +1623,23 @@ packages: resolution: {integrity: sha512-pvFiLP2BeOKA/ZOS6jxx4XhKzdVLHDhGlFEaZ2flWWYf2xOqVniqpk38I04DFRyz+L0ASggl7SkItTc+ZLju4w==} dev: true + /@anthropic-ai/sdk@0.15.0: + resolution: {integrity: sha512-QMNEFcwGGB64oEIL+U9b+mxSbat5TCdNxvQVV0qCNGQvg/nlnbOmq2/x/0mKhuKD0n5bioL75oCkTbQaAgyYtw==} + dependencies: + '@types/node': 18.16.16 + '@types/node-fetch': 2.6.4 + abort-controller: 3.0.0 + agentkeepalive: 4.2.1 + digest-fetch: 1.3.0 + form-data-encoder: 1.7.2 + formdata-node: 4.4.1 + node-fetch: 2.7.0(encoding@0.1.13) + web-streams-polyfill: 3.2.1 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + /@anthropic-ai/sdk@0.9.1: resolution: {integrity: sha512-wa1meQ2WSfoY8Uor3EdrJq0jTiZJoKoSii2ZVWRY1oN4Tlr5s59pADg9T79FTbPe1/se5c3pBeZgJL63wmuoBA==} dependencies: @@ -4348,18 +4386,6 @@ packages: engines: {node: '>=10.0.0'} dev: true - /@edge-runtime/primitives@4.0.5: - resolution: {integrity: sha512-t7QiN5d/KpXgCvIfSt6Nm9Hj3WVdNgc5CpOD73jasY+9EvTI7Ngdj5cXvjcHrPcmYWJZMySPgeEeoL/1N/Llag==} - engines: {node: '>=16'} - dev: false - - /@edge-runtime/types@2.2.7: - resolution: {integrity: sha512-9MTwGooICP7+ZsX9BTy6YCRzOr4tP6RFRymsc8CaKORfvuAHgLZUQaLwILfQ94tddufVXcBwq637VfEd3ZXbWA==} - engines: {node: '>=16'} - dependencies: - '@edge-runtime/primitives': 4.0.5 - dev: false - /@element-plus/icons-vue@2.1.0(vue@3.4.21): resolution: {integrity: sha512-PSBn3elNoanENc1vnCfh+3WA9fimRC7n+fWkf3rE5jvv+aBohNHABC/KAR5KWPecxWxDTVT1ERpRbOMRcOV/vA==} peerDependencies: @@ -5456,36 +5482,376 @@ packages: - supports-color dev: false - /@kwsites/promise-deferred@1.1.1: - resolution: {integrity: sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==} - dev: false - - /@langchain/core@0.1.8: - resolution: {integrity: sha512-ZTQ/NFjBbOKktVL+BlT/Fal5Ys0GAhygWeWdGNoFZg0qJfSt54fQzFhljNSpnQQ4Wavj8NkkCLiSFMnxDAuHjg==} + /@kwsites/promise-deferred@1.1.1: + resolution: {integrity: sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==} + dev: false + + /@langchain/anthropic@0.1.3: + resolution: {integrity: sha512-osixwWnuof2dx9C9VkVF2/Xi208qzIA20o/W9NuTt6SVCp1TjJm7guxrQiGjdqhdsM2v+7oeKmKJRYlT2prpOQ==} + engines: {node: '>=18'} + dependencies: + '@anthropic-ai/sdk': 0.15.0 + '@langchain/core': 0.1.41 + fast-xml-parser: 4.3.5 + zod: 3.22.4 + zod-to-json-schema: 3.22.4(zod@3.22.4) + transitivePeerDependencies: + - encoding + - supports-color + dev: false + + /@langchain/cohere@0.0.5: + resolution: {integrity: sha512-4q6dHZ6XCk5NIrLBzxedNGwlmj7cROVvAtSnCaDsLKVKX2cgTUxjiSKAtzjX39RqHwCsdt919ZRdL/X15AQK/w==} + engines: {node: '>=18'} + dependencies: + '@langchain/core': 0.1.41 + cohere-ai: 7.7.7 + transitivePeerDependencies: + - encoding + dev: false + + /@langchain/community@0.0.34(@aws-sdk/client-bedrock-runtime@3.454.0)(@aws-sdk/credential-provider-node@3.451.0)(@getzep/zep-js@0.9.0)(@google-ai/generativelanguage@0.2.1)(@huggingface/inference@2.6.4)(@pinecone-database/pinecone@2.0.1)(@qdrant/js-client-rest@1.7.0)(@supabase/supabase-js@2.38.5)(@xata.io/client@0.28.0)(cohere-ai@6.2.2)(html-to-text@9.0.5)(lodash@4.17.21)(pg@8.11.3)(redis@4.6.12): + resolution: {integrity: sha512-eU3VyK7dZ3S05E4IQ3IVb3B8Ja/GaNDHaXhfjUJfZLOwyZrrLMhshGRIbbO+iMqJz8omGK761QK14v0G0/U3iw==} + engines: {node: '>=18'} + peerDependencies: + '@aws-crypto/sha256-js': ^5.0.0 + '@aws-sdk/client-bedrock-agent-runtime': ^3.485.0 + '@aws-sdk/client-bedrock-runtime': ^3.422.0 + '@aws-sdk/client-dynamodb': ^3.310.0 + '@aws-sdk/client-kendra': ^3.352.0 + '@aws-sdk/client-lambda': ^3.310.0 + '@aws-sdk/client-sagemaker-runtime': ^3.310.0 + '@aws-sdk/client-sfn': ^3.310.0 + '@aws-sdk/credential-provider-node': ^3.388.0 + '@azure/search-documents': ^12.0.0 + '@clickhouse/client': ^0.2.5 + '@cloudflare/ai': '*' + '@datastax/astra-db-ts': ^0.1.4 + '@elastic/elasticsearch': ^8.4.0 + '@getmetal/metal-sdk': '*' + '@getzep/zep-js': ^0.9.0 + '@gomomento/sdk': ^1.51.1 + '@gomomento/sdk-core': ^1.51.1 + '@google-ai/generativelanguage': ^0.2.1 + '@gradientai/nodejs-sdk': ^1.2.0 + '@huggingface/inference': ^2.6.4 + '@mozilla/readability': '*' + '@opensearch-project/opensearch': '*' + '@pinecone-database/pinecone': '*' + '@planetscale/database': ^1.8.0 + '@qdrant/js-client-rest': ^1.2.0 + '@raycast/api': ^1.55.2 + '@rockset/client': ^0.9.1 + '@smithy/eventstream-codec': ^2.0.5 + '@smithy/protocol-http': ^3.0.6 + '@smithy/signature-v4': ^2.0.10 + '@smithy/util-utf8': ^2.0.0 + '@supabase/postgrest-js': ^1.1.1 + '@supabase/supabase-js': ^2.10.0 + '@tensorflow-models/universal-sentence-encoder': '*' + '@tensorflow/tfjs-converter': '*' + '@tensorflow/tfjs-core': '*' + '@upstash/redis': ^1.20.6 + '@upstash/vector': ^1.0.2 + '@vercel/kv': ^0.2.3 + '@vercel/postgres': ^0.5.0 + '@writerai/writer-sdk': ^0.40.2 + '@xata.io/client': ^0.28.0 + '@xenova/transformers': ^2.5.4 + '@zilliz/milvus2-sdk-node': '>=2.2.7' + better-sqlite3: ^9.4.0 + cassandra-driver: ^4.7.2 + chromadb: '*' + closevector-common: 0.1.3 + closevector-node: 0.1.6 + closevector-web: 0.1.6 + cohere-ai: '*' + convex: ^1.3.1 + discord.js: ^14.14.1 + dria: ^0.0.3 + faiss-node: ^0.5.1 + firebase-admin: ^11.9.0 || ^12.0.0 + google-auth-library: ^8.9.0 + googleapis: ^126.0.1 + hnswlib-node: ^1.4.2 + html-to-text: ^9.0.5 + ioredis: ^5.3.2 + jsdom: '*' + llmonitor: ^0.5.9 + lodash: ^4.17.21 + lunary: ^0.6.11 + mongodb: '>=5.2.0' + mysql2: ^3.3.3 + neo4j-driver: '*' + node-llama-cpp: '*' + pg: ^8.11.0 + pg-copy-streams: ^6.0.5 + pickleparser: ^0.2.1 + portkey-ai: ^0.1.11 + redis: '*' + replicate: ^0.18.0 + typeorm: ^0.3.12 + typesense: ^1.5.3 + usearch: ^1.1.1 + vectordb: ^0.1.4 + voy-search: 0.6.2 + weaviate-ts-client: '*' + web-auth-library: ^1.0.3 + ws: ^8.14.2 + peerDependenciesMeta: + '@aws-crypto/sha256-js': + optional: true + '@aws-sdk/client-bedrock-agent-runtime': + optional: true + '@aws-sdk/client-bedrock-runtime': + optional: true + '@aws-sdk/client-dynamodb': + optional: true + '@aws-sdk/client-kendra': + optional: true + '@aws-sdk/client-lambda': + optional: true + '@aws-sdk/client-sagemaker-runtime': + optional: true + '@aws-sdk/client-sfn': + optional: true + '@aws-sdk/credential-provider-node': + optional: true + '@azure/search-documents': + optional: true + '@clickhouse/client': + optional: true + '@cloudflare/ai': + optional: true + '@datastax/astra-db-ts': + optional: true + '@elastic/elasticsearch': + optional: true + '@getmetal/metal-sdk': + optional: true + '@getzep/zep-js': + optional: true + '@gomomento/sdk': + optional: true + '@gomomento/sdk-core': + optional: true + '@google-ai/generativelanguage': + optional: true + '@gradientai/nodejs-sdk': + optional: true + '@huggingface/inference': + optional: true + '@mozilla/readability': + optional: true + '@opensearch-project/opensearch': + optional: true + '@pinecone-database/pinecone': + optional: true + '@planetscale/database': + optional: true + '@qdrant/js-client-rest': + optional: true + '@raycast/api': + optional: true + '@rockset/client': + optional: true + '@smithy/eventstream-codec': + optional: true + '@smithy/protocol-http': + optional: true + '@smithy/signature-v4': + optional: true + '@smithy/util-utf8': + optional: true + '@supabase/postgrest-js': + optional: true + '@supabase/supabase-js': + optional: true + '@tensorflow-models/universal-sentence-encoder': + optional: true + '@tensorflow/tfjs-converter': + optional: true + '@tensorflow/tfjs-core': + optional: true + '@upstash/redis': + optional: true + '@upstash/vector': + optional: true + '@vercel/kv': + optional: true + '@vercel/postgres': + optional: true + '@writerai/writer-sdk': + optional: true + '@xata.io/client': + optional: true + '@xenova/transformers': + optional: true + '@zilliz/milvus2-sdk-node': + optional: true + better-sqlite3: + optional: true + cassandra-driver: + optional: true + chromadb: + optional: true + closevector-common: + optional: true + closevector-node: + optional: true + closevector-web: + optional: true + cohere-ai: + optional: true + convex: + optional: true + discord.js: + optional: true + dria: + optional: true + faiss-node: + optional: true + firebase-admin: + optional: true + google-auth-library: + optional: true + googleapis: + optional: true + hnswlib-node: + optional: true + html-to-text: + optional: true + ioredis: + optional: true + jsdom: + optional: true + llmonitor: + optional: true + lodash: + optional: true + lunary: + optional: true + mongodb: + optional: true + mysql2: + optional: true + neo4j-driver: + optional: true + node-llama-cpp: + optional: true + pg: + optional: true + pg-copy-streams: + optional: true + pickleparser: + optional: true + portkey-ai: + optional: true + redis: + optional: true + replicate: + optional: true + typeorm: + optional: true + typesense: + optional: true + usearch: + optional: true + vectordb: + optional: true + voy-search: + optional: true + weaviate-ts-client: + optional: true + web-auth-library: + optional: true + ws: + optional: true + dependencies: + '@aws-sdk/client-bedrock-runtime': 3.454.0 + '@aws-sdk/credential-provider-node': 3.451.0 + '@getzep/zep-js': 0.9.0 + '@google-ai/generativelanguage': 0.2.1 + '@huggingface/inference': 2.6.4 + '@langchain/core': 0.1.41 + '@langchain/openai': 0.0.16 + '@pinecone-database/pinecone': 2.0.1 + '@qdrant/js-client-rest': 1.7.0(typescript@5.3.2) + '@supabase/supabase-js': 2.38.5 + '@xata.io/client': 0.28.0(typescript@5.3.2) + cohere-ai: 6.2.2 + flat: 5.0.2 + html-to-text: 9.0.5 + langsmith: 0.1.12 + lodash: 4.17.21 + pg: 8.11.3 + redis: 4.6.12 + uuid: 9.0.0 + zod: 3.22.4 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + + /@langchain/core@0.1.41: + resolution: {integrity: sha512-h7UuoB8CDv0Ux4k9rXFpiXONg3Jod/46hpSj+ZZx3U9WuNL2rB6IIdJrYYCQ/0EVpZteA/1/XWyxVFeL9QCIFA==} engines: {node: '>=18'} dependencies: ansi-styles: 5.2.0 camelcase: 6.3.0 decamelize: 1.2.0 js-tiktoken: 1.0.8 - langsmith: 0.0.48 + langsmith: 0.1.12 ml-distance: 4.0.1 p-queue: 6.6.2 p-retry: 4.6.2 uuid: 9.0.0 zod: 3.22.4 + zod-to-json-schema: 3.22.4(zod@3.22.4) dev: false - /@langchain/mistralai@0.0.6: - resolution: {integrity: sha512-zA/xxKNF+rDM9IF1uvVx+LI/eWPZSO85tJBX60ENeQrcM35np92Sm3ca0D4ixcdBAkG0vnn+9ELcYHGdknCbHQ==} + /@langchain/mistralai@0.0.7: + resolution: {integrity: sha512-i0L463ojB9/LHSYo3MCYBWkCsb+qqNxD6PYRAJQ1fObSqLqpGIhRRIWegipIte8MFzIfREkOTiEQEbwIM1I7Wg==} engines: {node: '>=18'} dependencies: - '@langchain/core': 0.1.8 + '@langchain/core': 0.1.41 '@mistralai/mistralai': 0.0.7 transitivePeerDependencies: - debug dev: false + /@langchain/openai@0.0.16: + resolution: {integrity: sha512-GUEeyQ4/pwqr60sPwadrlN5DLe8a3sOhF3ZC96bJTqt9P6rmBQTxwYSHysmsRL/VN9k79+CsqTQ1krrwbocDmQ==} + engines: {node: '>=18'} + dependencies: + '@langchain/core': 0.1.41 + js-tiktoken: 1.0.8 + openai: 4.26.1 + zod: 3.22.4 + zod-to-json-schema: 3.22.4(zod@3.22.4) + transitivePeerDependencies: + - encoding + - supports-color + dev: false + + /@langchain/pinecone@0.0.3: + resolution: {integrity: sha512-uhmGdiF6OLL583kQNMdKl799+3E1nQphrZ4a/Y/yQcXKUPVNZYwNLUimK1ws80RBhfqR7DKvywkvERoOsvCDlA==} + engines: {node: '>=18'} + dependencies: + '@langchain/core': 0.1.41 + '@pinecone-database/pinecone': 2.0.1 + flat: 5.0.2 + uuid: 9.0.0 + dev: false + + /@langchain/redis@0.0.2: + resolution: {integrity: sha512-kDaW4JotKH4J9QxcsRP0onydxz8QgGD1bYosdpzuZ2a7kYcDeJWMqapR0eFFjOznemgyn27jxUFGG0GhvI3pYA==} + engines: {node: '>=18'} + dependencies: + '@langchain/core': 0.1.41 + redis: 4.6.13 + dev: false + /@lezer/common@1.1.0: resolution: {integrity: sha512-XPIN3cYDXsoJI/oDWoR2tD++juVrhgIago9xyKhZ7IhGlzdDM9QgC8D8saKNCz5pindGcznFr2HBSsEQSWnSjw==} dev: false @@ -6018,17 +6384,14 @@ packages: '@otplib/plugin-thirty-two': 12.0.1 dev: true - /@pinecone-database/pinecone@1.1.2: - resolution: {integrity: sha512-xrvaMWWloTjT70pSxvw+Es2f7qX5lzhtTZBfduagtwGQqK0nFMqS6Jq+1yqzobDaUhqfRfVwRZ95Gm10odqD3Q==} + /@pinecone-database/pinecone@2.0.1: + resolution: {integrity: sha512-a1ejzrqdSQ2yW+9QUi2TVlKwYUbrvGH+QH6POJhITyaOz9ANE+EhXqToC9af93Ctzq9n87+bOUvBvewLeW++Mw==} engines: {node: '>=14.0.0'} dependencies: - '@edge-runtime/types': 2.2.7 '@sinclair/typebox': 0.29.6 - '@types/node': 18.16.16 ajv: 8.12.0 cross-fetch: 3.1.8(encoding@0.1.13) encoding: 0.1.13 - typescript: 5.3.2 dev: false /@pinia/testing@0.1.3(pinia@2.1.6)(vue@3.4.21): @@ -6647,6 +7010,14 @@ packages: '@redis/client': 1.5.13 dev: false + /@redis/bloom@1.2.0(@redis/client@1.5.14): + resolution: {integrity: sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==} + peerDependencies: + '@redis/client': ^1.0.0 + dependencies: + '@redis/client': 1.5.14 + dev: false + /@redis/client@1.5.13: resolution: {integrity: sha512-epkUM9D0Sdmt93/8Ozk43PNjLi36RZzG+d/T1Gdu5AI8jvghonTeLYV69WVWdilvFo+PYxbP0TZ0saMvr6nscQ==} engines: {node: '>=14'} @@ -6656,6 +7027,15 @@ packages: yallist: 4.0.0 dev: false + /@redis/client@1.5.14: + resolution: {integrity: sha512-YGn0GqsRBFUQxklhY7v562VMOP0DcmlrHHs3IV1mFE3cbxe31IITUkqhBcIhVSI/2JqtWAJXg5mjV4aU+zD0HA==} + engines: {node: '>=14'} + dependencies: + cluster-key-slot: 1.1.2 + generic-pool: 3.9.0 + yallist: 4.0.0 + dev: false + /@redis/graph@1.1.1(@redis/client@1.5.13): resolution: {integrity: sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==} peerDependencies: @@ -6664,6 +7044,14 @@ packages: '@redis/client': 1.5.13 dev: false + /@redis/graph@1.1.1(@redis/client@1.5.14): + resolution: {integrity: sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==} + peerDependencies: + '@redis/client': ^1.0.0 + dependencies: + '@redis/client': 1.5.14 + dev: false + /@redis/json@1.0.6(@redis/client@1.5.13): resolution: {integrity: sha512-rcZO3bfQbm2zPRpqo82XbW8zg4G/w4W3tI7X8Mqleq9goQjAGLL7q/1n1ZX4dXEAmORVZ4s1+uKLaUOg7LrUhw==} peerDependencies: @@ -6672,6 +7060,14 @@ packages: '@redis/client': 1.5.13 dev: false + /@redis/json@1.0.6(@redis/client@1.5.14): + resolution: {integrity: sha512-rcZO3bfQbm2zPRpqo82XbW8zg4G/w4W3tI7X8Mqleq9goQjAGLL7q/1n1ZX4dXEAmORVZ4s1+uKLaUOg7LrUhw==} + peerDependencies: + '@redis/client': ^1.0.0 + dependencies: + '@redis/client': 1.5.14 + dev: false + /@redis/search@1.1.6(@redis/client@1.5.13): resolution: {integrity: sha512-mZXCxbTYKBQ3M2lZnEddwEAks0Kc7nauire8q20oA0oA/LoA+E/b5Y5KZn232ztPb1FkIGqo12vh3Lf+Vw5iTw==} peerDependencies: @@ -6680,6 +7076,14 @@ packages: '@redis/client': 1.5.13 dev: false + /@redis/search@1.1.6(@redis/client@1.5.14): + resolution: {integrity: sha512-mZXCxbTYKBQ3M2lZnEddwEAks0Kc7nauire8q20oA0oA/LoA+E/b5Y5KZn232ztPb1FkIGqo12vh3Lf+Vw5iTw==} + peerDependencies: + '@redis/client': ^1.0.0 + dependencies: + '@redis/client': 1.5.14 + dev: false + /@redis/time-series@1.0.5(@redis/client@1.5.13): resolution: {integrity: sha512-IFjIgTusQym2B5IZJG3XKr5llka7ey84fw/NOYqESP5WUfQs9zz1ww/9+qoz4ka/S6KcGBodzlCeZ5UImKbscg==} peerDependencies: @@ -6688,6 +7092,14 @@ packages: '@redis/client': 1.5.13 dev: false + /@redis/time-series@1.0.5(@redis/client@1.5.14): + resolution: {integrity: sha512-IFjIgTusQym2B5IZJG3XKr5llka7ey84fw/NOYqESP5WUfQs9zz1ww/9+qoz4ka/S6KcGBodzlCeZ5UImKbscg==} + peerDependencies: + '@redis/client': ^1.0.0 + dependencies: + '@redis/client': 1.5.14 + dev: false + /@redocly/ajv@8.11.0: resolution: {integrity: sha512-9GWx27t7xWhDIR02PA18nzBdLcKQRgc46xNQvjFkrYk4UOmvKhJ/dawwiX0cCOeetN5LcaaiqQbVOWYK62SGHw==} dependencies: @@ -11106,8 +11518,8 @@ packages: '@xtuc/long': 4.2.2 dev: true - /@xata.io/client@0.25.3(typescript@5.3.2): - resolution: {integrity: sha512-JM3FWFRFNG4W+F4PO0jNVf2byMqJP319iH3SrOQh8Hi+AI+WUW2PyNVShCt5cwykjxhJVzeEd9xUnq++HVVdWA==} + /@xata.io/client@0.28.0(typescript@5.3.2): + resolution: {integrity: sha512-V6rpx+9C6uYdGUDUvk5xIot19zRvDEQhkHXWGIkKY/SCKu4w68S81Z88tgGLRaknSFjpAm7H/rvGBR2DrDpqtQ==} peerDependencies: typescript: ^5.3.0 dependencies: @@ -12817,6 +13229,18 @@ packages: resolution: {integrity: sha512-+Tq+4e8N/YWKJqFpWaULsfbZR/GOvGh8WWYFKR1bpipu8bCok3VcbTPnBmIToQiIqOgFpGk3HsA4b0guVyL3vg==} dev: false + /cohere-ai@7.7.7: + resolution: {integrity: sha512-eLL/5lkAxFvqwV200bsBsS5ZnPHZZKur0WR3dXD5K47QT7C9r0OFv/ykJw/rCuoSsyyK3eoHm+znIi3W3QCwiQ==} + dependencies: + form-data: 4.0.0 + js-base64: 3.7.2 + node-fetch: 2.7.0(encoding@0.1.13) + qs: 6.11.2 + url-join: 4.0.1 + transitivePeerDependencies: + - encoding + dev: false + /collect-v8-coverage@1.0.1: resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==} dev: true @@ -15317,6 +15741,13 @@ packages: strnum: 1.0.5 dev: false + /fast-xml-parser@4.3.5: + resolution: {integrity: sha512-sWvP1Pl8H03B8oFJpFR3HE31HUfwtX7Rlf9BNsvdpujD4n7WMhfmu8h9wOV2u+c1k0ZilTADhPqypzx2J690ZQ==} + hasBin: true + dependencies: + strnum: 1.0.5 + dev: false + /fastest-levenshtein@1.0.16: resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} engines: {node: '>= 4.9.1'} @@ -18446,121 +18877,62 @@ packages: resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} dev: false - /langchain@0.0.198(@aws-sdk/client-bedrock-runtime@3.454.0)(@aws-sdk/credential-provider-node@3.451.0)(@getzep/zep-js@0.9.0)(@google-ai/generativelanguage@0.2.1)(@huggingface/inference@2.6.4)(@pinecone-database/pinecone@1.1.2)(@qdrant/js-client-rest@1.7.0)(@supabase/supabase-js@2.38.5)(@xata.io/client@0.25.3)(axios@1.6.7)(cohere-ai@6.2.2)(d3-dsv@2.0.0)(epub2@3.0.1)(html-to-text@9.0.5)(lodash@4.17.21)(mammoth@1.6.0)(pdf-parse@1.1.1)(pg@8.11.3)(redis@4.6.12): - resolution: {integrity: sha512-YC0O1g8r61InCWyF5NmiQjdghdq6LKcgMrDZtqLbgDxAe4RoSldonm+5oNXS3yjCISG0j3s5Cty+yB7klqvUpg==} + /langchain@0.1.25(@aws-sdk/client-bedrock-runtime@3.454.0)(@aws-sdk/credential-provider-node@3.451.0)(@getzep/zep-js@0.9.0)(@google-ai/generativelanguage@0.2.1)(@huggingface/inference@2.6.4)(@pinecone-database/pinecone@2.0.1)(@qdrant/js-client-rest@1.7.0)(@supabase/supabase-js@2.38.5)(@xata.io/client@0.28.0)(axios@1.6.7)(cohere-ai@6.2.2)(d3-dsv@2.0.0)(epub2@3.0.1)(html-to-text@9.0.5)(lodash@4.17.21)(mammoth@1.6.0)(pdf-parse@1.1.1)(pg@8.11.3)(redis@4.6.12): + resolution: {integrity: sha512-sfEChvr4H2CklHdSByNBbytwBrFhgtA5kPOnwcBrxuXGg1iOaTzhVxQA0QcNcQucI3hZrsNbZjxGp+Can1ooZQ==} engines: {node: '>=18'} peerDependencies: - '@aws-crypto/sha256-js': ^5.0.0 - '@aws-sdk/client-bedrock-runtime': ^3.422.0 - '@aws-sdk/client-dynamodb': ^3.310.0 - '@aws-sdk/client-kendra': ^3.352.0 - '@aws-sdk/client-lambda': ^3.310.0 '@aws-sdk/client-s3': ^3.310.0 '@aws-sdk/client-sagemaker-runtime': ^3.310.0 '@aws-sdk/client-sfn': ^3.310.0 '@aws-sdk/credential-provider-node': ^3.388.0 '@azure/storage-blob': ^12.15.0 - '@clickhouse/client': ^0.2.5 - '@cloudflare/ai': ^1.0.12 - '@elastic/elasticsearch': ^8.4.0 - '@getmetal/metal-sdk': '*' - '@getzep/zep-js': ^0.9.0 '@gomomento/sdk': ^1.51.1 '@gomomento/sdk-core': ^1.51.1 '@gomomento/sdk-web': ^1.51.1 '@google-ai/generativelanguage': ^0.2.1 - '@google-cloud/storage': ^6.10.1 - '@huggingface/inference': ^2.6.4 - '@mozilla/readability': '*' + '@google-cloud/storage': ^6.10.1 || ^7.7.0 '@notionhq/client': ^2.2.10 - '@opensearch-project/opensearch': '*' - '@pinecone-database/pinecone': ^1.1.0 - '@planetscale/database': ^1.8.0 - '@qdrant/js-client-rest': ^1.2.0 - '@raycast/api': ^1.55.2 - '@rockset/client': ^0.9.1 - '@smithy/eventstream-codec': ^2.0.5 - '@smithy/protocol-http': ^3.0.6 - '@smithy/signature-v4': ^2.0.10 - '@smithy/util-utf8': ^2.0.0 - '@supabase/postgrest-js': ^1.1.1 + '@pinecone-database/pinecone': '*' '@supabase/supabase-js': ^2.10.0 - '@tensorflow-models/universal-sentence-encoder': '*' - '@tensorflow/tfjs-converter': '*' - '@tensorflow/tfjs-core': '*' - '@upstash/redis': ^1.20.6 '@vercel/kv': ^0.2.3 - '@vercel/postgres': ^0.5.0 - '@writerai/writer-sdk': ^0.40.2 - '@xata.io/client': ^0.25.1 - '@xenova/transformers': ^2.5.4 - '@zilliz/milvus2-sdk-node': '>=2.2.7' + '@xata.io/client': ^0.28.0 apify-client: ^2.7.1 - assemblyai: ^2.0.2 + assemblyai: ^4.0.0 axios: 1.6.7 - cassandra-driver: ^4.7.2 cheerio: ^1.0.0-rc.12 chromadb: '*' - closevector-common: 0.1.0-alpha.1 - closevector-node: 0.1.0-alpha.10 - closevector-web: 0.1.0-alpha.16 - cohere-ai: '>=6.0.0' convex: ^1.3.1 + couchbase: ^4.2.10 d3-dsv: ^2.0.0 epub2: ^3.0.1 - faiss-node: ^0.5.1 + faiss-node: '*' fast-xml-parser: ^4.2.7 - firebase-admin: ^11.9.0 google-auth-library: ^8.9.0 - googleapis: ^126.0.1 - hnswlib-node: ^1.4.2 + handlebars: ^4.7.8 html-to-text: ^9.0.5 ignore: ^5.2.0 ioredis: ^5.3.2 jsdom: '*' - llmonitor: ^0.5.9 - lodash: ^4.17.21 - mammoth: '*' - mongodb: ^5.2.0 - mysql2: ^3.3.3 - neo4j-driver: '*' + mammoth: ^1.6.0 + mongodb: '>=5.2.0' node-llama-cpp: '*' notion-to-md: ^3.1.0 officeparser: ^4.0.4 pdf-parse: 1.1.1 peggy: ^3.0.2 - pg: ^8.11.0 - pg-copy-streams: ^6.0.5 - pickleparser: ^0.2.1 playwright: ^1.32.1 - portkey-ai: ^0.1.11 puppeteer: ^19.7.2 pyodide: ^0.24.1 redis: ^4.6.4 - replicate: ^0.18.0 sonix-speech-recognition: ^2.1.1 - srt-parser-2: ^1.2.2 + srt-parser-2: ^1.2.3 typeorm: ^0.3.12 - typesense: ^1.5.3 - usearch: ^1.1.1 - vectordb: ^0.1.4 - voy-search: 0.6.2 - weaviate-ts-client: ^1.4.0 + weaviate-ts-client: '*' web-auth-library: ^1.0.3 ws: ^8.14.2 youtube-transcript: ^1.0.6 - youtubei.js: ^5.8.0 + youtubei.js: ^9.1.0 peerDependenciesMeta: - '@aws-crypto/sha256-js': - optional: true - '@aws-sdk/client-bedrock-runtime': - optional: true - '@aws-sdk/client-dynamodb': - optional: true - '@aws-sdk/client-kendra': - optional: true - '@aws-sdk/client-lambda': - optional: true '@aws-sdk/client-s3': optional: true '@aws-sdk/client-sagemaker-runtime': @@ -18571,16 +18943,6 @@ packages: optional: true '@azure/storage-blob': optional: true - '@clickhouse/client': - optional: true - '@cloudflare/ai': - optional: true - '@elastic/elasticsearch': - optional: true - '@getmetal/metal-sdk': - optional: true - '@getzep/zep-js': - optional: true '@gomomento/sdk': optional: true '@gomomento/sdk-core': @@ -18591,78 +18953,30 @@ packages: optional: true '@google-cloud/storage': optional: true - '@huggingface/inference': - optional: true - '@mozilla/readability': - optional: true '@notionhq/client': optional: true - '@opensearch-project/opensearch': - optional: true '@pinecone-database/pinecone': optional: true - '@planetscale/database': - optional: true - '@qdrant/js-client-rest': - optional: true - '@raycast/api': - optional: true - '@rockset/client': - optional: true - '@smithy/eventstream-codec': - optional: true - '@smithy/protocol-http': - optional: true - '@smithy/signature-v4': - optional: true - '@smithy/util-utf8': - optional: true - '@supabase/postgrest-js': - optional: true '@supabase/supabase-js': optional: true - '@tensorflow-models/universal-sentence-encoder': - optional: true - '@tensorflow/tfjs-converter': - optional: true - '@tensorflow/tfjs-core': - optional: true - '@upstash/redis': - optional: true '@vercel/kv': optional: true - '@vercel/postgres': - optional: true - '@writerai/writer-sdk': - optional: true '@xata.io/client': optional: true - '@xenova/transformers': - optional: true - '@zilliz/milvus2-sdk-node': - optional: true apify-client: optional: true assemblyai: optional: true axios: optional: true - cassandra-driver: - optional: true cheerio: optional: true chromadb: optional: true - closevector-common: - optional: true - closevector-node: - optional: true - closevector-web: - optional: true - cohere-ai: - optional: true convex: optional: true + couchbase: + optional: true d3-dsv: optional: true epub2: @@ -18671,13 +18985,9 @@ packages: optional: true fast-xml-parser: optional: true - firebase-admin: - optional: true google-auth-library: optional: true - googleapis: - optional: true - hnswlib-node: + handlebars: optional: true html-to-text: optional: true @@ -18687,18 +18997,10 @@ packages: optional: true jsdom: optional: true - llmonitor: - optional: true - lodash: - optional: true mammoth: optional: true mongodb: optional: true - mysql2: - optional: true - neo4j-driver: - optional: true node-llama-cpp: optional: true notion-to-md: @@ -18709,38 +19011,20 @@ packages: optional: true peggy: optional: true - pg: - optional: true - pg-copy-streams: - optional: true - pickleparser: - optional: true playwright: optional: true - portkey-ai: - optional: true puppeteer: optional: true pyodide: optional: true redis: optional: true - replicate: - optional: true sonix-speech-recognition: optional: true srt-parser-2: optional: true typeorm: optional: true - typesense: - optional: true - usearch: - optional: true - vectordb: - optional: true - voy-search: - optional: true weaviate-ts-client: optional: true web-auth-library: @@ -18753,54 +19037,106 @@ packages: optional: true dependencies: '@anthropic-ai/sdk': 0.9.1 - '@aws-sdk/client-bedrock-runtime': 3.454.0 '@aws-sdk/credential-provider-node': 3.451.0 - '@getzep/zep-js': 0.9.0 '@google-ai/generativelanguage': 0.2.1 - '@huggingface/inference': 2.6.4 - '@langchain/core': 0.1.8 - '@pinecone-database/pinecone': 1.1.2 - '@qdrant/js-client-rest': 1.7.0(typescript@5.3.2) + '@langchain/community': 0.0.34(@aws-sdk/client-bedrock-runtime@3.454.0)(@aws-sdk/credential-provider-node@3.451.0)(@getzep/zep-js@0.9.0)(@google-ai/generativelanguage@0.2.1)(@huggingface/inference@2.6.4)(@pinecone-database/pinecone@2.0.1)(@qdrant/js-client-rest@1.7.0)(@supabase/supabase-js@2.38.5)(@xata.io/client@0.28.0)(cohere-ai@6.2.2)(html-to-text@9.0.5)(lodash@4.17.21)(pg@8.11.3)(redis@4.6.12) + '@langchain/core': 0.1.41 + '@langchain/openai': 0.0.16 + '@pinecone-database/pinecone': 2.0.1 '@supabase/supabase-js': 2.38.5 - '@xata.io/client': 0.25.3(typescript@5.3.2) + '@xata.io/client': 0.28.0(typescript@5.3.2) axios: 1.6.7 binary-extensions: 2.2.0 - cohere-ai: 6.2.2 d3-dsv: 2.0.0 epub2: 3.0.1(ts-toolbelt@9.6.0) expr-eval: 2.0.2 - flat: 5.0.2 html-to-text: 9.0.5 js-tiktoken: 1.0.8 js-yaml: 4.1.0 jsonpointer: 5.0.1 - langchainhub: 0.0.6 - langsmith: 0.0.48 - lodash: 4.17.21 + langchainhub: 0.0.8 + langsmith: 0.1.12 mammoth: 1.6.0 ml-distance: 4.0.1 - openai: 4.20.0 openapi-types: 12.1.3 p-retry: 4.6.2 pdf-parse: 1.1.1 - pg: 8.11.3 redis: 4.6.12 uuid: 9.0.0 yaml: 2.3.4 zod: 3.22.4 - zod-to-json-schema: 3.20.3(zod@3.22.4) + zod-to-json-schema: 3.22.4(zod@3.22.4) transitivePeerDependencies: + - '@aws-crypto/sha256-js' + - '@aws-sdk/client-bedrock-agent-runtime' + - '@aws-sdk/client-bedrock-runtime' + - '@aws-sdk/client-dynamodb' + - '@aws-sdk/client-kendra' + - '@aws-sdk/client-lambda' + - '@azure/search-documents' + - '@clickhouse/client' + - '@cloudflare/ai' + - '@datastax/astra-db-ts' + - '@elastic/elasticsearch' + - '@getmetal/metal-sdk' + - '@getzep/zep-js' + - '@gradientai/nodejs-sdk' + - '@huggingface/inference' + - '@mozilla/readability' + - '@opensearch-project/opensearch' + - '@planetscale/database' + - '@qdrant/js-client-rest' + - '@raycast/api' + - '@rockset/client' + - '@smithy/eventstream-codec' + - '@smithy/protocol-http' + - '@smithy/signature-v4' + - '@smithy/util-utf8' + - '@supabase/postgrest-js' + - '@tensorflow-models/universal-sentence-encoder' + - '@tensorflow/tfjs-converter' + - '@tensorflow/tfjs-core' + - '@upstash/redis' + - '@upstash/vector' + - '@vercel/postgres' + - '@writerai/writer-sdk' + - '@xenova/transformers' + - '@zilliz/milvus2-sdk-node' + - better-sqlite3 + - cassandra-driver + - closevector-common + - closevector-node + - closevector-web + - cohere-ai + - discord.js + - dria - encoding + - firebase-admin + - googleapis + - hnswlib-node + - llmonitor + - lodash + - lunary + - mysql2 + - neo4j-driver + - pg + - pg-copy-streams + - pickleparser + - portkey-ai + - replicate - supports-color + - typesense + - usearch + - vectordb + - voy-search dev: false - /langchainhub@0.0.6: - resolution: {integrity: sha512-SW6105T+YP1cTe0yMf//7kyshCgvCTyFBMTgH2H3s9rTAR4e+78DA/BBrUL/Mt4Q5eMWui7iGuAYb3pgGsdQ9w==} + /langchainhub@0.0.8: + resolution: {integrity: sha512-Woyb8YDHgqqTOZvWIbm2CaFDGfZ4NTSyXV687AG4vXEfoNo7cGQp7nhl7wL3ehenKWmNEmcxCLgOZzW8jE6lOQ==} dev: false - /langsmith@0.0.48: - resolution: {integrity: sha512-s0hW8iZ90Q9XLTnDK0Pgee245URV3b1cXQjPDj5OKm1+KN7iSK1pKx+4CO7RcFLz58Ixe7Mt+mVcomYqUuryxQ==} - hasBin: true + /langsmith@0.1.12: + resolution: {integrity: sha512-ActVB73EPOIXNbtM8Xm+hjX/ZX39EOnNaCOVaRY/LZQiFDH6+ZbPd4hRm6FfwaXe1zhGqP9nKS3JtVTGY1S+VA==} dependencies: '@types/uuid': 9.0.7 commander: 10.0.1 @@ -20764,8 +21100,8 @@ packages: is-docker: 2.2.1 is-wsl: 2.2.0 - /openai@4.20.0: - resolution: {integrity: sha512-VbAYerNZFfIIeESS+OL9vgDkK8Mnri55n+jN0UN/HZeuM0ghGh6nDN6UGRZxslNgyJ7XmY/Ca9DO4YYyvrszGA==} + /openai@4.26.1: + resolution: {integrity: sha512-DvWbjhWbappsFRatOWmu4Dp1/Q4RG9oOz6CfOSjy0/Drb8G+5iAiqWAO4PfpGIkhOOKtvvNfQri2SItl+U7LhQ==} hasBin: true dependencies: '@types/node': 18.16.16 @@ -22333,6 +22669,13 @@ packages: dependencies: side-channel: 1.0.4 + /qs@6.11.2: + resolution: {integrity: sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: false + /query-string@7.1.3: resolution: {integrity: sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==} engines: {node: '>=6'} @@ -22688,6 +23031,17 @@ packages: '@redis/time-series': 1.0.5(@redis/client@1.5.13) dev: false + /redis@4.6.13: + resolution: {integrity: sha512-MHgkS4B+sPjCXpf+HfdetBwbRz6vCtsceTmw1pHNYJAsYxrfpOP6dz+piJWGos8wqG7qb3vj/Rrc5qOlmInUuA==} + dependencies: + '@redis/bloom': 1.2.0(@redis/client@1.5.14) + '@redis/client': 1.5.14 + '@redis/graph': 1.1.1(@redis/client@1.5.14) + '@redis/json': 1.0.6(@redis/client@1.5.14) + '@redis/search': 1.1.6(@redis/client@1.5.14) + '@redis/time-series': 1.0.5(@redis/client@1.5.14) + dev: false + /redoc@2.1.3(core-js@3.35.0)(mobx@6.12.0)(react-dom@18.2.0)(react@18.2.0)(styled-components@6.1.8): resolution: {integrity: sha512-d7F9qLLxaiFW4GC03VkwlX9wuRIpx9aiIIf3o6mzMnqPfhxrn2IRKGndrkJeVdItgCfmg9jXZiFEowm60f1meQ==} engines: {node: '>=6.9', npm: '>=3.0.0'} @@ -25547,6 +25901,10 @@ packages: deprecated: Please see https://github.com/lydell/urix#deprecated dev: true + /url-join@4.0.1: + resolution: {integrity: sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==} + dev: false + /url-parse@1.5.10: resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} dependencies: @@ -26848,16 +27206,16 @@ packages: commander: 9.4.1 dev: true - /zod-to-json-schema@3.20.3(zod@3.22.4): - resolution: {integrity: sha512-/Q3wnyxAfCt94ZcrGiXXoiAfRqasxl9CX64LZ9fj+4dKH68zulUtU0uk1WMxQPfAxQ0ZI70dKzcoW7hHj+DwSQ==} + /zod-to-json-schema@3.22.0(zod@3.22.4): + resolution: {integrity: sha512-XQr8EwxPMzJGhoR+d/nRFWdi15VaZ+R5Uhssm+Xx5yS30xCpuutfKRm4rerE0SK9j2dWB5Z3FvDD0w8WMVGzkA==} peerDependencies: - zod: ^3.20.0 + zod: ^3.22.4 dependencies: zod: 3.22.4 dev: false - /zod-to-json-schema@3.22.0(zod@3.22.4): - resolution: {integrity: sha512-XQr8EwxPMzJGhoR+d/nRFWdi15VaZ+R5Uhssm+Xx5yS30xCpuutfKRm4rerE0SK9j2dWB5Z3FvDD0w8WMVGzkA==} + /zod-to-json-schema@3.22.4(zod@3.22.4): + resolution: {integrity: sha512-2Ed5dJ+n/O3cU383xSY28cuVi0BCQhF8nYqWU5paEpl7fVdqdAmiLdqLyfblbNdfOFwFfi/mqU4O1pwc60iBhQ==} peerDependencies: zod: ^3.22.4 dependencies: