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.
@@ -23,7 +23,7 @@ from .batches import (
23
23
  BatchesWithStreamingResponse,
24
24
  AsyncBatchesWithStreamingResponse,
25
25
  )
26
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
26
+ from ..._types import NOT_GIVEN, Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
27
27
  from ..._utils import is_given, required_args, maybe_transform, async_maybe_transform
28
28
  from ..._compat import cached_property
29
29
  from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -93,23 +93,23 @@ class Messages(SyncAPIResource):
93
93
  max_tokens: int,
94
94
  messages: Iterable[MessageParam],
95
95
  model: ModelParam,
96
- metadata: MetadataParam | NotGiven = NOT_GIVEN,
97
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
98
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
99
- stream: Literal[False] | NotGiven = NOT_GIVEN,
100
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
101
- temperature: float | NotGiven = NOT_GIVEN,
102
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
103
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
104
- tools: Iterable[ToolUnionParam] | NotGiven = NOT_GIVEN,
105
- top_k: int | NotGiven = NOT_GIVEN,
106
- top_p: float | NotGiven = NOT_GIVEN,
96
+ metadata: MetadataParam | Omit = omit,
97
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
98
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
99
+ stream: Literal[False] | Omit = omit,
100
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
101
+ temperature: float | Omit = omit,
102
+ thinking: ThinkingConfigParam | Omit = omit,
103
+ tool_choice: ToolChoiceParam | Omit = omit,
104
+ tools: Iterable[ToolUnionParam] | Omit = omit,
105
+ top_k: int | Omit = omit,
106
+ top_p: float | Omit = omit,
107
107
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
108
108
  # The extra values given here take precedence over values defined on the client or passed to this method.
109
109
  extra_headers: Headers | None = None,
110
110
  extra_query: Query | None = None,
111
111
  extra_body: Body | None = None,
112
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
112
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
113
113
  ) -> Message:
114
114
  """
115
115
  Send a structured list of input messages with text and/or image content, and the
@@ -362,22 +362,22 @@ class Messages(SyncAPIResource):
362
362
  messages: Iterable[MessageParam],
363
363
  model: ModelParam,
364
364
  stream: Literal[True],
365
- metadata: MetadataParam | NotGiven = NOT_GIVEN,
366
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
367
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
368
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
369
- temperature: float | NotGiven = NOT_GIVEN,
370
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
371
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
372
- tools: Iterable[ToolUnionParam] | NotGiven = NOT_GIVEN,
373
- top_k: int | NotGiven = NOT_GIVEN,
374
- top_p: float | NotGiven = NOT_GIVEN,
365
+ metadata: MetadataParam | Omit = omit,
366
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
367
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
368
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
369
+ temperature: float | Omit = omit,
370
+ thinking: ThinkingConfigParam | Omit = omit,
371
+ tool_choice: ToolChoiceParam | Omit = omit,
372
+ tools: Iterable[ToolUnionParam] | Omit = omit,
373
+ top_k: int | Omit = omit,
374
+ top_p: float | Omit = omit,
375
375
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
376
376
  # The extra values given here take precedence over values defined on the client or passed to this method.
377
377
  extra_headers: Headers | None = None,
378
378
  extra_query: Query | None = None,
379
379
  extra_body: Body | None = None,
380
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
380
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
381
381
  ) -> Stream[RawMessageStreamEvent]:
382
382
  """
383
383
  Send a structured list of input messages with text and/or image content, and the
@@ -630,22 +630,22 @@ class Messages(SyncAPIResource):
630
630
  messages: Iterable[MessageParam],
631
631
  model: ModelParam,
632
632
  stream: bool,
633
- metadata: MetadataParam | NotGiven = NOT_GIVEN,
634
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
635
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
636
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
637
- temperature: float | NotGiven = NOT_GIVEN,
638
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
639
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
640
- tools: Iterable[ToolUnionParam] | NotGiven = NOT_GIVEN,
641
- top_k: int | NotGiven = NOT_GIVEN,
642
- top_p: float | NotGiven = NOT_GIVEN,
633
+ metadata: MetadataParam | Omit = omit,
634
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
635
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
636
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
637
+ temperature: float | Omit = omit,
638
+ thinking: ThinkingConfigParam | Omit = omit,
639
+ tool_choice: ToolChoiceParam | Omit = omit,
640
+ tools: Iterable[ToolUnionParam] | Omit = omit,
641
+ top_k: int | Omit = omit,
642
+ top_p: float | Omit = omit,
643
643
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
644
644
  # The extra values given here take precedence over values defined on the client or passed to this method.
645
645
  extra_headers: Headers | None = None,
646
646
  extra_query: Query | None = None,
647
647
  extra_body: Body | None = None,
648
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
648
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
649
649
  ) -> Message | Stream[RawMessageStreamEvent]:
650
650
  """
651
651
  Send a structured list of input messages with text and/or image content, and the
@@ -897,23 +897,23 @@ class Messages(SyncAPIResource):
897
897
  max_tokens: int,
898
898
  messages: Iterable[MessageParam],
899
899
  model: ModelParam,
900
- metadata: MetadataParam | NotGiven = NOT_GIVEN,
901
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
902
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
903
- stream: Literal[False] | Literal[True] | NotGiven = NOT_GIVEN,
904
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
905
- temperature: float | NotGiven = NOT_GIVEN,
906
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
907
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
908
- tools: Iterable[ToolUnionParam] | NotGiven = NOT_GIVEN,
909
- top_k: int | NotGiven = NOT_GIVEN,
910
- top_p: float | NotGiven = NOT_GIVEN,
900
+ metadata: MetadataParam | Omit = omit,
901
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
902
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
903
+ stream: Literal[False] | Literal[True] | Omit = omit,
904
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
905
+ temperature: float | Omit = omit,
906
+ thinking: ThinkingConfigParam | Omit = omit,
907
+ tool_choice: ToolChoiceParam | Omit = omit,
908
+ tools: Iterable[ToolUnionParam] | Omit = omit,
909
+ top_k: int | Omit = omit,
910
+ top_p: float | Omit = omit,
911
911
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
912
912
  # The extra values given here take precedence over values defined on the client or passed to this method.
913
913
  extra_headers: Headers | None = None,
914
914
  extra_query: Query | None = None,
915
915
  extra_body: Body | None = None,
916
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
916
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
917
917
  ) -> Message | Stream[RawMessageStreamEvent]:
918
918
  if not stream and not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT:
919
919
  timeout = self._client._calculate_nonstreaming_timeout(
@@ -964,17 +964,17 @@ class Messages(SyncAPIResource):
964
964
  max_tokens: int,
965
965
  messages: Iterable[MessageParam],
966
966
  model: ModelParam,
967
- metadata: MetadataParam | NotGiven = NOT_GIVEN,
968
- container: Optional[str] | NotGiven = NOT_GIVEN,
969
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
970
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
971
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
972
- temperature: float | NotGiven = NOT_GIVEN,
973
- top_k: int | NotGiven = NOT_GIVEN,
974
- top_p: float | NotGiven = NOT_GIVEN,
975
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
976
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
977
- tools: Iterable[ToolUnionParam] | NotGiven = NOT_GIVEN,
967
+ metadata: MetadataParam | Omit = omit,
968
+ container: Optional[str] | Omit = omit,
969
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
970
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
971
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
972
+ temperature: float | Omit = omit,
973
+ top_k: int | Omit = omit,
974
+ top_p: float | Omit = omit,
975
+ thinking: ThinkingConfigParam | Omit = omit,
976
+ tool_choice: ToolChoiceParam | Omit = omit,
977
+ tools: Iterable[ToolUnionParam] | Omit = omit,
978
978
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
979
979
  # The extra values given here take precedence over values defined on the client or passed to this method.
980
980
  extra_headers: Headers | None = None,
@@ -1031,16 +1031,16 @@ class Messages(SyncAPIResource):
1031
1031
  *,
1032
1032
  messages: Iterable[MessageParam],
1033
1033
  model: ModelParam,
1034
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
1035
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
1036
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
1037
- tools: Iterable[MessageCountTokensToolParam] | NotGiven = NOT_GIVEN,
1034
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
1035
+ thinking: ThinkingConfigParam | Omit = omit,
1036
+ tool_choice: ToolChoiceParam | Omit = omit,
1037
+ tools: Iterable[MessageCountTokensToolParam] | Omit = omit,
1038
1038
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1039
1039
  # The extra values given here take precedence over values defined on the client or passed to this method.
1040
1040
  extra_headers: Headers | None = None,
1041
1041
  extra_query: Query | None = None,
1042
1042
  extra_body: Body | None = None,
1043
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1043
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1044
1044
  ) -> MessageTokensCount:
1045
1045
  """
1046
1046
  Count the number of tokens in a Message.
@@ -1276,23 +1276,23 @@ class AsyncMessages(AsyncAPIResource):
1276
1276
  max_tokens: int,
1277
1277
  messages: Iterable[MessageParam],
1278
1278
  model: ModelParam,
