Skip to content

Conversation

@Ashutosh0x
Copy link

Google Cloud Vertex AI does not support the \�nthropic-beta\ HTTP header. This PR maps it to the \�nthropic_beta\ field in the request body, enabling features like Prompt Caching. Fixes #653

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:50
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.

Support Prompt Caching with Vertex

1 participant