anthropic 0.68.0__py3-none-any.whl → 0.68.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@ from .batches import (
19
19
  BatchesWithStreamingResponse,
20
20
  AsyncBatchesWithStreamingResponse,
21
21
  )
22
- from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
22
+ from ...._types import NOT_GIVEN, Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
23
23
  from ...._utils import is_given, required_args, maybe_transform, strip_not_given, async_maybe_transform
24
24
  from ...._compat import cached_property
25
25
  from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -92,26 +92,26 @@ class Messages(SyncAPIResource):
92
92
  max_tokens: int,
93
93
  messages: Iterable[BetaMessageParam],
94
94
  model: ModelParam,
95
- container: Optional[str] | NotGiven = NOT_GIVEN,
96
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
97
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
98
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
99
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
100
- stream: Literal[False] | NotGiven = NOT_GIVEN,
101
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
102
- temperature: float | NotGiven = NOT_GIVEN,
103
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
104
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
105
- tools: Iterable[BetaToolUnionParam] | NotGiven = NOT_GIVEN,
106
- top_k: int | NotGiven = NOT_GIVEN,
107
- top_p: float | NotGiven = NOT_GIVEN,
108
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
95
+ container: Optional[str] | Omit = omit,
96
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
97
+ metadata: BetaMetadataParam | Omit = omit,
98
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
99
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
100
+ stream: Literal[False] | Omit = omit,
101
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
102
+ temperature: float | Omit = omit,
103
+ thinking: BetaThinkingConfigParam | Omit = omit,
104
+ tool_choice: BetaToolChoiceParam | Omit = omit,
105
+ tools: Iterable[BetaToolUnionParam] | Omit = omit,
106
+ top_k: int | Omit = omit,
107
+ top_p: float | Omit = omit,
108
+ betas: List[AnthropicBetaParam] | Omit = omit,
109
109
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
110
110
  # The extra values given here take precedence over values defined on the client or passed to this method.
111
111
  extra_headers: Headers | None = None,
112
112
  extra_query: Query | None = None,
113
113
  extra_body: Body | None = None,
114
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
114
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
115
115
  ) -> BetaMessage:
116
116
  """
117
117
  Send a structured list of input messages with text and/or image content, and the
@@ -370,25 +370,25 @@ class Messages(SyncAPIResource):
370
370
  messages: Iterable[BetaMessageParam],
371
371
  model: ModelParam,
372
372
  stream: Literal[True],
373
- container: Optional[str] | NotGiven = NOT_GIVEN,
374
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
375
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
376
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
377
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
378
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
379
- temperature: float | NotGiven = NOT_GIVEN,
380
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
381
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
382
- tools: Iterable[BetaToolUnionParam] | NotGiven = NOT_GIVEN,
383
- top_k: int | NotGiven = NOT_GIVEN,
384
- top_p: float | NotGiven = NOT_GIVEN,
385
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
373
+ container: Optional[str] | Omit = omit,
374
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
375
+ metadata: BetaMetadataParam | Omit = omit,
376
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
377
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
378
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
379
+ temperature: float | Omit = omit,
380
+ thinking: BetaThinkingConfigParam | Omit = omit,
381
+ tool_choice: BetaToolChoiceParam | Omit = omit,
382
+ tools: Iterable[BetaToolUnionParam] | Omit = omit,
383
+ top_k: int | Omit = omit,
384
+ top_p: float | Omit = omit,
385
+ betas: List[AnthropicBetaParam] | Omit = omit,
386
386
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
387
387
  # The extra values given here take precedence over values defined on the client or passed to this method.
388
388
  extra_headers: Headers | None = None,
389
389
  extra_query: Query | None = None,
390
390
  extra_body: Body | None = None,
391
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
391
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
392
392
  ) -> Stream[BetaRawMessageStreamEvent]:
393
393
  """
394
394
  Send a structured list of input messages with text and/or image content, and the
@@ -647,25 +647,25 @@ class Messages(SyncAPIResource):
647
647
  messages: Iterable[BetaMessageParam],
648
648
  model: ModelParam,
649
649
  stream: bool,
