Skip to content

Commit 62b817c

Browse files
chore: add inline comment in ContentBlock conversion of anthropic messages_api
1 parent cb5f1a6 commit 62b817c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/askui/models/anthropic/messages_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ def from_content_block(block: ContentBlockParam) -> BetaContentBlockParam:
5656
as it is not accepted by the API.
5757
"""
5858
if isinstance(block, ToolUseBlockParam):
59+
# visual_representation is an internal field (perceptual hash for cache
60+
# validation) that does not exist in the Anthropic API schema. Sending
61+
# it would cause the API to reject the request with an unknown-field error.
5962
return cast(
6063
"BetaContentBlockParam",
6164
block.model_dump(exclude={"visual_representation"}),

0 commit comments

Comments
 (0)