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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -96,6 +96,9 @@ export class DynamicStructuredTool<
await runManager?.handleToolError(e)
throw e
}
if (result && typeof result !== 'string') {
result = JSON.stringify(result)
}
await runManager?.handleToolEnd(result)
return result
}