langchain[patch]: init_chat_model support ChatBedrockConverse (#24564)

This commit is contained in:
Bagatur
2024-07-23 11:07:38 -07:00
committed by GitHub
parent 9b7db08184
commit 55e66aa40c

View File

@@ -366,6 +366,11 @@ def _init_chat_model_helper(
# TODO: update to use model= once ChatBedrock supports # TODO: update to use model= once ChatBedrock supports
return ChatBedrock(model_id=model, **kwargs) return ChatBedrock(model_id=model, **kwargs)
elif model_provider == "bedrock_converse":
_check_pkg("langchain_aws")
from langchain_aws import ChatBedrockConverse
return ChatBedrockConverse(model=model, **kwargs)
else: else:
supported = ", ".join(_SUPPORTED_PROVIDERS) supported = ", ".join(_SUPPORTED_PROVIDERS)
raise ValueError( raise ValueError(
@@ -388,6 +393,7 @@ _SUPPORTED_PROVIDERS = {
"huggingface", "huggingface",
"groq", "groq",
"bedrock", "bedrock",
"bedrock_converse",
} }