Upgrading anthropic 0.46 to 0.47
Safe0.46.0 → 0.47.2New3Fixed3Other3
SafeUpgrade verdict
Only new features and fixes in this range.
In plain terms
- Nothing in this range needs changes to your code. It adds features and fixes.
Must act Nothing to change
No breaking, platform, security or deprecated items in this range.
Nothing in this upgrade needs a code or configuration change.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- changed:
async method AsyncMessages.count_tokens(*, messages: Iterable[BetaMessageParam], model: ModelParam, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, tool_choice: BetaToolChoiceParam | NotGiven=…, tools: Iterable[message_count_tokens_params.Tool] | NotGiven=…, betas: List[AnthropicBetaParam] | NotGiven=…, extra_headers: Headers | None=…, extra_query: Query | None=…, extra_body: Body… → async method AsyncMessages.count_tokens(*, messages: Iterable[BetaMessageParam], model: ModelParam, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, thinking: BetaThinkingConfigParam | NotGiven=…, tool_choice: BetaToolChoiceParam | NotGiven=…, tools: Iterable[message_count_tokens_params.Tool] | NotGiven=…, betas: List[AnthropicBetaParam] | NotGiven=…, extra_headers: Headers | None=…… - changed:
async method AsyncMessages.create(*, max_tokens: int, messages: Iterable[BetaMessageParam], model: ModelParam, metadata: BetaMetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, stream: Literal[False] | NotGiven=…, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, tool_choice: BetaToolChoiceParam | NotGiven=…, tools: Iterable[BetaToolUn… → async method AsyncMessages.create(*, max_tokens: int, messages: Iterable[BetaMessageParam], model: ModelParam, metadata: BetaMetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, stream: Literal[False] | NotGiven=…, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, thinking: BetaThinkingConfigParam | NotGiven=…, tool_choice: BetaToolChoi… - changed:
method AsyncMessages.stream(*, max_tokens: int, messages: Iterable[BetaMessageParam], model: ModelParam, metadata: BetaMetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, tool_choice: BetaToolChoiceParam | NotGiven=…, tools: Iterable[BetaToolUnionParam] | NotGiven=…, top_k: int | NotGiv… → method AsyncMessages.stream(*, max_tokens: int, messages: Iterable[BetaMessageParam], model: ModelParam, metadata: BetaMetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, thinking: BetaThinkingConfigParam | NotGiven=…, tool_choice: BetaToolChoiceParam | NotGiven=…, tools: Iterable[BetaT… - changed:
method Messages.count_tokens(*, messages: Iterable[BetaMessageParam], model: ModelParam, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, tool_choice: BetaToolChoiceParam | NotGiven=…, tools: Iterable[message_count_tokens_params.Tool] | NotGiven=…, betas: List[AnthropicBetaParam] | NotGiven=…, extra_headers: Headers | None=…, extra_query: Query | None=…, extra_body: Body | None=…, t… → method Messages.count_tokens(*, messages: Iterable[BetaMessageParam], model: ModelParam, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, thinking: BetaThinkingConfigParam | NotGiven=…, tool_choice: BetaToolChoiceParam | NotGiven=…, tools: Iterable[message_count_tokens_params.Tool] | NotGiven=…, betas: List[AnthropicBetaParam] | NotGiven=…, extra_headers: Headers | None=…, extra_que… - changed:
method Messages.create(*, max_tokens: int, messages: Iterable[BetaMessageParam], model: ModelParam, metadata: BetaMetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, stream: Literal[False] | NotGiven=…, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, tool_choice: BetaToolChoiceParam | NotGiven=…, tools: Iterable[BetaToolUnionParam] |… → method Messages.create(*, max_tokens: int, messages: Iterable[BetaMessageParam], model: ModelParam, metadata: BetaMetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, stream: Literal[False] | NotGiven=…, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, thinking: BetaThinkingConfigParam | NotGiven=…, tool_choice: BetaToolChoiceParam | N… - changed:
method Messages.stream(*, max_tokens: int, messages: Iterable[BetaMessageParam], model: ModelParam, metadata: BetaMetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, tool_choice: BetaToolChoiceParam | NotGiven=…, tools: Iterable[BetaToolUnionParam] | NotGiven=…, top_k: int | NotGiven=…,… → method Messages.stream(*, max_tokens: int, messages: Iterable[BetaMessageParam], model: ModelParam, metadata: BetaMetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, thinking: BetaThinkingConfigParam | NotGiven=…, tool_choice: BetaToolChoiceParam | NotGiven=…, tools: Iterable[BetaToolUn…
- changed:
async method AsyncMessages.count_tokens(*, messages: Iterable[MessageParam], model: ModelParam, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, tool_choice: ToolChoiceParam | NotGiven=…, tools: Iterable[ToolParam] | NotGiven=…, extra_headers: Headers | None=…, extra_query: Query | None=…, extra_body: Body | None=…, timeout: float | httpx.Timeout | None | NotGiven=…) -> MessageTokensCou… → async method AsyncMessages.count_tokens(*, messages: Iterable[MessageParam], model: ModelParam, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, thinking: ThinkingConfigParam | NotGiven=…, tool_choice: ToolChoiceParam | NotGiven=…, tools: Iterable[MessageCountTokensToolParam] | NotGiven=…, extra_headers: Headers | None=…, extra_query: Query | None=…, extra_body: Body | None=…, timeout:… - changed:
async method AsyncMessages.create(*, max_tokens: int, messages: Iterable[MessageParam], model: ModelParam, metadata: MetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, stream: Literal[False] | NotGiven=…, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, tool_choice: ToolChoiceParam | NotGiven=…, tools: Iterable[ToolParam] | NotGiven=…, t… → async method AsyncMessages.create(*, max_tokens: int, messages: Iterable[MessageParam], model: ModelParam, metadata: MetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, stream: Literal[False] | NotGiven=…, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, thinking: ThinkingConfigParam | NotGiven=…, tool_choice: ToolChoiceParam | NotGiven=…… - changed:
method AsyncMessages.stream(*, max_tokens: int, messages: Iterable[MessageParam], model: ModelParam, metadata: MetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, top_k: int | NotGiven=…, top_p: float | NotGiven=…, tool_choice: ToolChoiceParam | NotGiven=…, tools: Iterable[ToolParam] | NotG… → method AsyncMessages.stream(*, max_tokens: int, messages: Iterable[MessageParam], model: ModelParam, metadata: MetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, top_k: int | NotGiven=…, top_p: float | NotGiven=…, thinking: ThinkingConfigParam | NotGiven=…, tool_choice: ToolChoiceParam | N… - changed:
method Messages.count_tokens(*, messages: Iterable[MessageParam], model: ModelParam, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, tool_choice: ToolChoiceParam | NotGiven=…, tools: Iterable[ToolParam] | NotGiven=…, extra_headers: Headers | None=…, extra_query: Query | None=…, extra_body: Body | None=…, timeout: float | httpx.Timeout | None | NotGiven=…) -> MessageTokensCount → method Messages.count_tokens(*, messages: Iterable[MessageParam], model: ModelParam, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, thinking: ThinkingConfigParam | NotGiven=…, tool_choice: ToolChoiceParam | NotGiven=…, tools: Iterable[MessageCountTokensToolParam] | NotGiven=…, extra_headers: Headers | None=…, extra_query: Query | None=…, extra_body: Body | None=…, timeout: float | htt… - changed:
method Messages.create(*, max_tokens: int, messages: Iterable[MessageParam], model: ModelParam, metadata: MetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, stream: Literal[False] | NotGiven=…, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, tool_choice: ToolChoiceParam | NotGiven=…, tools: Iterable[ToolParam] | NotGiven=…, top_k: int |… → method Messages.create(*, max_tokens: int, messages: Iterable[MessageParam], model: ModelParam, metadata: MetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, stream: Literal[False] | NotGiven=…, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, thinking: ThinkingConfigParam | NotGiven=…, tool_choice: ToolChoiceParam | NotGiven=…, tools: It… - changed:
method Messages.stream(*, max_tokens: int, messages: Iterable[MessageParam], model: ModelParam, metadata: MetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, top_k: int | NotGiven=…, top_p: float | NotGiven=…, tool_choice: ToolChoiceParam | NotGiven=…, tools: Iterable[ToolParam] | NotGiven=… → method Messages.stream(*, max_tokens: int, messages: Iterable[MessageParam], model: ModelParam, metadata: MetadataParam | NotGiven=…, stop_sequences: List[str] | NotGiven=…, system: Union[str, Iterable[TextBlockParam]] | NotGiven=…, temperature: float | NotGiven=…, top_k: int | NotGiven=…, top_p: float | NotGiven=…, thinking: ThinkingConfigParam | NotGiven=…, tool_choice: ToolChoiceParam | NotGiv…
- added:
export MessageCountTokensToolParam - added:
export RedactedThinkingBlock - added:
export RedactedThinkingBlockParam - added:
export SignatureDelta - added:
export ThinkingBlock - added:
export ThinkingBlockParam - added:
export ThinkingConfigDisabledParam - added:
export ThinkingConfigEnabledParam - added:
export ThinkingConfigParam - added:
export ThinkingDelta - added:
export ToolBash20250124Param - added:
export ToolTextEditor20250124Param - added:
export ToolUnionParam
- added:
export BetaRedactedThinkingBlock - added:
export BetaRedactedThinkingBlockParam - added:
export BetaSignatureDelta - added:
export BetaThinkingBlock - added:
export BetaThinkingBlockParam - added:
export BetaThinkingConfigDisabledParam - added:
export BetaThinkingConfigEnabledParam - added:
export BetaThinkingConfigParam - added:
export BetaThinkingDelta - added:
export BetaToolBash20250124Param - added:
export BetaToolComputerUse20250124Param - added:
export BetaToolTextEditor20250124Param
- added:
class BetaRedactedThinkingBlock(BaseModel) - added:
field BetaRedactedThinkingBlock.data: str - added:
field BetaRedactedThinkingBlock.type: Literal['redacted_thinking']
- added:
class BetaRedactedThinkingBlockParam(TypedDict) - added:
field BetaRedactedThinkingBlockParam.data: Required[str] - added:
field BetaRedactedThinkingBlockParam.type: Required[Literal['redacted_thinking']]
- added:
class BetaSignatureDelta(BaseModel) - added:
field BetaSignatureDelta.signature: str - added:
field BetaSignatureDelta.type: Literal['signature_delta']
- added:
class BetaThinkingBlock(BaseModel) - added:
field BetaThinkingBlock.signature: str - added:
field BetaThinkingBlock.thinking: str - added:
field BetaThinkingBlock.type: Literal['thinking']
- added:
class BetaThinkingBlockParam(TypedDict) - added:
field BetaThinkingBlockParam.signature: Required[str] - added:
field BetaThinkingBlockParam.thinking: Required[str] - added:
field BetaThinkingBlockParam.type: Required[Literal['thinking']]
- added:
class BetaThinkingConfigDisabledParam(TypedDict) - added:
field BetaThinkingConfigDisabledParam.type: Required[Literal['disabled']]
- added:
class BetaThinkingConfigEnabledParam(TypedDict) - added:
field BetaThinkingConfigEnabledParam.budget_tokens: Required[int] - added:
field BetaThinkingConfigEnabledParam.type: Required[Literal['enabled']]
- added:
variable BetaThinkingConfigParam: TypeAlias
- added:
class BetaThinkingDelta(BaseModel) - added:
field BetaThinkingDelta.thinking: str - added:
field BetaThinkingDelta.type: Literal['thinking_delta']
- added:
class BetaToolBash20250124Param(TypedDict) - added:
field BetaToolBash20250124Param.cache_control: Optional[BetaCacheControlEphemeralParam] - added:
field BetaToolBash20250124Param.name: Required[Literal['bash']] - added:
field BetaToolBash20250124Param.type: Required[Literal['bash_20250124']]
- added:
class BetaToolComputerUse20250124Param(TypedDict) - added:
field BetaToolComputerUse20250124Param.cache_control: Optional[BetaCacheControlEphemeralParam] - added:
field BetaToolComputerUse20250124Param.display_height_px: Required[int] - added:
field BetaToolComputerUse20250124Param.display_number: Optional[int] - added:
field BetaToolComputerUse20250124Param.display_width_px: Required[int] - added:
field BetaToolComputerUse20250124Param.name: Required[Literal['computer']] - added:
field BetaToolComputerUse20250124Param.type: Required[Literal['computer_20250124']]
- added:
class BetaToolTextEditor20250124Param(TypedDict) - added:
field BetaToolTextEditor20250124Param.cache_control: Optional[BetaCacheControlEphemeralParam] - added:
field BetaToolTextEditor20250124Param.name: Required[Literal['str_replace_editor']] - added:
field BetaToolTextEditor20250124Param.type: Required[Literal['text_editor_20250124']]
- added:
field MessageCountTokensParams.thinking: BetaThinkingConfigParam
- added:
field MessageCreateParamsBase.betas: Annotated[List[AnthropicBetaParam], PropertyInfo(alias=anthropic - beta)] - added:
field MessageCreateParamsBase.thinking: BetaThinkingConfigParam
- changed:
field MessageCountTokensParams.tools: Iterable[ToolParam] → field MessageCountTokensParams.tools: Iterable[MessageCountTokensToolParam] - added:
field MessageCountTokensParams.thinking: ThinkingConfigParam
- added:
variable MessageCountTokensToolParam: TypeAlias
- changed:
field MessageCreateParamsBase.tools: Iterable[ToolParam] → field MessageCreateParamsBase.tools: Iterable[ToolUnionParam] - added:
field MessageCreateParamsBase.thinking: ThinkingConfigParam
- changed:
field MessageParam.content: Required[Union[str, Iterable[Union[TextBlockParam, ImageBlockParam, ToolUseBlockParam, ToolResultBlockParam, DocumentBlockParam, ContentBlock]]]] → field MessageParam.content: Required[Union[str, Iterable[Union[TextBlockParam, ImageBlockParam, ToolUseBlockParam, ToolResultBlockParam, DocumentBlockParam, ThinkingBlockParam, RedactedThinkingBlockParam, ContentBlock]]]]
- added:
class RedactedThinkingBlock(BaseModel) - added:
field RedactedThinkingBlock.data: str - added:
field RedactedThinkingBlock.type: Literal['redacted_thinking']
- added:
class RedactedThinkingBlockParam(TypedDict) - added:
field RedactedThinkingBlockParam.data: Required[str] - added:
field RedactedThinkingBlockParam.type: Required[Literal['redacted_thinking']]
- added:
class SignatureDelta(BaseModel) - added:
field SignatureDelta.signature: str - added:
field SignatureDelta.type: Literal['signature_delta']
- added:
class ThinkingBlock(BaseModel) - added:
field ThinkingBlock.signature: str - added:
field ThinkingBlock.thinking: str - added:
field ThinkingBlock.type: Literal['thinking']
- added:
class ThinkingBlockParam(TypedDict) - added:
field ThinkingBlockParam.signature: Required[str] - added:
field ThinkingBlockParam.thinking: Required[str] - added:
field ThinkingBlockParam.type: Required[Literal['thinking']]
- added:
class ThinkingConfigDisabledParam(TypedDict) - added:
field ThinkingConfigDisabledParam.type: Required[Literal['disabled']]
- added:
class ThinkingConfigEnabledParam(TypedDict) - added:
field ThinkingConfigEnabledParam.budget_tokens: Required[int] - added:
field ThinkingConfigEnabledParam.type: Required[Literal['enabled']]
- added:
variable ThinkingConfigParam: TypeAlias
- added:
class ThinkingDelta(BaseModel) - added:
field ThinkingDelta.thinking: str - added:
field ThinkingDelta.type: Literal['thinking_delta']
- added:
class ToolBash20250124Param(TypedDict) - added:
field ToolBash20250124Param.cache_control: Optional[CacheControlEphemeralParam] - added:
field ToolBash20250124Param.name: Required[Literal['bash']] - added:
field ToolBash20250124Param.type: Required[Literal['bash_20250124']]
- added:
class ToolTextEditor20250124Param(TypedDict) - added:
field ToolTextEditor20250124Param.cache_control: Optional[CacheControlEphemeralParam] - added:
field ToolTextEditor20250124Param.name: Required[Literal['str_replace_editor']] - added:
field ToolTextEditor20250124Param.type: Required[Literal['text_editor_20250124']]
- added:
variable ToolUnionParam: TypeAlias