Skip to content

Commit 01f9bbb

Browse files
committed
fix(tavily): pin zod to v3 to avoid "Type instantiation is excessively deep and possibly infinite" error
With Zod 3.25.68+ we're observing elevated incidence count of "Type instantiation is excessively deep and possibly infinite," which is caused by packages importing from `"zod"` rather than `"zod/v3"`
1 parent cc4ff80 commit 01f9bbb

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

libs/langchain-tavily/src/tavily-crawl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
22
import { StructuredTool, ToolParams } from "@langchain/core/tools";
3-
import { z } from "zod";
3+
import { z } from "zod/v3";
44
import { InferInteropZodOutput } from "@langchain/core/dist/utils/types/zod.js";
55
import {
66
TavilyCrawlAPIWrapper,

libs/langchain-tavily/src/tavily-extract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
22
import { StructuredTool, ToolParams } from "@langchain/core/tools";
3-
import { z } from "zod";
3+
import { z } from "zod/v3";
44
import { InferInteropZodOutput } from "@langchain/core/dist/utils/types/zod.js";
55
import {
66
TavilyExtractAPIWrapper,

libs/langchain-tavily/src/tavily-map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
22
import { StructuredTool, ToolParams } from "@langchain/core/tools";
3-
import { z } from "zod";
3+
import { z } from "zod/v3";
44
import { InferInteropZodOutput } from "@langchain/core/dist/utils/types/zod.js";
55
import {
66
TavilyMapAPIWrapper,

libs/langchain-tavily/src/tavily-search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import { z } from "zod/v3";
22
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
33
import { StructuredTool, ToolParams } from "@langchain/core/tools";
44
import { InferInteropZodOutput } from "@langchain/core/utils/types";

0 commit comments

Comments
 (0)