650
- container: Optional[str] | NotGiven = NOT_GIVEN,
651
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
652
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
653
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
654
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
655
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
656
- temperature: float | NotGiven = NOT_GIVEN,
657
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
658
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
659
- tools: Iterable[BetaToolUnionParam] | NotGiven = NOT_GIVEN,
660
- top_k: int | NotGiven = NOT_GIVEN,
661
- top_p: float | NotGiven = NOT_GIVEN,
662
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
650
+ container: Optional[str] | Omit = omit,
651
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
652
+ metadata: BetaMetadataParam | Omit = omit,
653
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
654
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
655
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
656
+ temperature: float | Omit = omit,
657
+ thinking: BetaThinkingConfigParam | Omit = omit,
658
+ tool_choice: BetaToolChoiceParam | Omit = omit,
659
+ tools: Iterable[BetaToolUnionParam] | Omit = omit,
660
+ top_k: int | Omit = omit,
661
+ top_p: float | Omit = omit,
662
+ betas: List[AnthropicBetaParam] | Omit = omit,
663
663
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
664
664
  # The extra values given here take precedence over values defined on the client or passed to this method.
665
665
  extra_headers: Headers | None = None,
666
666
  extra_query: Query | None = None,
667
667
  extra_body: Body | None = None,
668
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
668
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
669
669
  ) -> BetaMessage | Stream[BetaRawMessageStreamEvent]:
