File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
integrations/langchain/typescript/src Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,17 @@ export type LangChainToolWithName = {
7676export 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/**
You can’t perform that action at this time.
0 commit comments