Skip to content
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

langgraph[patch]: format messages in state #2199

Merged
merged 16 commits into from
Dec 18, 2024

Conversation

baskaryan
Copy link
Contributor

@baskaryan baskaryan commented Oct 27, 2024

Add format flag to add_messages which allows you to specify if the contents of messages in state should be formatted in a particular way. PR only adds support for OpenAI style contents. Helpful if you're using different models at different nodes and want a unified messages format to interact with when you manually update messages.

@baskaryan baskaryan requested review from vbarda and nfcampos October 27, 2024 19:54
@baskaryan baskaryan marked this pull request as ready for review October 27, 2024 21:17
@baskaryan baskaryan changed the title rfc: format messages in state langgraph[patch]: format messages in state Oct 27, 2024

def foo(state):
messages = [
HumanMessage(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these just be dicts instead?

Copy link
Collaborator

@vbarda vbarda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@baskaryan baskaryan requested a review from eyurtsev October 28, 2024 19:53
@baskaryan baskaryan requested a review from eyurtsev October 30, 2024 00:16
@baskaryan baskaryan requested a review from vbarda October 30, 2024 00:27
@vbarda vbarda enabled auto-merge (squash) December 18, 2024 16:07
@vbarda vbarda merged commit 4f1bf4f into main Dec 18, 2024
59 checks passed
@vbarda vbarda deleted the bagatur/rfc_message_state_format branch December 18, 2024 17:19
hinthornw pushed a commit that referenced this pull request Dec 18, 2024
Add `format` flag to `add_messages` which allows you to specify if the
contents of messages in state should be formatted in a particular way.
PR only adds support for OpenAI style contents. Helpful if you're using
different models at different nodes and want a unified messages format
to interact with when you manually update messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants