Skip to content

Commit 28487ed

Browse files
burivuhsternetroy
andauthored
chore: Upgrade LangChain packages to latest versions (no-changelog) (#11771)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <[email protected]>
1 parent 80a2093 commit 28487ed

File tree

6 files changed

+194
-228
lines changed

6 files changed

+194
-228
lines changed

Diff for: packages/@n8n/json-schema-to-zod/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export type * from './types';
2-
export { jsonSchemaToZod } from './json-schema-to-zod.js';
2+
export { jsonSchemaToZod } from './json-schema-to-zod';

Diff for: packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/utils.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import type { ZodObjectAny } from '@langchain/core/dist/types/zod';
1+
import type { z } from 'zod';
22
import type { BaseOutputParser } from '@langchain/core/output_parsers';
33
import type { DynamicStructuredTool, Tool } from 'langchain/tools';
44
import { NodeOperationError, type IExecuteFunctions, type INode } from 'n8n-workflow';
55

6+
type ZodObjectAny = z.ZodObject<any, any, any, any>;
7+
68
export async function extractParsedOutput(
79
ctx: IExecuteFunctions,
810
outputParser: BaseOutputParser<unknown>,

Diff for: packages/@n8n/nodes-langchain/package.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -135,47 +135,47 @@
135135
"@getzep/zep-js": "0.9.0",
136136
"@google-ai/generativelanguage": "2.6.0",
137137
"@google-cloud/resource-manager": "5.3.0",
138-
"@google/generative-ai": "0.19.0",
138+
"@google/generative-ai": "0.21.0",
139139
"@huggingface/inference": "2.8.0",
140-
"@langchain/anthropic": "0.3.7",
141-
"@langchain/aws": "0.1.1",
140+
"@langchain/anthropic": "0.3.8",
141+
"@langchain/aws": "0.1.2",
142142
"@langchain/cohere": "0.3.1",
143-
"@langchain/community": "0.3.11",
143+
"@langchain/community": "0.3.15",
144144
"@langchain/core": "catalog:",
145-
"@langchain/google-genai": "0.1.2",
146-
"@langchain/google-vertexai": "0.1.0",
145+
"@langchain/google-genai": "0.1.4",
146+
"@langchain/google-vertexai": "0.1.3",
147147
"@langchain/groq": "0.1.2",
148-
"@langchain/mistralai": "0.1.1",
149-
"@langchain/ollama": "0.1.1",
150-
"@langchain/openai": "0.3.11",
151-
"@langchain/pinecone": "0.1.1",
152-
"@langchain/qdrant": "0.1.0",
148+
"@langchain/mistralai": "0.2.0",
149+
"@langchain/ollama": "0.1.2",
150+
"@langchain/openai": "0.3.14",
151+
"@langchain/pinecone": "0.1.3",
152+
"@langchain/qdrant": "0.1.1",
153153
"@langchain/redis": "0.1.0",
154154
"@langchain/textsplitters": "0.1.0",
155155
"@mozilla/readability": "0.5.0",
156156
"@n8n/json-schema-to-zod": "workspace:*",
157157
"@n8n/typeorm": "0.3.20-12",
158158
"@n8n/vm2": "3.9.25",
159-
"@pinecone-database/pinecone": "3.0.3",
159+
"@pinecone-database/pinecone": "4.0.0",
160160
"@qdrant/js-client-rest": "1.11.0",
161161
"@supabase/supabase-js": "2.45.4",
162162
"@xata.io/client": "0.28.4",
163163
"basic-auth": "catalog:",
164164
"cheerio": "1.0.0",
165-
"cohere-ai": "7.13.2",
165+
"cohere-ai": "7.14.0",
166166
"d3-dsv": "2.0.0",
167167
"epub2": "3.0.2",
168168
"form-data": "catalog:",
169169
"generate-schema": "2.6.0",
170170
"html-to-text": "9.0.5",
171171
"jsdom": "23.0.1",
172-
"langchain": "0.3.5",
172+
"langchain": "0.3.6",
173173
"lodash": "catalog:",
174174
"mammoth": "1.7.2",
175175
"mime-types": "2.1.35",
176176
"n8n-nodes-base": "workspace:*",
177177
"n8n-workflow": "workspace:*",
178-
"openai": "4.69.0",
178+
"openai": "4.73.1",
179179
"pdf-parse": "1.1.1",
180180
"pg": "8.12.0",
181181
"redis": "4.6.12",

Diff for: packages/@n8n/nodes-langchain/utils/output_parsers/N8nStructuredOutputParser.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ export class N8nStructuredOutputParser extends StructuredOutputParser<
3232
[{ json: { action: 'parse', text } }],
3333
]);
3434
try {
35-
const parsed = await super.parse(text);
35+
const jsonString = text.includes('```') ? text.split(/```(?:json)?/)[1] : text;
36+
const json = JSON.parse(jsonString.trim());
37+
const parsed = await this.schema.parseAsync(json);
3638

3739
const result = (get(parsed, [STRUCTURED_OUTPUT_KEY, STRUCTURED_OUTPUT_OBJECT_KEY]) ??
3840
get(parsed, [STRUCTURED_OUTPUT_KEY, STRUCTURED_OUTPUT_ARRAY_KEY]) ??

0 commit comments

Comments
 (0)