670
670
  """
671
671
  Send a structured list of input messages with text and/or image content, and the
@@ -923,26 +923,26 @@ class Messages(SyncAPIResource):
923
923
  max_tokens: int,
924
924
  messages: Iterable[BetaMessageParam],
925
925
  model: ModelParam,
926
- container: Optional[str] | NotGiven = NOT_GIVEN,
927
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
928
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
929
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
930
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
931
- stream: Literal[False] | Literal[True] | NotGiven = NOT_GIVEN,
932
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
933
- temperature: float | NotGiven = NOT_GIVEN,
934
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
935
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
936
- tools: Iterable[BetaToolUnionParam] | NotGiven = NOT_GIVEN,
937
- top_k: int | NotGiven = NOT_GIVEN,
938
- top_p: float | NotGiven = NOT_GIVEN,
939
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
926
+ container: Optional[str] | Omit = omit,
927
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
928
+ metadata: BetaMetadataParam | Omit = omit,
929
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
930
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
931
+ stream: Literal[False] | Literal[True] | Omit = omit,
932
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
933
+ temperature: float | Omit = omit,
934
+ thinking: BetaThinkingConfigParam | Omit = omit,
935
+ tool_choice: BetaToolChoiceParam | Omit = omit,
936
+ tools: Iterable[BetaToolUnionParam] | Omit = omit,
937
+ top_k: int | Omit = omit,
938
+ top_p: float | Omit = omit,
939
+ betas: List[AnthropicBetaParam] | Omit = omit,
940
940
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
941
941
  # The extra values given here take precedence over values defined on the client or passed to this method.
942
942
  extra_headers: Headers | None = None,
943
943
  extra_query: Query | None = None,
944
944
  extra_body: Body | None = None,
945
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
945
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
946
946
  ) -> BetaMessage | Stream[BetaRawMessageStreamEvent]:
947
947
  if not stream and not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT:
948
948
  timeout = self._client._calculate_nonstreaming_timeout(
@@ -957,7 +957,7 @@ class Messages(SyncAPIResource):
957
957
  )
958
958
 
959
959
  extra_headers = {
960
- **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
960
+ **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else omit}),
961
961
  **(extra_headers or {}),
962
962
  }
963
963
  return self._post(
@@ -1001,20 +1001,20 @@ class Messages(SyncAPIResource):
1001
1001
  messages: Iterable[BetaMessageParam],
1002
1002
  model: ModelParam,
1003
1003
  tools: Iterable[BetaFunctionTool[Any]],
1004
- max_iterations: int | NotGiven = NOT_GIVEN,
1005
- container: Optional[str] | NotGiven = NOT_GIVEN,
1006
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
1007
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
1008
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
1009
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
1010
- stream: Literal[False] | NotGiven = NOT_GIVEN,
1011
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
1012
- temperature: float | NotGiven = NOT_GIVEN,
1013
- top_k: int | NotGiven = NOT_GIVEN,
1014
- top_p: float | NotGiven = NOT_GIVEN,
1015
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
1016
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
1017
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
1004
+ max_iterations: int | Omit = omit,
1005
+ container: Optional[str] | Omit = omit,
1006
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
1007
+ metadata: BetaMetadataParam | Omit = omit,
1008
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
1009
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
1010
+ stream: Literal[False] | Omit = omit,
1011
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
1012
+ temperature: float | Omit = omit,
1013
+ top_k: int | Omit = omit,
1014
+ top_p: float | Omit = omit,
1015
+ thinking: BetaThinkingConfigParam | Omit = omit,
1016
+ tool_choice: BetaToolChoiceParam | Omit = omit,
1017
+ betas: List[AnthropicBetaParam] | Omit = omit,
1018
1018
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1019
1019
  # The extra values given here take precedence over values defined on the client or passed to this method.
1020
1020
  extra_headers: Headers | None = None,
@@ -1032,19 +1032,19 @@ class Messages(SyncAPIResource):
1032
1032
  model: ModelParam,
1033
1033
  tools: Iterable[BetaFunctionTool[Any]],
1034
1034
  stream: Literal[True],
1035
- max_iterations: int | NotGiven = NOT_GIVEN,
1036
- container: Optional[str] | NotGiven = NOT_GIVEN,
1037
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
1038
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
1039
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
1040
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
1041
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
1042
- temperature: float | NotGiven = NOT_GIVEN,
1043
- top_k: int | NotGiven = NOT_GIVEN,
1044
- top_p: float | NotGiven = NOT_GIVEN,
1045
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
1046
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
1047
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
1035
+ max_iterations: int | Omit = omit,
1036
+ container: Optional[str] | Omit = omit,
1037
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
1038
+ metadata: BetaMetadataParam | Omit = omit,
1039
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
1040
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
1041
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
1042
+ temperature: float | Omit = omit,
1043
+ top_k: int | Omit = omit,
1044
+ top_p: float | Omit = omit,
1045
+ thinking: BetaThinkingConfigParam | Omit = omit,
1046
+ tool_choice: BetaToolChoiceParam | Omit = omit,
1047
+ betas: List[AnthropicBetaParam] | Omit = omit,
1048
1048
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1049
1049
  # The extra values given here take precedence over values defined on the client or passed to this method.
1050
1050
  extra_headers: Headers | None = None,
@@ -1062,19 +1062,19 @@ class Messages(SyncAPIResource):
1062
1062
  model: ModelParam,
1063
1063
  tools: Iterable[BetaFunctionTool[Any]],
1064
1064
  stream: bool,
1065
- max_iterations: int | NotGiven = NOT_GIVEN,
1066
- container: Optional[str] | NotGiven = NOT_GIVEN,
1067
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
1068
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
1069
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
1070
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
1071
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
1072
- temperature: float | NotGiven = NOT_GIVEN,
1073
- top_k: int | NotGiven = NOT_GIVEN,
1074
- top_p: float | NotGiven = NOT_GIVEN,
1075
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
1076
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
1077
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
1065
+ max_iterations: int | Omit = omit,
1066
+ container: Optional[str] | Omit = omit,
1067
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
1068
+ metadata: BetaMetadataParam | Omit = omit,
1069
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
1070
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
1071
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
1072
+ temperature: float | Omit = omit,
1073
+ top_k: int | Omit = omit,
1074
+ top_p: float | Omit = omit,
1075
+ thinking: BetaThinkingConfigParam | Omit = omit,
1076
+ tool_choice: BetaToolChoiceParam | Omit = omit,
1077
+ betas: List[AnthropicBetaParam] | Omit = omit,
1078
1078
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1079
1079
  # The extra values given here take precedence over values defined on the client or passed to this method.
1080
1080
  extra_headers: Headers | None = None,
@@ -1090,20 +1090,20 @@ class Messages(SyncAPIResource):
1090
1090
  messages: Iterable[BetaMessageParam],
1091
1091
  model: ModelParam,
1092
1092
  tools: Iterable[BetaFunctionTool[Any]],
1093
- max_iterations: int | NotGiven = NOT_GIVEN,
1094
- container: Optional[str] | NotGiven = NOT_GIVEN,
1095
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
1096
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
1097
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
1098
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
1099
- stream: bool | NotGiven = NOT_GIVEN,
1100
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
1101
- temperature: float | NotGiven = NOT_GIVEN,
1102
- top_k: int | NotGiven = NOT_GIVEN,
1103
- top_p: float | NotGiven = NOT_GIVEN,
1104
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
1105
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
1106
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
1093
+ max_iterations: int | Omit = omit,
1094
+ container: Optional[str] | Omit = omit,
1095
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
1096
+ metadata: BetaMetadataParam | Omit = omit,
1097
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
1098
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
1099
+ stream: bool | Omit = omit,
1100
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
1101
+ temperature: float | Omit = omit,
1102
+ top_k: int | Omit = omit,
1103
+ top_p: float | Omit = omit,
1104
+ thinking: BetaThinkingConfigParam | Omit = omit,
1105
+ tool_choice: BetaToolChoiceParam | Omit = omit,
1106
+ betas: List[AnthropicBetaParam] | Omit = omit,
1107
1107
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1108
1108
  # The extra values given here take precedence over values defined on the client or passed to this method.
1109
1109
  extra_headers: Headers | None = None,
@@ -1120,7 +1120,7 @@ class Messages(SyncAPIResource):
1120
1120
  )
1121
1121
 
1122
1122
  extra_headers = {
1123
- "X-Stainless-Helper": "beta.messages.tool_runner",
1123
+ "X-Stainless-Helper": "BetaToolRunner",
1124
1124
  **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
1125
1125
  **(extra_headers or {}),
1126
1126
  }
@@ -1178,19 +1178,19 @@ class Messages(SyncAPIResource):
1178
1178
  max_tokens: int,
1179
1179
  messages: Iterable[BetaMessageParam],
1180
1180
  model: ModelParam,
1181
- container: Optional[str] | NotGiven = NOT_GIVEN,
1182
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
1183
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
1184
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
1185
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
1186
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
1187
- temperature: float | NotGiven = NOT_GIVEN,
1188
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
1189
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
1190
- tools: Iterable[BetaToolUnionParam] | NotGiven = NOT_GIVEN,
1191
- top_k: int | NotGiven = NOT_GIVEN,
1192
- top_p: float | NotGiven = NOT_GIVEN,
1193
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
1181
+ container: Optional[str] | Omit = omit,
1182
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
1183
+ metadata: BetaMetadataParam | Omit = omit,
1184
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
1185
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
1186
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
1187
+ temperature: float | Omit = omit,
1188
+ thinking: BetaThinkingConfigParam | Omit = omit,
1189
+ tool_choice: BetaToolChoiceParam | Omit = omit,
1190
+ tools: Iterable[BetaToolUnionParam] | Omit = omit,
1191
+ top_k: int | Omit = omit,
1192
+ top_p: float | Omit = omit,
1193
+ betas: List[AnthropicBetaParam] | Omit = omit,
1194
1194
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1195
1195
  # The extra values given here take precedence over values defined on the client or passed to this method.
1196
1196
  extra_headers: Headers | None = None,
@@ -1249,18 +1249,18 @@ class Messages(SyncAPIResource):
1249
1249
  *,
1250
1250
  messages: Iterable[BetaMessageParam],
1251
1251
  model: ModelParam,
1252
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
1253
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
1254
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
1255
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
1256
- tools: Iterable[message_count_tokens_params.Tool] | NotGiven = NOT_GIVEN,
1257
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
1252
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
1253
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
1254
+ thinking: BetaThinkingConfigParam | Omit = omit,
1255
+ tool_choice: BetaToolChoiceParam | Omit = omit,
1256
+ tools: Iterable[message_count_tokens_params.Tool] | Omit = omit,
1257
+ betas: List[AnthropicBetaParam] | Omit = omit,
1258
1258
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1259
1259
  # The extra values given here take precedence over values defined on the client or passed to this method.
1260
1260
  extra_headers: Headers | None = None,
1261
1261
  extra_query: Query | None = None,
1262
1262
  extra_body: Body | None = None,
1263
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1263
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1264
1264
  ) -> BetaMessageTokensCount:
1265
1265
  """
1266
1266
  Count the number of tokens in a Message.
@@ -1454,7 +1454,7 @@ class Messages(SyncAPIResource):
1454
1454
  {
1455
1455
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["token-counting-2024-11-01"]))
1456
1456
  if is_given(betas)
1457
- else NOT_GIVEN
1457
+ else omit
1458
1458
  }
1459
1459
  ),
1460
1460
  **(extra_headers or {}),
@@ -1512,26 +1512,26 @@ class AsyncMessages(AsyncAPIResource):
1512
1512
  max_tokens: int,
1513
1513
  messages: Iterable[BetaMessageParam],
1514
1514
  model: ModelParam,
1515
- container: Optional[str] | NotGiven = NOT_GIVEN,
1516
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
1517
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
1518
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
1519
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
1520
- stream: Literal[False] | NotGiven = NOT_GIVEN,
1521
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
1522
- temperature: float | NotGiven = NOT_GIVEN,
1523
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
1524
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
1525
- tools: Iterable[BetaToolUnionParam] | NotGiven = NOT_GIVEN,
1526
- top_k: int | NotGiven = NOT_GIVEN,
1527
- top_p: float | NotGiven = NOT_GIVEN,
1528
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
1515
+ container: Optional[str] | Omit = omit,
1516
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
1517
+ metadata: BetaMetadataParam | Omit = omit,
1518
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
1519
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
1520
+ stream: Literal[False] | Omit = omit,
1521
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
1522
+ temperature: float | Omit = omit,
1523
+ thinking: BetaThinkingConfigParam | Omit = omit,
1524
+ tool_choice: BetaToolChoiceParam | Omit = omit,
1525
+ tools: Iterable[BetaToolUnionParam] | Omit = omit,
1526
+ top_k: int | Omit = omit,
1527
+ top_p: float | Omit = omit,
1528
+ betas: List[AnthropicBetaParam] | Omit = omit,
1529
1529
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1530
1530
  # The extra values given here take precedence over values defined on the client or passed to this method.
