From 86f6e0dc1ea551fcf0ed63c3eaa08166409052e9 Mon Sep 17 00:00:00 2001 From: Michael Chin Date: Tue, 17 Dec 2024 16:53:30 -0800 Subject: [PATCH] Change to not modify model_id --- libs/aws/langchain_aws/chat_models/bedrock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/aws/langchain_aws/chat_models/bedrock.py b/libs/aws/langchain_aws/chat_models/bedrock.py index 59866db0..2c01779d 100644 --- a/libs/aws/langchain_aws/chat_models/bedrock.py +++ b/libs/aws/langchain_aws/chat_models/bedrock.py @@ -410,9 +410,9 @@ def get_lc_namespace(cls) -> List[str]: @model_validator(mode="before") @classmethod def set_beta_use_converse_api(cls, values: Dict) -> Any: - model_id = values.get("model_id", values.get("model")) or "" + model_id = values.get("model_id", values.get("model")) - if "beta_use_converse_api" not in values: + if model_id is not None and "beta_use_converse_api" not in values: values["beta_use_converse_api"] = "nova" in model_id return values