-
Notifications
You must be signed in to change notification settings - Fork 16.5k
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
Bedrock integration with Claude3 fails with ValidationException "claude-3-sonnet-20240229" is not supported on this API. Please use the Messages API instead. #18513
Comments
Not too surprisingly, this same issue occurs going through the BedrockChat interface. |
I've opened the same issue with what I believe is causing this issue: #18514 |
considering the new capabilities of Claude3 and the input types (images etc), this likely requires a rework or perhaps a "text" handler and "image" handler |
this might be an issue with Bedrock itself, the API endpoint is expecting a When you pass langchain_community/llms/bedrock.py:415
...
input_body = LLMInputOutputAdapter.prepare_input(provider, prompt, params)
input_body['content'] = input_body['prompt'] with
with
|
talked with AWS support about the new format of Claude requests. here's the input body that works from boto3==1.34.54
|
It would be very helpful if Claude 3 worked with |
starting to take a swing at it here #18548 |
Error: |
Fixes #18513. ## Description This PR attempts to fix the support for Anthropic Claude v3 models in BedrockChat LLM. The changes here has updated the payload to use the `messages` format instead of the formatted text prompt for all models; `messages` API is backwards compatible with all models in Anthropic, so this should not break the experience for any models. ## Notes The PR in the current form does not support the v3 models for the non-chat Bedrock LLM. This means, that with these changes, users won't be able to able to use the v3 models with the Bedrock LLM. I can open a separate PR to tackle this use-case, the intent here was to get this out quickly, so users can start using and test the chat LLM. The Bedrock LLM classes have also grown complex with a lot of conditions to support various providers and models, and is ripe for a refactor to make future changes more palatable. This refactor is likely to take longer, and requires more thorough testing from the community. Credit to PRs [18579](#18579) and [18548](#18548) for some of the code here. --------- Co-authored-by: Erick Friis <[email protected]>
Fixes langchain-ai#18513. ## Description This PR attempts to fix the support for Anthropic Claude v3 models in BedrockChat LLM. The changes here has updated the payload to use the `messages` format instead of the formatted text prompt for all models; `messages` API is backwards compatible with all models in Anthropic, so this should not break the experience for any models. ## Notes The PR in the current form does not support the v3 models for the non-chat Bedrock LLM. This means, that with these changes, users won't be able to able to use the v3 models with the Bedrock LLM. I can open a separate PR to tackle this use-case, the intent here was to get this out quickly, so users can start using and test the chat LLM. The Bedrock LLM classes have also grown complex with a lot of conditions to support various providers and models, and is ripe for a refactor to make future changes more palatable. This refactor is likely to take longer, and requires more thorough testing from the community. Credit to PRs [18579](langchain-ai#18579) and [18548](langchain-ai#18548) for some of the code here. --------- Co-authored-by: Erick Friis <[email protected]>
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
obviously claude3 is brand new, but initial testing with existing capabilities seems to indicate a change in how these models need to be invoked.
I'd expect that these new models would work with existing langchain capabilities as drop-in improvements.
System Info
System Information
Package Information
Packages not installed (Not Necessarily a Problem)
The following packages were not found:
The text was updated successfully, but these errors were encountered: