Skip to content

Commit 26a1387

Browse files
baskaryanccurme
andauthored
aws[patch]: support tool_choice for claude-4 (#525)
Co-authored-by: Chester Curme <[email protected]>
1 parent 0fb56e9 commit 26a1387

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libs/aws/langchain_aws/chat_models/bedrock_converse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,10 +598,10 @@ def validate_environment(self) -> Self:
598598
"""Validate that AWS credentials to and python package exists in environment."""
599599

600600
# As of 12/03/24:
601-
# only claude-3, mistral-large, and nova models support tool choice:
601+
# only claude-3/4, mistral-large, and nova models support tool choice:
602602
# https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolChoice.html
603603
if self.supports_tool_choice_values is None:
604-
if "claude-3" in self._get_base_model():
604+
if "claude" in self._get_base_model():
605605
# Tool choice not supported when thinking is enabled
606606
thinking_params = (self.additional_model_request_fields or {}).get(
607607
"thinking", {}

0 commit comments

Comments
 (0)