1279
- metadata: MetadataParam | NotGiven = NOT_GIVEN,
1280
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
1281
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
1282
- stream: Literal[False] | NotGiven = NOT_GIVEN,
1283
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
1284
- temperature: float | NotGiven = NOT_GIVEN,
1285
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
1286
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
1287
- tools: Iterable[ToolUnionParam] | NotGiven = NOT_GIVEN,
1288
- top_k: int | NotGiven = NOT_GIVEN,
1289
- top_p: float | NotGiven = NOT_GIVEN,
1279
+ metadata: MetadataParam | Omit = omit,
1280
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
1281
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
1282
+ stream: Literal[False] | Omit = omit,
1283
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
1284
+ temperature: float | Omit = omit,
1285
+ thinking: ThinkingConfigParam | Omit = omit,
1286
+ tool_choice: ToolChoiceParam | Omit = omit,
1287
+ tools: Iterable[ToolUnionParam] | Omit = omit,
1288
+ top_k: int | Omit = omit,
1289
+ top_p: float | Omit = omit,
1290
1290
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1291
1291
  # The extra values given here take precedence over values defined on the client or passed to this method.
1292
1292
  extra_headers: Headers | None = None,
1293
1293
  extra_query: Query | None = None,
1294
1294
  extra_body: Body | None = None,
1295
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1295
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1296
1296
  ) -> Message:
1297
1297
  """
1298
1298
  Send a structured list of input messages with text and/or image content, and the
@@ -1545,22 +1545,22 @@ class AsyncMessages(AsyncAPIResource):
1545
1545
  messages: Iterable[MessageParam],
1546
1546
  model: ModelParam,
1547
1547
  stream: Literal[True],
1548
- metadata: MetadataParam | NotGiven = NOT_GIVEN,
1549
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
1550
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
1551
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
1552
- temperature: float | NotGiven = NOT_GIVEN,
1553
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
1554
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
1555
- tools: Iterable[ToolUnionParam] | NotGiven = NOT_GIVEN,
1556
- top_k: int | NotGiven = NOT_GIVEN,
1557
- top_p: float | NotGiven = NOT_GIVEN,
1548
+ metadata: MetadataParam | Omit = omit,
1549
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
1550
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
1551
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
1552
+ temperature: float | Omit = omit,
1553
+ thinking: ThinkingConfigParam | Omit = omit,
1554
+ tool_choice: ToolChoiceParam | Omit = omit,
1555
+ tools: Iterable[ToolUnionParam] | Omit = omit,
1556
+ top_k: int | Omit = omit,
1557
+ top_p: float | Omit = omit,
1558
1558
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1559
1559
  # The extra values given here take precedence over values defined on the client or passed to this method.
1560
1560
  extra_headers: Headers | None = None,
1561
1561
  extra_query: Query | None = None,
1562
1562
  extra_body: Body | None = None,
1563
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1563
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1564
1564
  ) -> AsyncStream[RawMessageStreamEvent]:
1565
1565
  """
1566
1566
  Send a structured list of input messages with text and/or image content, and the
@@ -1813,22 +1813,22 @@ class AsyncMessages(AsyncAPIResource):
1813
1813
  messages: Iterable[MessageParam],
1814
1814
  model: ModelParam,
1815
1815
  stream: bool,
1816
- metadata: MetadataParam | NotGiven = NOT_GIVEN,
1817
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
1818
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
1819
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
1820
- temperature: float | NotGiven = NOT_GIVEN,
1821
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
1822
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
1823
- tools: Iterable[ToolUnionParam] | NotGiven = NOT_GIVEN,
1824
- top_k: int | NotGiven = NOT_GIVEN,
1825
- top_p: float | NotGiven = NOT_GIVEN,
1816
+ metadata: MetadataParam | Omit = omit,
1817
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
1818
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
1819
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
1820
+ temperature: float | Omit = omit,
1821
+ thinking: ThinkingConfigParam | Omit = omit,
1822
+ tool_choice: ToolChoiceParam | Omit = omit,
1823
+ tools: Iterable[ToolUnionParam] | Omit = omit,
1824
+ top_k: int | Omit = omit,
1825
+ top_p: float | Omit = omit,
1826
1826
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1827
1827
  # The extra values given here take precedence over values defined on the client or passed to this method.
1828
1828
  extra_headers: Headers | None = None,
1829
1829
  extra_query: Query | None = None,
1830
1830
  extra_body: Body | None = None,
1831
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1831
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1832
1832
  ) -> Message | AsyncStream[RawMessageStreamEvent]:
