anthropic 0.68.0__py3-none-any.whl → 0.68.2__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.
@@ -8,7 +8,7 @@ from itertools import chain
8
8
  import httpx
9
9
 
10
10
  from .... import _legacy_response
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, async_maybe_transform
13
13
  from ...._compat import cached_property
14
14
  from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -50,13 +50,13 @@ class Batches(SyncAPIResource):
50
50
  self,
51
51
  *,
52
52
  requests: Iterable[batch_create_params.Request],
53
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
53
+ betas: List[AnthropicBetaParam] | Omit = omit,
54
54
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
55
55
  # The extra values given here take precedence over values defined on the client or passed to this method.
56
56
  extra_headers: Headers | None = None,
57
57
  extra_query: Query | None = None,
58
58
  extra_body: Body | None = None,
59
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
59
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
60
60
  ) -> BetaMessageBatch:
61
61
  """
62
62
  Send a batch of Message creation requests.
@@ -87,7 +87,7 @@ class Batches(SyncAPIResource):
87
87
  {
88
88
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
89
89
  if is_given(betas)
90
- else NOT_GIVEN
90
+ else not_given
91
91
  }
92
92
  ),
93
93
  **(extra_headers or {}),
@@ -106,13 +106,13 @@ class Batches(SyncAPIResource):
106
106
  self,
107
107
  message_batch_id: str,
108
108
  *,
109
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
109
+ betas: List[AnthropicBetaParam] | Omit = omit,
110
110
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
111
111
  # The extra values given here take precedence over values defined on the client or passed to this method.
112
112
  extra_headers: Headers | None = None,
113
113
  extra_query: Query | None = None,
114
114
  extra_body: Body | None = None,
115
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
115
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
116
116
  ) -> BetaMessageBatch:
117
117
  """This endpoint is idempotent and can be used to poll for Message Batch
118
118
  completion.
@@ -143,7 +143,7 @@ class Batches(SyncAPIResource):
143
143
  {
144
144
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
145
145
  if is_given(betas)
146
- else NOT_GIVEN
146
+ else not_given
147
147
  }
148
148
  ),
149
149
  **(extra_headers or {}),
@@ -160,16 +160,16 @@ class Batches(SyncAPIResource):
160
160
  def list(
161
161
  self,
162
162
  *,
163
- after_id: str | NotGiven = NOT_GIVEN,
164
- before_id: str | NotGiven = NOT_GIVEN,
165
- limit: int | NotGiven = NOT_GIVEN,
166
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
163
+ after_id: str | Omit = omit,
164
+ before_id: str | Omit = omit,
165
+ limit: int | Omit = omit,
166
+ betas: List[AnthropicBetaParam] | Omit = omit,
167
167
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
168
168
  # The extra values given here take precedence over values defined on the client or passed to this method.
169
169
  extra_headers: Headers | None = None,
170
170
  extra_query: Query | None = None,
171
171
  extra_body: Body | None = None,
172
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
172
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
173
173
  ) -> SyncPage[BetaMessageBatch]:
174
174
  """List all Message Batches within a Workspace.
175
175
 
@@ -205,7 +205,7 @@ class Batches(SyncAPIResource):
205
205
  {
206
206
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
207
207
  if is_given(betas)
208
- else NOT_GIVEN
208
+ else not_given
209
209
  }
210
210
  ),
211
211
  **(extra_headers or {}),
@@ -235,13 +235,13 @@ class Batches(SyncAPIResource):
235
235
  self,
236
236
  message_batch_id: str,
237
237
  *,
238
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
238
+ betas: List[AnthropicBetaParam] | Omit = omit,
239
239
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
240
240
  # The extra values given here take precedence over values defined on the client or passed to this method.
241
241
  extra_headers: Headers | None = None,
242
242
  extra_query: Query | None = None,
243
243
  extra_body: Body | None = None,
244
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
244
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
245
245
  ) -> BetaDeletedMessageBatch:
246
246
  """
247
247
  Delete a Message Batch.
@@ -272,7 +272,7 @@ class Batches(SyncAPIResource):
272
272
  {
273
273
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
274
274
  if is_given(betas)
275
- else NOT_GIVEN
275
+ else not_given
276
276
  }
