-
-
Notifications
You must be signed in to change notification settings - Fork 356
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
Fix Amazon Nova support (use StrOutputParser
)
#1202
Conversation
e5a808f
to
ad70210
Compare
Interestingly, all of the other slash commands work with Amazon Nova, even though this PR only changes The only exception is |
StrOutputParser
)
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.
ad70210
to
ed3bcf8
Compare
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.
@dlqqq
LGTM!
The original code expecting chunk.content
to be a string might not cover all Message responses, which is causing this error.
Using StrOutputParser should handle these different content types and any future changes that might happen in LangChain.
Thanks for the reviews folks! Merging. |
Description
StrOutputParser
to the runnable defined inDefaultChatHandler
.AIMessageChunk
objects with a unique structure that we did not expect. This only happens when Amazon Nova is used throughChatBedrock
, as far I'm aware.StrOutputParser
to the runnable, the runnable now yields primitive strings when streamed, which we already handle inBaseChatHandler.stream_reply()
.Demo
Screen.Recording.2025-01-15.at.3.20.46.PM.mov
Open questions
(mainly for @3coins)