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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

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 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 vbarda October 30, 2024 00:27
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