Skip to content

Commit 982ee2d

Browse files
committed
defensive content checking
1 parent a3109c8 commit 982ee2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aws-opentelemetry-distro/src/amazon/opentelemetry/distro/patches/_botocore_patches.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ def patched_from_converse(cls, response: dict[str, Any], capture_content: bool)
425425

426426
if tool_calls := bedrock_utils.extract_tool_calls(orig_message, capture_content):
427427
message["tool_calls"] = tool_calls
428-
elif capture_content:
429-
message["content"] = orig_message["content"]
428+
elif capture_content and (content := orig_message.get("content")):
429+
message["content"] = content
430430

431431
return cls(message, response["stopReason"], index=0)
432432

0 commit comments

Comments
 (0)