-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interrupt using the same old question, when invoked second time. #3275
Comments
This has already been answered here #3072 if you’re still having issues on the latest version of thr library, please provide a https://stackoverflow.com/help/minimal-reproducible-example |
@vbarda That's a different one which was raised by me, where interrupt is not actually getting interrupted for the second time. Now that is working fine. It is getting interrupted for the second time which is good, that has been resolved in #3072 as you said, but here the new issue is that, instead of showing new question/value to the user when interrupted for the second time, its showing the same old value to the user. Ideal scenario should be, when the interrupt invoked for the second time, it should show the new/updated question to the user instead of still showing the old question, what do you think? |
hm, i double checked using a simple example and it's working correctly for me (see below). i think it's likely that there is an application error. feel free to adapt my example to reproduce the issue from langgraph.graph import StateGraph, START
from langgraph.types import interrupt, Command
from langgraph.checkpoint.memory import MemorySaver
from typing import TypedDict
class State(TypedDict):
foo: str
def my_node(state: State):
value = interrupt(f"Provide provide a new value. Previous value is: {state['foo']}")
return {"foo": value}
checkpointer = MemorySaver()
graph = StateGraph(State).add_node(my_node).add_edge(START, "my_node").add_edge("my_node", "my_node").compile(checkpointer=checkpointer)
config = {"configurable": {"thread_id": "1"}}
for chunk in graph.stream({"foo": ""}, config):
print(chunk)
for chunk in graph.stream(Command(resume="foo"), config):
print(chunk)
for chunk in graph.stream(Command(resume="bar"), config):
print(chunk) |
@vbarda Can I know the version you are using, please? |
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
I had a node that has interrupt and this node might be called multiple times, to collect information from the user. When interrupt is invoked for the second time it shows the previous question instead of showing the new question to user.
System Info
python -m langchain_core.sys_info
The text was updated successfully, but these errors were encountered: