mirror of
https://github.com/langchain-ai/langsmith-docs.git
synced 2026-08-27 01:41:19 -04:00
DOC: <Issue related to /tutorials/Developers/agents> Clarification needed on error key usage in handle_tool_error
#28
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Innary on GitHub (Oct 8, 2024).
Description:
The
handle_tool_errorfunction references anerrorkey from thestateobject:However, it's unclear where this
errorkey comes from. There is no indication that this key is defined or added to thestateanywhere before it is accessed. TheStateclass is defined as:This class doesn't seem to include any
errorkey. The functioncreate_tool_node_with_fallbackseems to expect anerrorkey to be present when an exception occurs:Questions:
errorkey introduced into thestateobject?errorkey is added tostatebeforehandle_tool_erroris invoked?Stateclass or the related handling code be responsible for defining or initializing theerrorkey?It appears that the
errorkey is expected to exist due to the exception handling setup, but the exact moment or process of its introduction into thestateis unclear.@Innary commented on GitHub (Oct 8, 2024):
https://python.langchain.com/api_reference/core/runnables/langchain_core.runnables.base.Runnable.html#langchain_core.runnables.base.Runnable.with_fallbacks