1833
1833
  """
1834
1834
  Send a structured list of input messages with text and/or image content, and the
@@ -2080,23 +2080,23 @@ class AsyncMessages(AsyncAPIResource):
2080
2080
  max_tokens: int,
2081
2081
  messages: Iterable[MessageParam],
2082
2082
  model: ModelParam,
2083
- metadata: MetadataParam | NotGiven = NOT_GIVEN,
2084
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
2085
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
2086
- stream: Literal[False] | Literal[True] | NotGiven = NOT_GIVEN,
2087
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
2088
- temperature: float | NotGiven = NOT_GIVEN,
2089
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
2090
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
2091
- tools: Iterable[ToolUnionParam] | NotGiven = NOT_GIVEN,
2092
- top_k: int | NotGiven = NOT_GIVEN,
2093
- top_p: float | NotGiven = NOT_GIVEN,
2083
+ metadata: MetadataParam | Omit = omit,
2084
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
2085
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
2086
+ stream: Literal[False] | Literal[True] | Omit = omit,
2087
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
2088
+ temperature: float | Omit = omit,
2089
+ thinking: ThinkingConfigParam | Omit = omit,
2090
+ tool_choice: ToolChoiceParam | Omit = omit,
2091
+ tools: Iterable[ToolUnionParam] | Omit = omit,
2092
+ top_k: int | Omit = omit,
2093
+ top_p: float | Omit = omit,
2094
2094
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2095
2095
  # The extra values given here take precedence over values defined on the client or passed to this method.
2096
2096
  extra_headers: Headers | None = None,
2097
2097
  extra_query: Query | None = None,
2098
2098
  extra_body: Body | None = None,
2099
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2099
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
2100
2100
  ) -> Message | AsyncStream[RawMessageStreamEvent]:
2101
2101
  if not stream and not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT:
2102
2102
  timeout = self._client._calculate_nonstreaming_timeout(
@@ -2147,17 +2147,17 @@ class AsyncMessages(AsyncAPIResource):
2147
2147
  max_tokens: int,
2148
2148
  messages: Iterable[MessageParam],
2149
2149
  model: ModelParam,
2150
- metadata: MetadataParam | NotGiven = NOT_GIVEN,
2151
- container: Optional[str] | NotGiven = NOT_GIVEN,
2152
- service_tier: Literal["auto", "standard_only"] | NotGiven = NOT_GIVEN,
2153
- stop_sequences: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
2154
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
2155
- temperature: float | NotGiven = NOT_GIVEN,
2156
- top_k: int | NotGiven = NOT_GIVEN,
2157
- top_p: float | NotGiven = NOT_GIVEN,
2158
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
2159
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
2160
- tools: Iterable[ToolUnionParam] | NotGiven = NOT_GIVEN,
2150
+ metadata: MetadataParam | Omit = omit,
2151
+ container: Optional[str] | Omit = omit,
2152
+ service_tier: Literal["auto", "standard_only"] | Omit = omit,
2153
+ stop_sequences: SequenceNotStr[str] | Omit = omit,
2154
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
2155
+ temperature: float | Omit = omit,
2156
+ top_k: int | Omit = omit,
2157
+ top_p: float | Omit = omit,
2158
+ thinking: ThinkingConfigParam | Omit = omit,
2159
+ tool_choice: ToolChoiceParam | Omit = omit,
2160
+ tools: Iterable[ToolUnionParam] | Omit = omit,
2161
2161
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2162
2162
  # The extra values given here take precedence over values defined on the client or passed to this method.
2163
2163
  extra_headers: Headers | None = None,
@@ -2213,16 +2213,16 @@ class AsyncMessages(AsyncAPIResource):
2213
2213
  *,
2214
2214
  messages: Iterable[MessageParam],
2215
2215
  model: ModelParam,
2216
- system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
2217
- thinking: ThinkingConfigParam | NotGiven = NOT_GIVEN,
2218
- tool_choice: ToolChoiceParam | NotGiven = NOT_GIVEN,
2219
- tools: Iterable[MessageCountTokensToolParam] | NotGiven = NOT_GIVEN,
2216
+ system: Union[str, Iterable[TextBlockParam]] | Omit = omit,
2217
+ thinking: ThinkingConfigParam | Omit = omit,
2218
+ tool_choice: ToolChoiceParam | Omit = omit,
2219
+ tools: Iterable[MessageCountTokensToolParam] | Omit = omit,
2220
2220
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2221
2221
  # The extra values given here take precedence over values defined on the client or passed to this method.
2222
2222
  extra_headers: Headers | None = None,
2223
2223
  extra_query: Query | None = None,
2224
2224
  extra_body: Body | None = None,
2225
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2225
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
2226
2226
  ) -> MessageTokensCount:
2227
2227
  """
