refactor: Update Langchain modules & add Ollama tools support (#10208)

This commit is contained in:
oleg 2024-07-26 14:30:33 +02:00 committed by GitHub
parent 8ef0a0c58a
commit 5a51b1db5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 296 additions and 534 deletions

View file

@ -113,6 +113,7 @@ function getInputs(
'@n8n/n8n-nodes-langchain.lmChatAnthropic', '@n8n/n8n-nodes-langchain.lmChatAnthropic',
'@n8n/n8n-nodes-langchain.lmChatAzureOpenAi', '@n8n/n8n-nodes-langchain.lmChatAzureOpenAi',
'@n8n/n8n-nodes-langchain.lmChatMistralCloud', '@n8n/n8n-nodes-langchain.lmChatMistralCloud',
'@n8n/n8n-nodes-langchain.lmChatOllama',
'@n8n/n8n-nodes-langchain.lmChatOpenAi', '@n8n/n8n-nodes-langchain.lmChatOpenAi',
'@n8n/n8n-nodes-langchain.lmChatGroq', '@n8n/n8n-nodes-langchain.lmChatGroq',
'@n8n/n8n-nodes-langchain.lmChatGoogleVertex', '@n8n/n8n-nodes-langchain.lmChatGoogleVertex',

View file

@ -22,7 +22,7 @@ import { LLMChain } from 'langchain/chains';
import type { BaseChatModel } from '@langchain/core/language_models/chat_models'; import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
import { HumanMessage } from '@langchain/core/messages'; import { HumanMessage } from '@langchain/core/messages';
import { ChatGoogleGenerativeAI } from '@langchain/google-genai'; import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
import { ChatOllama } from '@langchain/community/chat_models/ollama'; import { ChatOllama } from '@langchain/ollama';
import { getTemplateNoticeField } from '../../../utils/sharedFields'; import { getTemplateNoticeField } from '../../../utils/sharedFields';
import { import {
getOptionalOutputParsers, getOptionalOutputParsers,

View file

@ -7,8 +7,8 @@ import {
type SupplyData, type SupplyData,
} from 'n8n-workflow'; } from 'n8n-workflow';
import type { ChatOllamaInput } from '@langchain/community/chat_models/ollama'; import type { ChatOllamaInput } from '@langchain/ollama';
import { ChatOllama } from '@langchain/community/chat_models/ollama'; import { ChatOllama } from '@langchain/ollama';
import { getConnectionHintNoticeField } from '../../../utils/sharedFields'; import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
import { ollamaModel, ollamaOptions, ollamaDescription } from '../LMOllama/description'; import { ollamaModel, ollamaOptions, ollamaDescription } from '../LMOllama/description';
import { N8nLlmTracing } from '../N8nLlmTracing'; import { N8nLlmTracing } from '../N8nLlmTracing';

View file

@ -131,29 +131,30 @@
"dependencies": { "dependencies": {
"@aws-sdk/client-bedrock-runtime": "3.535.0", "@aws-sdk/client-bedrock-runtime": "3.535.0",
"@aws-sdk/credential-provider-node": "3.535.0", "@aws-sdk/credential-provider-node": "3.535.0",
"@getzep/zep-cloud": "1.0.6", "@getzep/zep-cloud": "1.0.11",
"@getzep/zep-js": "0.9.0", "@getzep/zep-js": "0.9.0",
"@google-ai/generativelanguage": "2.5.0", "@google-ai/generativelanguage": "2.5.0",
"@google-cloud/resource-manager": "5.3.0", "@google-cloud/resource-manager": "5.3.0",
"@google/generative-ai": "0.11.4", "@google/generative-ai": "0.11.4",
"@huggingface/inference": "2.7.0", "@huggingface/inference": "2.7.0",
"@langchain/anthropic": "0.1.21", "@langchain/anthropic": "0.2.9",
"@langchain/cohere": "0.0.10", "@langchain/cohere": "0.0.10",
"@langchain/community": "0.2.13", "@langchain/community": "0.2.20",
"@langchain/core": "0.2.9", "@langchain/core": "0.2.18",
"@langchain/google-genai": "0.0.16", "@langchain/google-genai": "0.0.23",
"@langchain/google-vertexai": "0.0.19", "@langchain/google-vertexai": "0.0.21",
"@langchain/groq": "0.0.12", "@langchain/groq": "0.0.15",
"@langchain/mistralai": "0.0.22", "@langchain/mistralai": "0.0.27",
"@langchain/openai": "0.0.33", "@langchain/ollama": "^0.0.2",
"@langchain/pinecone": "0.0.6", "@langchain/openai": "0.2.5",
"@langchain/pinecone": "0.0.8",
"@langchain/qdrant": "^0.0.5", "@langchain/qdrant": "^0.0.5",
"@langchain/redis": "0.0.5", "@langchain/redis": "0.0.5",
"@langchain/textsplitters": "0.0.2", "@langchain/textsplitters": "0.0.3",
"@mozilla/readability": "^0.5.0", "@mozilla/readability": "^0.5.0",
"@n8n/typeorm": "0.3.20-10", "@n8n/typeorm": "0.3.20-10",
"@n8n/vm2": "3.9.20", "@n8n/vm2": "3.9.20",
"@pinecone-database/pinecone": "2.2.1", "@pinecone-database/pinecone": "3.0.0",
"@qdrant/js-client-rest": "1.9.0", "@qdrant/js-client-rest": "1.9.0",
"@supabase/supabase-js": "2.43.4", "@supabase/supabase-js": "2.43.4",
"@types/pg": "^8.11.3", "@types/pg": "^8.11.3",
@ -168,12 +169,12 @@
"html-to-text": "9.0.5", "html-to-text": "9.0.5",
"jsdom": "^23.0.1", "jsdom": "^23.0.1",
"json-schema-to-zod": "2.1.0", "json-schema-to-zod": "2.1.0",
"langchain": "0.2.2", "langchain": "0.2.11",
"lodash": "4.17.21", "lodash": "4.17.21",
"mammoth": "1.7.2", "mammoth": "1.7.2",
"n8n-nodes-base": "workspace:*", "n8n-nodes-base": "workspace:*",
"n8n-workflow": "workspace:*", "n8n-workflow": "workspace:*",
"openai": "4.47.1", "openai": "4.53.0",
"pdf-parse": "1.1.1", "pdf-parse": "1.1.1",
"pg": "8.11.3", "pg": "8.11.3",
"redis": "4.6.12", "redis": "4.6.12",

View file

@ -29,7 +29,7 @@
"dist/**/*" "dist/**/*"
], ],
"devDependencies": { "devDependencies": {
"@langchain/core": "^0.2.9", "@langchain/core": "^0.2.18",
"@types/deep-equal": "^1.0.1", "@types/deep-equal": "^1.0.1",
"@types/express": "^4.17.21", "@types/express": "^4.17.21",
"@types/jmespath": "^0.15.0", "@types/jmespath": "^0.15.0",

File diff suppressed because it is too large Load diff