Skip to content

Commit b51801b

Browse files
committed
fix build
1 parent ccf6a53 commit b51801b

File tree

1 file changed

+5
-2
lines changed
  • integrations/langchain/typescript/src

1 file changed

+5
-2
lines changed

integrations/langchain/typescript/src/tools.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,17 @@ export type LangChainToolWithName = {
7676
export function convertAGUIToolToLangChain(tool: AGUITool): DynamicStructuredTool {
7777
const schema = convertJsonSchemaToZod(tool.parameters, true) as z.ZodTypeAny;
7878

79-
return new DynamicStructuredTool<z.ZodObject<any>>({
79+
// Use explicit type annotation to avoid TS2589 "Type instantiation is excessively deep"
80+
// caused by DynamicStructuredTool's complex generic inference
81+
const toolInstance: DynamicStructuredTool = new (DynamicStructuredTool as any)({
8082
name: tool.name,
8183
description: tool.description,
82-
schema: schema as z.ZodObject<any>,
84+
schema: schema,
8385
func: async () => {
8486
return "";
8587
},
8688
});
89+
return toolInstance;
8790
}
8891

8992
/**

0 commit comments

Comments
 (0)