277
277
  ),
278
278
  **(extra_headers or {}),
@@ -290,13 +290,13 @@ class Batches(SyncAPIResource):
290
290
  self,
291
291
  message_batch_id: str,
292
292
  *,
293
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
293
+ betas: List[AnthropicBetaParam] | Omit = omit,
294
294
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
295
295
  # The extra values given here take precedence over values defined on the client or passed to this method.
296
296
  extra_headers: Headers | None = None,
297
297
  extra_query: Query | None = None,
298
298
  extra_body: Body | None = None,
299
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
299
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
300
300
  ) -> BetaMessageBatch:
301
301
  """Batches may be canceled any time before processing ends.
302
302
 
@@ -333,7 +333,7 @@ class Batches(SyncAPIResource):
333
333
  {
334
334
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
335
335
  if is_given(betas)
336
- else NOT_GIVEN
336
+ else not_given
337
337
  }
338
338
  ),
339
339
  **(extra_headers or {}),
@@ -351,13 +351,13 @@ class Batches(SyncAPIResource):
351
351
  self,
352
352
  message_batch_id: str,
353
353
  *,
354
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
354
+ betas: List[AnthropicBetaParam] | Omit = omit,
355
355
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
356
356
  # The extra values given here take precedence over values defined on the client or passed to this method.
357
357
  extra_headers: Headers | None = None,
358
358
  extra_query: Query | None = None,
359
359
  extra_body: Body | None = None,
360
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
360
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
361
361
  ) -> JSONLDecoder[BetaMessageBatchIndividualResponse]:
362
362
  """
363
363
  Streams the results of a Message Batch as a `.jsonl` file.
@@ -397,7 +397,7 @@ class Batches(SyncAPIResource):
397
397
  {
398
398
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
399
399
  if is_given(betas)
400
- else NOT_GIVEN
400
+ else not_given
401
401
  }
402
402
  ),
403
403
  **(extra_headers or {}),
@@ -437,13 +437,13 @@ class AsyncBatches(AsyncAPIResource):
437
437
  self,
438
438
  *,
439
439
  requests: Iterable[batch_create_params.Request],
440
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
440
+ betas: List[AnthropicBetaParam] | Omit = omit,
441
441
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
442
442
  # The extra values given here take precedence over values defined on the client or passed to this method.
443
443
  extra_headers: Headers | None = None,
444
444
  extra_query: Query | None = None,
445
445
  extra_body: Body | None = None,
446
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
446
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
447
447
  ) -> BetaMessageBatch:
448
448
  """
449
449
  Send a batch of Message creation requests.
@@ -474,7 +474,7 @@ class AsyncBatches(AsyncAPIResource):
474
474
  {
475
475
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
476
476
  if is_given(betas)
477
- else NOT_GIVEN
477
+ else not_given
478
478
  }
479
479
  ),
480
480
  **(extra_headers or {}),
@@ -493,13 +493,13 @@ class AsyncBatches(AsyncAPIResource):
493
493
  self,
494
494
  message_batch_id: str,
495
495
  *,
496
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
496
+ betas: List[AnthropicBetaParam] | Omit = omit,
497
497
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
498
498
  # The extra values given here take precedence over values defined on the client or passed to this method.
499
499
  extra_headers: Headers | None = None,
500
500
  extra_query: Query | None = None,
501
501
  extra_body: Body | None = None,
502
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
502
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
503
503
  ) -> BetaMessageBatch:
504
504
  """This endpoint is idempotent and can be used to poll for Message Batch
505
505
  completion.
@@ -530,7 +530,7 @@ class AsyncBatches(AsyncAPIResource):
530
530
  {
531
531
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
532
532
  if is_given(betas)
533
- else NOT_GIVEN
533
+ else not_given
534
534
  }
535
535
  ),
536
536
  **(extra_headers or {}),
@@ -547,16 +547,16 @@ class AsyncBatches(AsyncAPIResource):
547
547
  def list(
548
548
  self,
549
549
  *,
550
- after_id: str | NotGiven = NOT_GIVEN,
551
- before_id: str | NotGiven = NOT_GIVEN,
552
- limit: int | NotGiven = NOT_GIVEN,
553
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
550
+ after_id: str | Omit = omit,
551
+ before_id: str | Omit = omit,
552
+ limit: int | Omit = omit,
553
+ betas: List[AnthropicBetaParam] | Omit = omit,
554
554
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
555
555
  # The extra values given here take precedence over values defined on the client or passed to this method.
556
556
  extra_headers: Headers | None = None,
557
557
  extra_query: Query | None = None,
558
558
  extra_body: Body | None = None,
559
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
559
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
560
560
  ) -> AsyncPaginator[BetaMessageBatch, AsyncPage[BetaMessageBatch]]:
561
561
  """List all Message Batches within a Workspace.
562
562
 
@@ -592,7 +592,7 @@ class AsyncBatches(AsyncAPIResource):
592
592
  {
593
593
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
594
594
  if is_given(betas)
595
- else NOT_GIVEN
595
+ else not_given
596
596
  }
597
597
  ),
598
598
  **(extra_headers or {}),
@@ -622,13 +622,13 @@ class AsyncBatches(AsyncAPIResource):
622
622
  self,
623
623
  message_batch_id: str,
624
624
  *,
625
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
625
+ betas: List[AnthropicBetaParam] | Omit = omit,
626
626
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
627
627
  # The extra values given here take precedence over values defined on the client or passed to this method.
628
628
  extra_headers: Headers | None = None,
629
629
  extra_query: Query | None = None,
630
630
  extra_body: Body | None = None,
631
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
631
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
632
632
  ) -> BetaDeletedMessageBatch:
633
633
  """
634
634
  Delete a Message Batch.
@@ -659,7 +659,7 @@ class AsyncBatches(AsyncAPIResource):
659
659
  {
660
660
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
661
661
  if is_given(betas)
662
- else NOT_GIVEN
662
+ else not_given
663
663
  }
664
664
  ),
665
665
  **(extra_headers or {}),
@@ -677,13 +677,13 @@ class AsyncBatches(AsyncAPIResource):
677
677
  self,
678
678
  message_batch_id: str,
679
679
  *,
680
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
680
+ betas: List[AnthropicBetaParam] | Omit = omit,
681
681
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
682
682
  # The extra values given here take precedence over values defined on the client or passed to this method.
683
683
  extra_headers: Headers | None = None,
684
684
  extra_query: Query | None = None,
685
685
  extra_body: Body | None = None,
686
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
686
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
687
687
  ) -> BetaMessageBatch:
688
688
  """Batches may be canceled any time before processing ends.
689
689
 
@@ -720,7 +720,7 @@ class AsyncBatches(AsyncAPIResource):
720
720
  {
721
721
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
722
722
  if is_given(betas)
723
- else NOT_GIVEN
723
+ else not_given
724
724
  }
725
725
  ),
726
726
  **(extra_headers or {}),
@@ -738,13 +738,13 @@ class AsyncBatches(AsyncAPIResource):
738
738
  self,
739
739
  message_batch_id: str,
740
740
  *,
741
- betas: List[AnthropicBetaParam] | NotGiven = NOT_GIVEN,
741
+ betas: List[AnthropicBetaParam] | Omit = omit,
742
742
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
743
743
  # The extra values given here take precedence over values defined on the client or passed to this method.
744
744
  extra_headers: Headers | None = None,
745
745
  extra_query: Query | None = None,
746
746
  extra_body: Body | None = None,
747
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
747
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
748
748
  ) -> AsyncJSONLDecoder[BetaMessageBatchIndividualResponse]:
749
749
  """
750
750
  Streams the results of a Message Batch as a `.jsonl` file.
@@ -784,7 +784,7 @@ class AsyncBatches(AsyncAPIResource):
784
784
  {
785
785
  "anthropic-beta": ",".join(chain((str(e) for e in betas), ["message-batches-2024-09-24"]))
786
786
  if is_given(betas)
787
- else NOT_GIVEN
787
+ else not_given
788
788
  }
789
789
  ),
790
790
  **(extra_headers or {}),