2228
2228
  Count the number of tokens in a Message.
@@ -8,7 +8,7 @@ import httpx
8
8
 
9
9
  from .. import _legacy_response
10
10
  from ..types import model_list_params
11
- from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11
+ from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
12
12
  from .._utils import is_given, maybe_transform, strip_not_given
13
13
  from .._compat import cached_property
14
14
  from .._resource import SyncAPIResource, AsyncAPIResource
@@ -45,13 +45,13 @@ class Models(SyncAPIResource):
45
45
  self,
46
46
  model_id: str,
47
47
  *,
48
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
48
+ betas: List[AnthropicBetaParam] | Omit = omit,
49
49
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
50
50
  # The extra values given here take precedence over values defined on the client or passed to this method.
51
51
  extra_headers: Headers | None = None,
52
52
  extra_query: Query | None = None,
53
53
  extra_body: Body | None = None,
54
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
54
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
55
55
  ) -> ModelInfo:
56
56
  """
57
57
  Get a specific model.
@@ -75,7 +75,7 @@ class Models(SyncAPIResource):
75
75
  if not model_id:
76
76
  raise ValueError(f"Expected a non-empty value for `model_id` but received {model_id!r}")
77
77
  extra_headers = {
78
- **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
78
+ **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else omit}),
79
79
  **(extra_headers or {}),
80
80
  }
81
81
  return self._get(
@@ -89,16 +89,16 @@ class Models(SyncAPIResource):
89
89
  def list(
90
90
  self,
91
91
  *,
92
- after_id: str | NotGiven = NOT_GIVEN,
93
- before_id: str | NotGiven = NOT_GIVEN,
94
- limit: int | NotGiven = NOT_GIVEN,
95
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
92
+ after_id: str | Omit = omit,
93
+ before_id: str | Omit = omit,
94
+ limit: int | Omit = omit,
95
+ betas: List[AnthropicBetaParam] | Omit = omit,
96
96
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
97
97
  # The extra values given here take precedence over values defined on the client or passed to this method.
98
98
  extra_headers: Headers | None = None,
99
99
  extra_query: Query | None = None,
100
100
  extra_body: Body | None = None,
101
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
101
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
102
102
  ) -> SyncPage[ModelInfo]:
103
103
  """
104
104
  List available models.
@@ -128,7 +128,7 @@ class Models(SyncAPIResource):
128
128
  timeout: Override the client-level default timeout for this request, in seconds
129
129
  """
130
130
  extra_headers = {
131
- **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
131
+ **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else omit}),
132
132
  **(extra_headers or {}),
133
133
  }
134
134
  return self._get_api_list(
@@ -176,13 +176,13 @@ class AsyncModels(AsyncAPIResource):
176
176
  self,
177
177
  model_id: str,
178
178
  *,
179
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
179
+ betas: List[AnthropicBetaParam] | Omit = omit,
180
180
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
181
181
  # The extra values given here take precedence over values defined on the client or passed to this method.
182
182
  extra_headers: Headers | None = None,
183
183
  extra_query: Query | None = None,
184
184
  extra_body: Body | None = None,
185
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
185
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
186
186
  ) -> ModelInfo:
187
187
  """
188
188
  Get a specific model.
@@ -206,7 +206,7 @@ class AsyncModels(AsyncAPIResource):
206
206
  if not model_id:
207
207
  raise ValueError(f"Expected a non-empty value for `model_id` but received {model_id!r}")
208
208
  extra_headers = {
209
- **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
209
+ **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else omit}),
210
210
  **(extra_headers or {}),
211
211
  }
212
212
  return await self._get(
@@ -220,16 +220,16 @@ class AsyncModels(AsyncAPIResource):
220
220
  def list(
221
221
  self,
222
222
  *,
223
- after_id: str | NotGiven = NOT_GIVEN,
224
- before_id: str | NotGiven = NOT_GIVEN,
225
- limit: int | NotGiven = NOT_GIVEN,
226
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
223
+ after_id: str | Omit = omit,
224
+ before_id: str | Omit = omit,
225
+ limit: int | Omit = omit,
226
+ betas: List[AnthropicBetaParam] | Omit = omit,
227
227
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
228
228
  # The extra values given here take precedence over values defined on the client or passed to this method.
229
229
  extra_headers: Headers | None = None,
230
230
  extra_query: Query | None = None,
231
231
  extra_body: Body | None = None,
232
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
232
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
233
233
  ) -> AsyncPaginator[ModelInfo, AsyncPage[ModelInfo]]:
234
234
  """
235
235
  List available models.
@@ -259,7 +259,7 @@ class AsyncModels(AsyncAPIResource):
259
259
  timeout: Override the client-level default timeout for this request, in seconds
260
260
  """
261
261
  extra_headers = {
262
- **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
262
+ **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else omit}),
263
263
  **(extra_headers or {}),
