Replies: 3 comments
-
What does the node with the LLM call look like? |
Beta Was this translation helpful? Give feedback.
-
@hinthornw @david1542 did you ended up with a solution ?. |
Beta Was this translation helpful? Give feedback.
-
Maybe we can try to use Callbacks? How about make a signal object, pass it to a callback constructor. And when user clicked the "stop" button, set the signal object's specific field.The callback handler will check this signle( I haven‘t tried this idea. Sound's make sense? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone, I'm trying to implement an "abort" functionality in my langgraph agent.
More specifically, a user might click "Abort" in my UI. In this case, I'm changing some state in the DB and I'm checking it periodically in parallel to the LangGraph astream loop.
I've tried to create a race condition between these 2 things, but seems like whenever my graph is stuck on some async call (e.g an LLM call), the cancellation doesn't work.
This is my simplified code:
As I said, when the graph is stuck on an LLM call, the race condition doesn't work and the execution proceeds for some reason. I'm not sure why :face_with_monocle:
Does any of you implemented an abort functionality maybe? I'd love to get some advice.
Beta Was this translation helpful? Give feedback.
All reactions