From 8ca62a2a87ab1f2bc2a9b1a69b8ddcd267c5ba0e Mon Sep 17 00:00:00 2001 From: Nick Clegg Date: Mon, 28 Jul 2025 17:43:23 -0400 Subject: [PATCH 1/2] Update bedrock.py --- src/strands/models/bedrock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strands/models/bedrock.py b/src/strands/models/bedrock.py index 679f1ea3d..cf1e4d3a9 100644 --- a/src/strands/models/bedrock.py +++ b/src/strands/models/bedrock.py @@ -584,7 +584,7 @@ async def structured_output( stop_reason, messages, _, _ = event["stop"] if stop_reason != "tool_use": - raise ValueError("No valid tool use or tool use input was found in the Bedrock response.") + raise ValueError(f"Model returned stop_reason: {stop_reason} instead of \"tool_use\".") content = messages["content"] output_response: dict[str, Any] | None = None From b0bb10210c4a928ea43a938de4229952818aa30d Mon Sep 17 00:00:00 2001 From: Nick Clegg Date: Mon, 28 Jul 2025 17:43:55 -0400 Subject: [PATCH 2/2] Update anthropic.py --- src/strands/models/anthropic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strands/models/anthropic.py b/src/strands/models/anthropic.py index eb72becfd..0d734b762 100644 --- a/src/strands/models/anthropic.py +++ b/src/strands/models/anthropic.py @@ -414,7 +414,7 @@ async def structured_output( stop_reason, messages, _, _ = event["stop"] if stop_reason != "tool_use": - raise ValueError("No valid tool use or tool use input was found in the Anthropic response.") + raise ValueError(f"Model returned stop_reason: {stop_reason} instead of \"tool_use\".") content = messages["content"] output_response: dict[str, Any] | None = None