You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per #975, there are way too many complex concepts to understand if you want to implement a human-in-the-loop process for approving tool calls, especially in the case when you want to allow parallel tool calls and execute all approved tool calls (as opposed to a denial of one call blocking execution of all parallel calls on the AIMessage).
It would be so much nicer if user code could simply call interrupt from within tool handler functions. Doing this today requires extra steps (e.g. fanning out individual tool calls to ToolNode), as otherwise you'll repeat the execution of all previously-approved tool calls on every resume.
A better approach (credit to @hinthornw for the idea) would be if within ToolNode we wrapped calls to tool handler functions with the task decorator from the functional API. This would allow individual tool handlers to interrupt and resume without re-executing other handlers that are running in parallel.
One caveat, however: task currently relies on the node:async_hooks module for AsyncLocalStorage, which isn't available in browser or react native environments. We'll need to address that prior to implementing this feature.
The text was updated successfully, but these errors were encountered:
Per #975, there are way too many complex concepts to understand if you want to implement a human-in-the-loop process for approving tool calls, especially in the case when you want to allow parallel tool calls and execute all approved tool calls (as opposed to a denial of one call blocking execution of all parallel calls on the
AIMessage
).It would be so much nicer if user code could simply call
interrupt
from within tool handler functions. Doing this today requires extra steps (e.g. fanning out individual tool calls toToolNode
), as otherwise you'll repeat the execution of all previously-approved tool calls on every resume.A better approach (credit to @hinthornw for the idea) would be if within
ToolNode
we wrapped calls to tool handler functions with thetask
decorator from the functional API. This would allow individual tool handlers to interrupt and resume without re-executing other handlers that are running in parallel.One caveat, however:
task
currently relies on thenode:async_hooks
module forAsyncLocalStorage
, which isn't available in browser or react native environments. We'll need to address that prior to implementing this feature.The text was updated successfully, but these errors were encountered: