Fix observation?.includes is not a function (#2696)

This commit is contained in:
YISH
2024-06-21 23:45:20 +08:00
committed by GitHub
parent 0fc5e3d0c5
commit 18b83333d3
@@ -96,6 +96,9 @@ export class DynamicStructuredTool<
await runManager?.handleToolError(e) await runManager?.handleToolError(e)
throw e throw e
} }
if (result && typeof result !== 'string') {
result = JSON.stringify(result)
}
await runManager?.handleToolEnd(result) await runManager?.handleToolEnd(result)
return result return result
} }