1531
1531
  extra_headers: Headers | None = None,
1532
1532
  extra_query: Query | None = None,
1533
1533
  extra_body: Body | None = None,
1534
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1534
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1535
1535
  ) -> BetaMessage:
1536
1536
  """
1537
1537
  Send a structured list of input messages with text and/or image content, and the
@@ -1790,25 +1790,25 @@ class AsyncMessages(AsyncAPIResource):
1790
1790
  messages: Iterable[BetaMessageParam],
1791
1791
  model: ModelParam,
1792
1792
  stream: Literal[True],
1793
- container: Optional[str] | NotGiven = NOT_GIVEN,
1794
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
1795
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
1796
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
1797
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
1798
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
1799
- temperature: float | NotGiven = NOT_GIVEN,
1800
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
1801
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
1802
- tools: Iterable[BetaToolUnionParam] | NotGiven = NOT_GIVEN,
1803
- top_k: int | NotGiven = NOT_GIVEN,
1804
- top_p: float | NotGiven = NOT_GIVEN,
1805
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
1793
+ container: Optional[str] | Omit = omit,
1794
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
1795
+ metadata: BetaMetadataParam | Omit = omit,
1796
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
1797
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
1798
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
1799
+ temperature: float | Omit = omit,
1800
+ thinking: BetaThinkingConfigParam | Omit = omit,
1801
+ tool_choice: BetaToolChoiceParam | Omit = omit,
1802
+ tools: Iterable[BetaToolUnionParam] | Omit = omit,
1803
+ top_k: int | Omit = omit,
1804
+ top_p: float | Omit = omit,
1805
+ betas: List[AnthropicBetaParam] | Omit = omit,
1806
1806
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1807
1807
  # The extra values given here take precedence over values defined on the client or passed to this method.
1808
1808
  extra_headers: Headers | None = None,
1809
1809
  extra_query: Query | None = None,
1810
1810
  extra_body: Body | None = None,
1811
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1811
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1812
1812
  ) -> AsyncStream[BetaRawMessageStreamEvent]:
1813
1813
  """
1814
1814
  Send a structured list of input messages with text and/or image content, and the
@@ -2067,25 +2067,25 @@ class AsyncMessages(AsyncAPIResource):
2067
2067
  messages: Iterable[BetaMessageParam],
2068
2068
  model: ModelParam,
2069
2069
  stream: bool,
2070
- container: Optional[str] | NotGiven = NOT_GIVEN,
2071
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
2072
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
2073
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
2074
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
2075
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
2076
- temperature: float | NotGiven = NOT_GIVEN,
2077
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
2078
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
2079
- tools: Iterable[BetaToolUnionParam] | NotGiven = NOT_GIVEN,
2080
- top_k: int | NotGiven = NOT_GIVEN,
2081
- top_p: float | NotGiven = NOT_GIVEN,
2082
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
2070
+ container: Optional[str] | Omit = omit,
2071
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
2072
+ metadata: BetaMetadataParam | Omit = omit,
2073
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
2074
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
2075
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
2076
+ temperature: float | Omit = omit,
2077
+ thinking: BetaThinkingConfigParam | Omit = omit,
2078
+ tool_choice: BetaToolChoiceParam | Omit = omit,
2079
+ tools: Iterable[BetaToolUnionParam] | Omit = omit,
2080
+ top_k: int | Omit = omit,
2081
+ top_p: float | Omit = omit,
2082
+ betas: List[AnthropicBetaParam] | Omit = omit,
2083
2083
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2084
2084
  # The extra values given here take precedence over values defined on the client or passed to this method.