264
264
  }
265
265
  return self._get_api_list(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: anthropic
3
- Version: 0.68.0
3
+ Version: 0.68.1
4
4
  Summary: The official Python library for the anthropic API
5
5
  Project-URL: Homepage, https://github.com/anthropics/anthropic-sdk-python
6
6
  Project-URL: Repository, https://github.com/anthropics/anthropic-sdk-python
@@ -1,18 +1,18 @@
1
- anthropic/__init__.py,sha256=6JJg_MfwoX2NEIS05VHtFvK6O5obE1HllHeRfel6DB0,2935
2
- anthropic/_base_client.py,sha256=VdxbcECVlP8hn1oS4vFBrU87W0a1iEw0eq0NpX8Q7mI,72849
3
- anthropic/_client.py,sha256=kZlulmKAcSG7WdzYCUdXFFfATn5ZP1PO7gHQbqAe2Dc,22827
1
+ anthropic/__init__.py,sha256=sPNLvrXJGDKWSF87xPj6CidUbcMD4sAVIzip4BeEP7g,2981
2
+ anthropic/_base_client.py,sha256=wzBPPq1xjyx7okxIAAaNuKmrP-1w6v20girS-VrgT3U,72849
3
+ anthropic/_client.py,sha256=M90bE_o_HRuBNrbA-D-grLZua841_5NTkzeUQpyE75Y,22812
4
4
  anthropic/_compat.py,sha256=DQBVORjFb33zch24jzkhM14msvnzY7mmSmgDLaVFUM8,6562
5
5
  anthropic/_constants.py,sha256=wADeUqY3lsseF0L6jIen-PexfQ06FOtf2dVESXDM828,885
6
6
  anthropic/_exceptions.py,sha256=bkSqVWxtRdRb31H7MIvtxfh5mo_Xf7Ib3nPTOmAOmGs,4073
7
7
  anthropic/_files.py,sha256=_Ux6v6nAsxK4e_4efdt1DiIOZ0hGmlR2ZKKcVfJIfGU,3623
8
8
  anthropic/_legacy_response.py,sha256=QsroQ_9LHI8tSoPEvbIXXB44SvLJXaXQX7khjZpnqfE,17235
9
9
  anthropic/_models.py,sha256=wUXeougIoFGSKQr_XIcmamSHeupO6R7ZaQnFZC-hEl8,31957
10
- anthropic/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
+ anthropic/_qs.py,sha256=craIKyvPktJ94cvf9zn8j8ekG9dWJzhWv0ob34lIOv4,4828
11
11
  anthropic/_resource.py,sha256=FYEOzfhB-XWTR2gyTmQuuFoecRiVXxe_SpjZlQQGytU,1080
12
12
  anthropic/_response.py,sha256=1Y7-OrGn1lOwvZ_SmMlwT9Nb2i9A1RYw2Q4-F1cwPSU,30542
13
13
  anthropic/_streaming.py,sha256=vn8K5KgfO3Bv9NE8nwHIQEjEhkQeVE6YMnGqiJlCgqE,14023
14
- anthropic/_types.py,sha256=PwAzwWTKp9b08FTllhWjQPX_-8CLXWh6U-9atpUYHxg,7398
15
- anthropic/_version.py,sha256=XBCqVoiIx9RiTN5BgCAlMHcs9_p4oh39-eXsN2hTYCw,162
14
+ anthropic/_types.py,sha256=vEab5B5Hp7xQQafVrgSCHeEPUmf74jofqIPo-n7Xljk,7338
15
+ anthropic/_version.py,sha256=0fgfbW913KLaE-QLjNQXti1MwTZuIKGfSxC_oNpho-E,162
16
16
  anthropic/pagination.py,sha256=hW6DOtNbwwQrNQ8wn4PJj7WB2y_37szSDQeUBnunQ40,2202
17
17
  anthropic/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  anthropic/_decoders/jsonl.py,sha256=KDLw-Frjo7gRup5qDp_BWkXIZ-mFZU5vFDz0WBhEKcs,3510
@@ -26,9 +26,9 @@ anthropic/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmE
26
26
  anthropic/_utils/_resources_proxy.py,sha256=Y6WaTfDzBlt-GXVlTQLlIjpkSZZ8fRlMzXuRBh64CrA,604
27
27
  anthropic/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
28
28
  anthropic/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
29
- anthropic/_utils/_transform.py,sha256=i_U4R82RtQJtKKCriwFqmfcWjtwmmsiiF1AEXKQ_OPo,15957
29
+ anthropic/_utils/_transform.py,sha256=NjCzmnfqYrsAikUHQig6N9QfuTVbKipuP3ur9mcNF-E,15951
30
30
  anthropic/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,4786
31
- anthropic/_utils/_utils.py,sha256=D2QE7mVPNEJzaB50u8rvDQAUDS5jx7JoeFD7zdj-TeI,12231
31
+ anthropic/_utils/_utils.py,sha256=0dDqauUbVZEXV0NVl7Bwu904Wwo5eyFCZpQThhFNhyA,12253
32
32
  anthropic/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
33
33
  anthropic/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  anthropic/lib/_extras/__init__.py,sha256=a9HX69-V9nROM4Em9a4y-xZTgiLE2jdlCyC6ZKtxfyY,53
@@ -48,25 +48,25 @@ anthropic/lib/streaming/_messages.py,sha256=OSV9sjb8MLThSywEFXQV9OchcNXAE2KxDacV
48
48
  anthropic/lib/streaming/_types.py,sha256=CrR4948IWgUF7L9O0ase2QwbpiQ1JeiYXrRyVi74-Bw,2086
49
49
  anthropic/lib/tools/__init__.py,sha256=ui3gBw2-vQsl_4pKjf3O5kfUYpGATjQ6H4MPLopy0h4,525
50
50
  anthropic/lib/tools/_beta_functions.py,sha256=eje6jXzDZa0azRevFF6TP_YQBo7FX3DvY4wRT5nUv7c,9738
51
- anthropic/lib/tools/_beta_runner.py,sha256=Lcf1bltqrLXj6niPqPaFYCaFFRWKqRHbfINtbCAqjvY,15470
51
+ anthropic/lib/tools/_beta_runner.py,sha256=rwmV1mU2I1riTexNTZj0GWR13Sam7n486W1K1fu4SIU,15469
52
52
  anthropic/lib/vertex/__init__.py,sha256=A8vuK1qVPtmKr1_LQgPuDRVA6I4xm_ye2aPdAa4yGsI,102
53
53
  anthropic/lib/vertex/_auth.py,sha256=Kyt_hbUc-DPlkvds4__OLR8FLPpoDas6bXhZTECxO3Y,1644
54
54
  anthropic/lib/vertex/_beta.py,sha256=8kXsUUIGstf6dZfiZtm6s9OWEueuSgra8dPvkaUacy4,3323
55
55
  anthropic/lib/vertex/_beta_messages.py,sha256=4fsV2F6TzB14DuHLo9k8i95vymcbixIPjsplqpsHfac,3399
56
56
  anthropic/lib/vertex/_client.py,sha256=bvemByz7HdwDIHMojcvBUN7khsI32jFglgtRVDH5o04,16619
57
57
  anthropic/resources/__init__.py,sha256=H0t_V-A_u6bIVmbAUpY9ZfgqoNIjIfyNpZz7hAiErIA,1583
58
- anthropic/resources/completions.py,sha256=dYTC5eGoyqrIjpgcVhqP6xeari-yc_RHiZyylXEI9a8,37228
59
- anthropic/resources/models.py,sha256=4iV-zSkb_b1iICRW9Lc-pEhZkpSANn5CS_q2Kmp3xws,12480
58
+ anthropic/resources/completions.py,sha256=Xw-Aj6j4U3NyxJV473MRLB1gzAntk3Xqh9wIeHINhso,36762
59
+ anthropic/resources/models.py,sha256=sbthUsNykm-pYNMd33UIZynr6uWPYZ_3THQPKtcsNDc,12382
60
60
  anthropic/resources/beta/__init__.py,sha256=uP3kAv-GGcjuPJ6F9QM3a6g7vIiugm-iPecFTQdQUlg,1505
61
61
  anthropic/resources/beta/beta.py,sha256=UDgDxryFjxRx_amzcRdZBo9fWunU4EHfZnKF6FTe2Bs,5123
62
- anthropic/resources/beta/files.py,sha256=q4V7iBnUDflYrG31oNPqY9ycXTF5oryMMBmrR7il8Ag,26911
63
- anthropic/resources/beta/models.py,sha256=OsXRcsEHoNuj1VjhbFLeOYgE35DnUO8m4hTPF6zcs0Q,12594
62
+ anthropic/resources/beta/files.py,sha256=KFFbXv02zGFMwPBHylFv7KHia-mt7RtyWWA7Wz-WPWM,26729
63
+ anthropic/resources/beta/models.py,sha256=92G3TLMCnnZ0RCnYb_uT5ld4BDV0mjsoLx8xwKCR4Wk,12496
64
64
  anthropic/resources/beta/messages/__init__.py,sha256=7ZO4hB7hPBhXQja7gMzkwLXQVDlyap4JsihpA0UKZjk,849
65
- anthropic/resources/beta/messages/batches.py,sha256=6sbFpFCCRC-qN37-5n7lO3BzGXKGVaXhPv9y7Daj0-0,35990
66
- anthropic/resources/beta/messages/messages.py,sha256=lgtY2_Pvgca5IXEYz3OhwSB7GPnnwCsv5Cbe38m_dSQ,133367
65
+ anthropic/resources/beta/messages/batches.py,sha256=fGsOtwj_CGciO88R-6PALZB7xbbmDLzpQe0bcgjbeho,35780
66
+ anthropic/resources/beta/messages/messages.py,sha256=jgC0TPwCDqGpb028DAzQN7EEU0XfW7x-Ck7MJtKpEO4,131067
67
67
  anthropic/resources/messages/__init__.py,sha256=iOSBh4D7NTXqe7RNhw9HZCiFmJvDfIgVFnjaF7r27YU,897
68
- anthropic/resources/messages/batches.py,sha256=w_bNgg_NV4rFQkDeixJtRokimPIT3OVpimr8D8_7v5Y,28590
69
- anthropic/resources/messages/messages.py,sha256=PBhZL3iuG-A0WhNcawR3pRtgL8fR8qSmAYsx48Mksi8,109831
68
+ anthropic/resources/messages/batches.py,sha256=oTuHN8jUqwJYbUybLiuHG6wFItO0jlwLWyxZeRLGr0Y,28548
69
+ anthropic/resources/messages/messages.py,sha256=cQJUX9hEocYIFyJaGBXnFnTBsZLu0q1MnwR6FC6Qtm4,108828
70
70
  anthropic/types/__init__.py,sha256=H56hkiGRNPgQE1PANpHed0ns8nMqJGVqLmM7gVWLRWg,9458
71
71
  anthropic/types/anthropic_beta_param.py,sha256=UyV6amEHP5EhVAxA_viLrdpX0YclbZtakiak-7XSayc,848
72
72
  anthropic/types/base64_image_source_param.py,sha256=4djZ4GfXcL2khwcg8KpUdZILKmmzHro5YFXTdkhSqpw,725
@@ -365,7 +365,7 @@ anthropic/types/shared/not_found_error.py,sha256=R6OsCvAmsf_SB2TwoX6E63o049qZMaA
365
365
  anthropic/types/shared/overloaded_error.py,sha256=PlyhHt3wmzcnynSfkWbfP4XkLoWsPa9B39V3CyAdgx8,282
366
366
  anthropic/types/shared/permission_error.py,sha256=nuyxtLXOiEkYEbFRXiAWjxU6XtdyjkAaXQ2NgMB3pjw,282
367
367
  anthropic/types/shared/rate_limit_error.py,sha256=eYULATjXa6KKdqeBauest7RzuN-bhGsY5BWwH9eYv4c,280
368
- anthropic-0.68.0.dist-info/METADATA,sha256=v27Ud_PHScKrCxi_FuUQLPA98LOh21l1vzQxP50CEgQ,28528
369
- anthropic-0.68.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
370
- anthropic-0.68.0.dist-info/licenses/LICENSE,sha256=i_lphP-Lz65-SMrnalKeiiUxe6ngKr9_08xk_flWV6Y,1056
371
- anthropic-0.68.0.dist-info/RECORD,,
368
+ anthropic-0.68.1.dist-info/METADATA,sha256=NOMgG5KNYdGfuFxHFAsdohFAr05Ihn7oLJWyPn2eaRI,28528
369
+ anthropic-0.68.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
370
+ anthropic-0.68.1.dist-info/licenses/LICENSE,sha256=i_lphP-Lz65-SMrnalKeiiUxe6ngKr9_08xk_flWV6Y,1056
371
+ anthropic-0.68.1.dist-info/RECORD,,