[Bug] Fixed the Bedrock model name error #953
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
_get_model_name
raises "Model name could not be retrieved" when used with AWS Bedrock, becauseChatBedrock
class doesn't have corresponding property for model name retrieval.The proposed fix is to drop
_get_model_name
entirely to prevent similar mismatch from models we haven't used. Also,_get_model_name
is not a necessary step. If there is a need to know the model name, we can explicitly call the property.e.g.,
will render 'claude-3-5-sonnet-latest'
Before this bug is fixed, users could use
ChatBedrockConverse
instead ofChatBedrock
.https://python.langchain.com/v0.2/docs/integrations/chat/bedrock/#bedrock-converse-api
Screenshot
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":