2085
2085
  extra_headers: Headers | None = None,
2086
2086
  extra_query: Query | None = None,
2087
2087
  extra_body: Body | None = None,
2088
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2088
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
2089
2089
  ) -> BetaMessage | AsyncStream[BetaRawMessageStreamEvent]:
2090
2090
  """
2091
2091
  Send a structured list of input messages with text and/or image content, and the
@@ -2343,26 +2343,26 @@ class AsyncMessages(AsyncAPIResource):
2343
2343
  max_tokens: int,
2344
2344
  messages: Iterable[BetaMessageParam],
2345
2345
  model: ModelParam,
2346
- container: Optional[str] | NotGiven = NOT_GIVEN,
2347
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
2348
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
2349
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
2350
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
2351
- stream: Literal[False] | Literal[True] | NotGiven = NOT_GIVEN,
2352
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
2353
- temperature: float | NotGiven = NOT_GIVEN,
2354
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
2355
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
2356
- tools: Iterable[BetaToolUnionParam] | NotGiven = NOT_GIVEN,
2357
- top_k: int | NotGiven = NOT_GIVEN,
2358
- top_p: float | NotGiven = NOT_GIVEN,
2359
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
2346
+ container: Optional[str] | Omit = omit,
2347
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
2348
+ metadata: BetaMetadataParam | Omit = omit,
2349
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
2350
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
2351
+ stream: Literal[False] | Literal[True] | Omit = omit,
2352
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
2353
+ temperature: float | Omit = omit,
2354
+ thinking: BetaThinkingConfigParam | Omit = omit,
2355
+ tool_choice: BetaToolChoiceParam | Omit = omit,
2356
+ tools: Iterable[BetaToolUnionParam] | Omit = omit,
2357
+ top_k: int | Omit = omit,
2358
+ top_p: float | Omit = omit,
2359
+ betas: List[AnthropicBetaParam] | Omit = omit,
2360
2360
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2361
2361
  # The extra values given here take precedence over values defined on the client or passed to this method.
2362
2362
  extra_headers: Headers | None = None,
2363
2363
  extra_query: Query | None = None,
2364
2364
  extra_body: Body | None = None,
2365
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2365
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
2366
2366
  ) -> BetaMessage | AsyncStream[BetaRawMessageStreamEvent]:
2367
2367
  if not stream and not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT:
2368
2368
  timeout = self._client._calculate_nonstreaming_timeout(
@@ -2377,7 +2377,7 @@ class AsyncMessages(AsyncAPIResource):
2377
2377
  )
2378
2378
 
2379
2379
  extra_headers = {
2380
- **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
2380
+ **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else omit}),
2381
2381
  **(extra_headers or {}),
2382
2382
  }
2383
2383
  return await self._post(
@@ -2421,20 +2421,20 @@ class AsyncMessages(AsyncAPIResource):
2421
2421
  messages: Iterable[BetaMessageParam],
2422
2422
  model: ModelParam,
2423
2423
  tools: Iterable[BetaAsyncFunctionTool[Any]],
2424
- max_iterations: int | NotGiven = NOT_GIVEN,
2425
- container: Optional[str] | NotGiven = NOT_GIVEN,
2426
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
2427
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
2428
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
2429
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
2430
- stream: Literal[False] | NotGiven = NOT_GIVEN,
2431
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
2432
- temperature: float | NotGiven = NOT_GIVEN,
2433
- top_k: int | NotGiven = NOT_GIVEN,
2434
- top_p: float | NotGiven = NOT_GIVEN,
2435
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
2436
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
2437
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
2424
+ max_iterations: int | Omit = omit,
2425
+ container: Optional[str] | Omit = omit,
2426
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
2427
+ metadata: BetaMetadataParam | Omit = omit,
2428
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
2429
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
2430
+ stream: Literal[False] | Omit = omit,
2431
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
2432
+ temperature: float | Omit = omit,
2433
+ top_k: int | Omit = omit,
2434
+ top_p: float | Omit = omit,
2435
+ thinking: BetaThinkingConfigParam | Omit = omit,
2436
+ tool_choice: BetaToolChoiceParam | Omit = omit,
2437
+ betas: List[AnthropicBetaParam] | Omit = omit,
2438
2438
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2439
2439
  # The extra values given here take precedence over values defined on the client or passed to this method.
2440
2440
  extra_headers: Headers | None = None,
@@ -2452,19 +2452,19 @@ class AsyncMessages(AsyncAPIResource):
2452
2452
  model: ModelParam,
2453
2453
  tools: Iterable[BetaAsyncFunctionTool[Any]],
2454
2454
  stream: Literal[True],
2455
- max_iterations: int | NotGiven = NOT_GIVEN,
2456
- container: Optional[str] | NotGiven = NOT_GIVEN,
2457
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
2458
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
2459
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
2460
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
2461
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
2462
- temperature: float | NotGiven = NOT_GIVEN,
2463
- top_k: int | NotGiven = NOT_GIVEN,
2464
- top_p: float | NotGiven = NOT_GIVEN,
2465
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
2466
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
2467
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
2455
+ max_iterations: int | Omit = omit,
2456
+ container: Optional[str] | Omit = omit,
2457
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
2458
+ metadata: BetaMetadataParam | Omit = omit,
2459
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
2460
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
2461
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
2462
+ temperature: float | Omit = omit,
2463
+ top_k: int | Omit = omit,
2464
+ top_p: float | Omit = omit,
2465
+ thinking: BetaThinkingConfigParam | Omit = omit,
2466
+ tool_choice: BetaToolChoiceParam | Omit = omit,
2467
+ betas: List[AnthropicBetaParam] | Omit = omit,
2468
2468
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2469
2469
  # The extra values given here take precedence over values defined on the client or passed to this method.
2470
2470
  extra_headers: Headers | None = None,
@@ -2482,19 +2482,19 @@ class AsyncMessages(AsyncAPIResource):
2482
2482
  model: ModelParam,
2483
2483
  tools: Iterable[BetaAsyncFunctionTool[Any]],
2484
2484
  stream: bool,
2485
- max_iterations: int | NotGiven = NOT_GIVEN,
2486
- container: Optional[str] | NotGiven = NOT_GIVEN,
2487
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
2488
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
2489
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
2490
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
2491
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
2492
- temperature: float | NotGiven = NOT_GIVEN,
2493
- top_k: int | NotGiven = NOT_GIVEN,
2494
- top_p: float | NotGiven = NOT_GIVEN,
2495
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
2496
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
2497
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
2485
+ max_iterations: int | Omit = omit,
2486
+ container: Optional[str] | Omit = omit,
2487
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
2488
+ metadata: BetaMetadataParam | Omit = omit,
2489
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
2490
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
2491
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
2492
+ temperature: float | Omit = omit,
2493
+ top_k: int | Omit = omit,
2494
+ top_p: float | Omit = omit,
2495
+ thinking: BetaThinkingConfigParam | Omit = omit,
2496
+ tool_choice: BetaToolChoiceParam | Omit = omit,
2497
+ betas: List[AnthropicBetaParam] | Omit = omit,
2498
2498
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2499
2499
  # The extra values given here take precedence over values defined on the client or passed to this method.
2500
2500
  extra_headers: Headers | None = None,
@@ -2510,20 +2510,20 @@ class AsyncMessages(AsyncAPIResource):
2510
2510
  messages: Iterable[BetaMessageParam],
2511
2511
  model: ModelParam,
2512
2512
  tools: Iterable[BetaAsyncFunctionTool[Any]],
2513
- max_iterations: int | NotGiven = NOT_GIVEN,
2514
- container: Optional[str] | NotGiven = NOT_GIVEN,
2515
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
2516
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
2517
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
2518
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
2519
- stream: Literal[True] | Literal[False] | NotGiven = False,
2520
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
2521
- temperature: float | NotGiven = NOT_GIVEN,
2522
- top_k: int | NotGiven = NOT_GIVEN,
2523
- top_p: float | NotGiven = NOT_GIVEN,
2524
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
2525
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
2526
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
2513
+ max_iterations: int | Omit = omit,
2514
+ container: Optional[str] | Omit = omit,
2515
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
2516
+ metadata: BetaMetadataParam | Omit = omit,
2517
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
2518
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
2519
+ stream: Literal[True] | Literal[False] | Omit = False,
2520
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
2521
+ temperature: float | Omit = omit,
2522
+ top_k: int | Omit = omit,
2523
+ top_p: float | Omit = omit,
2524
+ thinking: BetaThinkingConfigParam | Omit = omit,
2525
+ tool_choice: BetaToolChoiceParam | Omit = omit,
2526
+ betas: List[AnthropicBetaParam] | Omit = omit,
2527
2527
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2528
2528
  # The extra values given here take precedence over values defined on the client or passed to this method.
2529
2529
  extra_headers: Headers | None = None,
@@ -2540,7 +2540,7 @@ class AsyncMessages(AsyncAPIResource):
2540
2540
  )
2541
2541
 
2542
2542
  extra_headers = {
2543
- "X-Stainless-Helper": "beta.messages.tool_runner",
2543
+ "X-Stainless-Helper": "BetaToolRunner",
2544
2544
  **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
2545
2545
  **(extra_headers or {}),
2546
2546
  }
@@ -2598,19 +2598,19 @@ class AsyncMessages(AsyncAPIResource):
2598
2598
  max_tokens: int,
2599
2599
  messages: Iterable[BetaMessageParam],
2600
2600
  model: ModelParam,
2601
- metadata: BetaMetadataParam | NotGiven = NOT_GIVEN,
2602
- container: Optional[str] | NotGiven = NOT_GIVEN,
2603
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
2604
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
2605
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
2606
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
2607
- temperature: float | NotGiven = NOT_GIVEN,
2608
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
2609
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
2610
- tools: Iterable[BetaToolUnionParam] | NotGiven = NOT_GIVEN,
2611
- top_k: int | NotGiven = NOT_GIVEN,
2612
- top_p: float | NotGiven = NOT_GIVEN,
2613
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
2601
+ metadata: BetaMetadataParam | Omit = omit,
2602
+ container: Optional[str] | Omit = omit,
2603
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
2604
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
2605
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
2606
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
2607
+ temperature: float | Omit = omit,
2608
+ thinking: BetaThinkingConfigParam | Omit = omit,
2609
+ tool_choice: BetaToolChoiceParam | Omit = omit,
2610
+ tools: Iterable[BetaToolUnionParam] | Omit = omit,
2611
+ top_k: int | Omit = omit,
2612
+ top_p: float | Omit = omit,
2613
+ betas: List[AnthropicBetaParam] | Omit = omit,
2614
2614
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2615
2615
  # The extra values given here take precedence over values defined on the client or passed to this method.
2616
2616
  extra_headers: Headers | None = None,
@@ -2667,18 +2667,18 @@ class AsyncMessages(AsyncAPIResource):
2667
2667
  *,
2668
2668
  messages: Iterable[BetaMessageParam],
2669
2669
  model: ModelParam,
2670
- mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | NotGiven = NOT_GIVEN,
2671
- system: Union[str, Iterable[BetaTextBlockParam]] | NotGiven = NOT_GIVEN,
2672
- thinking: BetaThinkingConfigParam | NotGiven = NOT_GIVEN,
2673
- tool_choice: BetaToolChoiceParam | NotGiven = NOT_GIVEN,
2674
- tools: Iterable[message_count_tokens_params.Tool] | NotGiven = NOT_GIVEN,
2675
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
2670
+ mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] | Omit = omit,
2671
+ system: Union[str, Iterable[BetaTextBlockParam]] | Omit = omit,
2672
+ thinking: BetaThinkingConfigParam | Omit = omit,
2673
+ tool_choice: BetaToolChoiceParam | Omit = omit,
2674
+ tools: Iterable[message_count_tokens_params.Tool] | Omit = omit,
2675
+ betas: List[AnthropicBetaParam] | Omit = omit,
2676
2676
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2677
2677
  # The extra values given here take precedence over values defined on the client or passed to this method.
2678
2678
  extra_headers: Headers | None = None,
2679
2679
  extra_query: Query | None = None,
2680
2680
  extra_body: Body | None = None,
2681
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2681
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
2682
2682
  ) -> BetaMessageTokensCount:
2683
2683
  """
2684
2684
  Count the number of tokens in a Message.
@@ -2872,7 +2872,7 @@ class AsyncMessages(AsyncAPIResource):
2872
2872
  {
2873
2873
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["token-counting-2024-11-01"]))
2874
2874
  if is_given(betas)
2875
- else NOT_GIVEN
2875
+ else omit
2876
2876
  }
2877
2877
  ),
2878
2878
  **(extra_headers or {}),