-
Notifications
You must be signed in to change notification settings - Fork 220
Prevent sending thinking blocks with no signature with ChatBedrockConverse #408
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
Prevent sending thinking blocks with no signature with ChatBedrockConverse #408
Conversation
43d21dc to
7b6641c
Compare
|
Fixed the failing test, |
73b3fa7 to
9e8adf1
Compare
|
Tested and passing |
|
Integration CI run on this branch looks clean. One unrelated test for |
michaelnchin
left a comment
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.
Thanks @tahouse !
…verse (langchain-ai#408) Fixes langchain-ai#401 Claude 3.7 still works because signatures are always returned with those thinking blocks. DeepSeek thinking blocks do not contain signatures and the ValidationError indicates a signature must be included with thinking blocks. According to Converse API docs: > "Within the reasoningText field, the text fields describes the reasoning. The signature field is a hash of all the messages in the conversation and is a safeguard against tampering of the reasoning used by the model. You must include the signature and all previous messages in subsequent Converse requests. If any of the messages are changed, the response throws an error." https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-call.html @3coins I posted a separate PR langchain-ai#407 to make reviewing easier. Happy to combine if preferred.
Fixes #401
Claude 3.7 still works because signatures are always returned with those thinking blocks. DeepSeek thinking blocks do not contain signatures and the ValidationError indicates a signature must be included with thinking blocks.
According to Converse API docs:
https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-call.html
@3coins I posted a separate PR #407 to make reviewing easier. Happy to combine if preferred.