-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(assistant): stop a generation #28810
Conversation
Size Change: +4.97 kB (+0.05%) Total Size: 9.71 MB
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here: app.greptile.com/review/github.
18 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here: app.greptile.com/review/github.
21 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely! Some assorted comments before getting it in
return cls( | ||
intermediate_steps=[], | ||
plan="", | ||
graph_status="", | ||
memory_updated=False, | ||
memory_collection_messages=[], | ||
root_tool_call_id="", | ||
root_tool_insight_plan="", | ||
root_tool_insight_type="", | ||
root_tool_calls_count=0, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be just cls()
? I'm just unsure why e.g. the default intermediate_steps
value on the model itself isn't list()
, rather than None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a workaround for now. LangGraph doesn't correctly merge states, so all None values are ignored despite being explicitly set. More context. intermediate_steps
can't be an empty list by default because it will just replace state unexpectedly. I'm planning to migrate pydantic states to a plain TypedDict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that issue. Alright, let's keep these "manual defaults" then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏹️
Problem
Customers want to stop the generation if things go south.
Changes
status
to the Conversation model that controls if the double-texting is allowed (parallel executions of the same conversation).run
method.Demo
Recovering after a failed generation
(it wasn't possible before)
Does this work well for both Cloud and self-hosted?
No
How did you test this code?
Manual tests, unit tests.