-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 not working with Claude 3 #4617
Comments
Based on the error message you're receiving, it seems that the model identifier you're using, "claude-3-sonnet-20240229", is not supported by the API you're trying to use. This is likely the root cause of the issue you're experiencing. The To resolve this issue, you should replace the unsupported model identifier with a supported one. Unfortunately, without the exact list of supported model identifiers, I cannot provide a direct code modification to resolve this issue. You might need to check the official documentation or contact support for LangChain.js or the Bedrock model to find the correct model identifier for Claude 3. Here's a general example of how you might modify your code once you have the correct model identifier: import { BedrockChat } from '@langchain/community/chat_models/bedrock'
async function main() {
try {
const model = new BedrockChat({
model: 'supported.model.identifier' // Replace with the correct model identifier
});
const result = await model.invoke('Tell me a story');
console.log(result);
} catch (error) {
console.error(error);
process.exit(1);
}
}
main() Regarding the two Python issues you mentioned, it's possible that they are related to the issue you're experiencing. However, without more information, it's hard to say for sure. If the issues are indeed related, the solutions proposed in those issues might also apply to your case. However, since the issues are in Python and you're working with JavaScript, the solutions might not be directly applicable. I hope this helps! If you have any more questions or need further clarification, feel free to ask. Sources
|
Will patch this tonight! Thanks for flagging. |
Hey so this is actually going to take me a bit longer as I don't have access to the model on Bedrock :( Will aim to get it as soon as I can and then work on this. |
It's definitely already available: $ aws bedrock list-foundation-models --region 'us-east-1' | jq '.modelSummaries[].modelId' | grep claude-3-sonnet
"anthropic.claude-3-sonnet-20240229-v1:0" But yes, you need to apply for access. |
Finished a PR, will merge and ship shortly! |
Really appreciate the turnaround on this!!! |
@jacoblee93 Does your PR also fix this for using claude 3 with the Bedrock client (not the BedrockChat)? |
Claude-3 is messages only :( you'll need to use the chat model. It should be pretty interchangeable though? |
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
These two issues from Python also apply to the JS version:
langchain-ai/langchain#18513
langchain-ai/langchain#18514
System Info
Platform: Mac
Node: v20.11.0
Yarn version: 1.22.19
The text was updated successfully, but these errors were encountered: