-
Notifications
You must be signed in to change notification settings - Fork 2.5k
core[minor]: StringOutputParser and text BaseMessage contents #4705
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
core[minor]: StringOutputParser and text BaseMessage contents #4705
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thank you for this! The silent failure/truncation on complex message image outputs makes me a bit nervous though. Happy to make the change myself. |
I have no strong feelings, but here's my justification for choosing an empty string:
That said, as long as the |
case "image_url": | ||
return this._imageUrlContentToString(content); | ||
default: | ||
return ""; |
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.
If we're throwing errors - should probably also throw an error here. (For any future content types that may be created. Marking an unknown content type.)
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.
Yes good call
Thanks very much! |
Added a number of methods to
BaseLLMOutputParser
and call frominvoke()
to allow subclasses to override the string representation of aBaseMessage
. Take advantage of this as part ofStringOutputParser
to make sure any text types are represented as human-readable strings.Fixes #4695