Skip to content

Conversation

@Ashutosh0x
Copy link

The @beta_tool decorator currently includes \self\ and \cls\ parameters in the generated JSON schema when used as a class method decorator. This fix filters them out to prevent API errors. Fixes #1128

Including the 'caller' field in 'tool_use' blocks within input
messages causes API errors (especially for computer-use) because
the API expects only standard fields like id, name, type, and input.

This field was recently added to the SDK models and parameters but
should not be sent back to the API.

This PR:
1. Removes 'caller' from BetaToolUseBlockParam and
   BetaServerToolUseBlockParam.
2. Adds __api_exclude__ = {"caller"} to BetaToolUseBlock and
   BetaServerToolUseBlock models.
3. Modifies the internal transformer to explicitly strip 'caller'
   if it's not annotated in a TypedDict, ensuring raw dicts or
   unfiltered model dumps don't leak it back to the API.

Fixes anthropics#1112
@Ashutosh0x Ashutosh0x requested a review from a team as a code owner January 22, 2026 04:49
@karpetrosyan
Copy link
Collaborator

You have two more duplicates of this exact PR, #1128, #1154 and this. Please stop spamming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants