
    ̺i                       S SK Jr  S SKJrJr  S SKJr  S SKrSSKJ	r	  SSK
JrJrJrJrJrJrJr  SSKJrJrJrJr  SS	KJr  SS
KJrJr  SSKJrJr  SSKJ r J!r!  SSK"J#r#  SSK$J%r%J&r&  SSK'J(r(J)r)  SSK*J+r+J,r,  SSK-J.r.  SSK/J0r0  SSK1J2r2  SSK3J4r4  SS/r5 " S S\5      r6 " S S\5      r7 " S S5      r8 " S S5      r9 " S S5      r: " S S 5      r;g)!    )annotations)ListIterable)chainN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)is_givenmaybe_transformstrip_not_givenasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPage	AsyncPage)AnthropicError)AsyncPaginatormake_request_options)JSONLDecoderAsyncJSONLDecoder)batch_list_paramsbatch_create_params)AnthropicBetaParam)BetaMessageBatch)BetaDeletedMessageBatch)"BetaMessageBatchIndividualResponseBatchesAsyncBatchesc            	         \ rS rSr\SS j5       r\SS j5       r\SSS\S.             SS jjr	\SSS\S.             SS jjr
\\\\SSS\S.                 SS	 jjr\SSS\S.             SS
 jjr\SSS\S.             SS jjr\SSS\S.             SS jjrSrg)r&      c                    [        U 5      $ z
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
)BatchesWithRawResponseselfs    h/var/www/piano.thomer.com/venv/lib/python3.13/site-packages/anthropic/resources/beta/messages/batches.pywith_raw_responseBatches.with_raw_response   s     &d++    c                    [        U 5      $ z
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
)BatchesWithStreamingResponser-   s    r/   with_streaming_responseBatches.with_streaming_response(   s     ,D11r2   Nbetasextra_headersextra_query
extra_bodytimeoutc               2   0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  S[        SU0[        R                  5      [        X4XVS9[        S9$ )	(  
Send a batch of Message creation requests.

The Message Batches API can be used to process multiple Messages API requests at
once. Once a Message Batch is created, it begins processing immediately. Batches
can take up to 24 hours to complete.

Learn more about the Message Batches API in our
[user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)

Args:
  requests: List of requests for prompt completion. Each is an individual request to create
      a Message.

  betas: Optional header to specify the beta version(s) you want to use.

  extra_headers: Send extra headers

  extra_query: Add additional query parameters to the request

  extra_body: Add additional JSON properties to the request

  timeout: Override the client-level default timeout for this request, in seconds
anthropic-beta,c              3  8   #    U  H  n[        U5      v   M     g 7fNstr.0es     r/   	<genexpr>!Batches.create.<locals>.<genexpr>X        5Lec!ffe   message-batches-2024-09-24/v1/messages/batches?beta=truerequestsr:   r;   r<   r=   bodyoptionscast_to)r   r   joinr   r   _postr   r!   BatchCreateParamsr   r#   r.   rO   r9   r:   r;   r<   r=   s          r/   createBatches.create1   s    H	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_azz, *h!79L9^9^_(+Q[ %  
 	
r2   c          
     0   U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  SU S3[        X4XVS9[        S	9$ )
  This endpoint is idempotent and can be used to poll for Message Batch
completion.

To access the results of a Message Batch, make a request to the
`results_url` field in the response.

Learn more about the Message Batches API in our
[user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)

Args:
  message_batch_id: ID of the Message Batch.

  betas: Optional header to specify the beta version(s) you want to use.

  extra_headers: Send extra headers

  extra_query: Add additional query parameters to the request

  extra_body: Add additional JSON properties to the request

  timeout: Override the client-level default timeout for this request, in seconds
?Expected a non-empty value for `message_batch_id` but received r@   rA   c              3  8   #    U  H  n[        U5      v   M     g 7frC   rD   rF   s     r/   rI   #Batches.retrieve.<locals>.<genexpr>   rK   rL   rM   /v1/messages/batches/
?beta=truerP   rS   rT   	
ValueErrorr   r   rU   r   r   _getr   r#   r.   message_batch_idr9   r:   r;   r<   r=   s          r/   retrieveBatches.retrievei   s    D  ^_o^rstt	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_ayy#$4#5Z@(+Q[ %  
 	
r2   after_id	before_idlimitr9   r:   r;   r<   r=   c               R   0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  S[        [           [        UUUU[        UUUS.[        R                  5      S9[        S9$ )	  List all Message Batches within a Workspace.

Most recently created batches are
returned first.

Learn more about the Message Batches API in our
[user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)

Args:
  after_id: ID of the object to use as a cursor for pagination. When provided, returns the
      page of results immediately after this object.

  before_id: ID of the object to use as a cursor for pagination. When provided, returns the
      page of results immediately before this object.

  limit: Number of items to return per page.

      Defaults to `20`. Ranges from `1` to `1000`.

  betas: Optional header to specify the beta version(s) you want to use.

  extra_headers: Send extra headers

  extra_query: Add additional query parameters to the request

  extra_body: Add additional JSON properties to the request

  timeout: Override the client-level default timeout for this request, in seconds
r@   rA   c              3  8   #    U  H  n[        U5      v   M     g 7frC   rD   rF   s     r/   rI   Batches.list.<locals>.<genexpr>   rK   rL   rM   rN   rk   rl   rm   r:   r;   r<   r=   querypagerS   model)r   r   rU   r   r   _get_api_listr   r#   r   r   r    BatchListParams	r.   rk   rl   rm   r9   r:   r;   r<   r=   s	            r/   listBatches.list   s    V	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_a!!,*+(+'%%$,%.!&
 &55 ## " 
 	
r2   c          
     0   U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  SU S3[        X4XVS9[        S	9$ )
  
Delete a Message Batch.

Message Batches can only be deleted once they've finished processing. If you'd
like to delete an in-progress batch, you must first cancel it.

Learn more about the Message Batches API in our
[user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)

Args:
  message_batch_id: ID of the Message Batch.

  betas: Optional header to specify the beta version(s) you want to use.

  extra_headers: Send extra headers

  extra_query: Add additional query parameters to the request

  extra_body: Add additional JSON properties to the request

  timeout: Override the client-level default timeout for this request, in seconds
r]   r@   rA   c              3  8   #    U  H  n[        U5      v   M     g 7frC   rD   rF   s     r/   rI   !Batches.delete.<locals>.<genexpr>  rK   rL   rM   r`   ra   rP   rb   	rd   r   r   rU   r   r   _deleter   r$   rf   s          r/   deleteBatches.delete   s    D  ^_o^rstt	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_a||#$4#5Z@(+Q[ ,  
 	
r2   c          
     0   U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  SU S3[        X4XVS9[        S	9$ )
  Batches may be canceled any time before processing ends.

Once cancellation is
initiated, the batch enters a `canceling` state, at which time the system may
complete any in-progress, non-interruptible requests before finalizing
cancellation.

The number of canceled requests is specified in `request_counts`. To determine
which requests were canceled, check the individual results within the batch.
Note that cancellation may not result in any canceled requests if they were
non-interruptible.

Learn more about the Message Batches API in our
[user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)

Args:
  message_batch_id: ID of the Message Batch.

  betas: Optional header to specify the beta version(s) you want to use.

  extra_headers: Send extra headers

  extra_query: Add additional query parameters to the request

  extra_body: Add additional JSON properties to the request

  timeout: Override the client-level default timeout for this request, in seconds
r]   r@   rA   c              3  8   #    U  H  n[        U5      v   M     g 7frC   rD   rF   s     r/   rI   !Batches.cancel.<locals>.<genexpr>N  rK   rL   rM   r`   /cancel?beta=truerP   rb   	rd   r   r   rU   r   r   rV   r   r#   rf   s          r/   cancelBatches.cancel!  s    P  ^_o^rstt	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_azz#$4#55FG(+Q[ %  
 	
r2   c          
        U(       d  [        SU< 35      eU R                  US9nUR                  (       d  [        SUR                   35      eSS0U=(       d    0 En0 [        S[        U5      (       a#  SR                  [        S U 5       S	/5      5      O[        05      EU=(       d    0 EnSS	0U=(       d    0 EnU R                  UR                  [        X4XVS
9[        [           SS9$ )  
Streams the results of a Message Batch as a `.jsonl` file.

Each line in the file is a JSON object containing the result of a single request
in the Message Batch. Results are not guaranteed to be in the same order as
requests. Use the `custom_id` field to match results to requests.

Learn more about the Message Batches API in our
[user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)

Args:
  message_batch_id: ID of the Message Batch.

  betas: Optional header to specify the beta version(s) you want to use.

  extra_headers: Send extra headers

  extra_query: Add additional query parameters to the request

  extra_body: Add additional JSON properties to the request

  timeout: Override the client-level default timeout for this request, in seconds
r]   rg   BNo `results_url` for the given batch; Has it finished processing? Acceptapplication/binaryr@   rA   c              3  8   #    U  H  n[        U5      v   M     g 7frC   rD   rF   s     r/   rI   "Batches.results.<locals>.<genexpr>  rK   rL   rM   rP   TrS   rT   stream)rd   rh   results_urlr   processing_statusr   r   rU   r   r   re   r   r   r%   r.   rg   r9   r:   r;   r<   r=   batchs           r/   resultsBatches.results^  s   F  ^_o^rstt/?@   TUZUlUlTmn  "#7QM<ORQ	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_ayy(+Q[ !!CD  
 	
r2    )returnr,   )r   r5   rO   z%Iterable[batch_create_params.Request]r9   List[AnthropicBetaParam] | Omitr:   Headers | Noner;   Query | Noner<   Body | Noner=   'float | httpx.Timeout | None | NotGivenr   r#   rg   rE   r9   r   r:   r   r;   r   r<   r   r=   r   r   r#   )rk   
str | Omitrl   r   rm   
int | Omitr9   r   r:   r   r;   r   r<   r   r=   r   r   zSyncPage[BetaMessageBatch]rg   rE   r9   r   r:   r   r;   r   r<   r   r=   r   r   r$   )rg   rE   r9   r   r:   r   r;   r   r<   r   r=   r   r   z0JSONLDecoder[BetaMessageBatchIndividualResponse]__name__
__module____qualname____firstlineno__r   r0   r6   r   r   rY   rh   r{   r   r   r   __static_attributes__r   r2   r/   r&   r&      s   , , 2 2 26 )-$("&;D6
 86
 /	6
 &6
 "6
  6
 96
 
6
x 26 )-$("&;D5
5
 /	5
 &5
 "5
  5
 95
 
5
t  $ $ 15 )-$("&;DH
 H
 	H

 H
 /H
 &H
 "H
  H
 9H
 
$H
\ 26 )-$("&;D5
5
 /	5
 &5
 "5
  5
 95
 
!5
v 26 )-$("&;D;
;
 /	;
 &;
 ";
  ;
 9;
 
;
B 26 )-$("&;D?
?
 /	?
 &?
 "?
  ?
 9?
 
:?
 ?
r2   c            	         \ rS rSr\SS j5       r\SS j5       r\SSS\S.             SS jjr	\SSS\S.             SS jjr
\\\\SSS\S.                 SS	 jjr\SSS\S.             SS
 jjr\SSS\S.             SS jjr\SSS\S.             SS jjrSrg)r'   i  c                    [        U 5      $ r+   )AsyncBatchesWithRawResponser-   s    r/   r0   AsyncBatches.with_raw_response  s     +400r2   c                    [        U 5      $ r4   )!AsyncBatchesWithStreamingResponser-   s    r/   r6   $AsyncBatches.with_streaming_response  s     166r2   Nr8   c               b  #    0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  S[        SU0[        R                  5      I Sh  vN [        X4XVS9[        S	9I Sh  vN $  N N7f)
r?   r@   rA   c              3  8   #    U  H  n[        U5      v   M     g 7frC   rD   rF   s     r/   rI   &AsyncBatches.create.<locals>.<genexpr>  rK   rL   rM   rN   rO   NrP   rQ   )r   r   rU   r   r   rV   r   r!   rW   r   r#   rX   s          r/   rY   AsyncBatches.create  s     H	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_aZZ,,j(-CEXEjEjkk(+Q[ %   
 
 	
k
s$   BB/B+
B/&B-'B/-B/c          
     L  #    U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  SU S3[        X4XVS9[        S	9I S
h  vN $  N7f)r\   r]   r@   rA   c              3  8   #    U  H  n[        U5      v   M     g 7frC   rD   rF   s     r/   rI   (AsyncBatches.retrieve.<locals>.<genexpr>  rK   rL   rM   r`   ra   rP   rb   Nrc   rf   s          r/   rh   AsyncBatches.retrieve  s     D  ^_o^rstt	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_aYY#$4#5Z@(+Q[ %  
 
 	
 
   BB$B"B$rj   c               R   0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  S[        [           [        UUUU[        UUUS.[        R                  5      S9[        S9$ )	ro   r@   rA   c              3  8   #    U  H  n[        U5      v   M     g 7frC   rD   rF   s     r/   rI   $AsyncBatches.list.<locals>.<genexpr>Q  rK   rL   rM   rN   rr   rs   ru   )r   r   rU   r   r   rx   r   r#   r   r   r    ry   rz   s	            r/   r{   AsyncBatches.list#  s    V	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_a!!,+,(+'%%$,%.!&
 &55 ## " 
 	
r2   c          
     L  #    U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  SU S3[        X4XVS9[        S	9I S
h  vN $  N7f)r~   r]   r@   rA   c              3  8   #    U  H  n[        U5      v   M     g 7frC   rD   rF   s     r/   rI   &AsyncBatches.delete.<locals>.<genexpr>  rK   rL   rM   r`   ra   rP   rb   Nr   rf   s          r/   r   AsyncBatches.deletem  s     D  ^_o^rstt	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_a\\#$4#5Z@(+Q[ , " 
 
 	
 
r   c          
     L  #    U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  SU S3[        X4XVS9[        S	9I S
h  vN $  N7f)r   r]   r@   rA   c              3  8   #    U  H  n[        U5      v   M     g 7frC   rD   rF   s     r/   rI   &AsyncBatches.cancel.<locals>.<genexpr>  rK   rL   rM   r`   r   rP   rb   Nr   rf   s          r/   r   AsyncBatches.cancel  s     P  ^_o^rstt	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_aZZ#$4#55FG(+Q[ %   
 
 	
 
r   c          
     
  #    U(       d  [        SU< 35      eU R                  US9I Sh  vN nUR                  (       d  [        SUR                   35      eSS0U=(       d    0 En0 [        S[        U5      (       a#  SR                  [        S	 U 5       S
/5      5      O[        05      EU=(       d    0 EnSS
0U=(       d    0 EnU R                  UR                  [        X4XVS9[        [           SS9I Sh  vN $  N N7f)r   r]   r   Nr   r   r   r@   rA   c              3  8   #    U  H  n[        U5      v   M     g 7frC   rD   rF   s     r/   rI   'AsyncBatches.results.<locals>.<genexpr>  rK   rL   rM   rP   Tr   )rd   rh   r   r   r   r   r   rU   r   r   re   r   r   r%   r   s           r/   r   AsyncBatches.results  s,    F  ^_o^rsttmm5EmFF   TUZUlUlTmn  "#7QM<ORQ	
$ '*hhu5Le5LOkNl/m&n"	
 "	
 *+GaML_]_aYY(+Q[ &&HI  
 
 	
% G$
s"   )DC?CD:D;DDr   )r   r   )r   r   r   r   )rk   r   rl   r   rm   r   r9   r   r:   r   r;   r   r<   r   r=   r   r   z=AsyncPaginator[BetaMessageBatch, AsyncPage[BetaMessageBatch]]r   )rg   rE   r9   r   r:   r   r;   r   r<   r   r=   r   r   z5AsyncJSONLDecoder[BetaMessageBatchIndividualResponse]r   r   r2   r/   r'   r'     s   1 1 7 7 26 )-$("&;D6
 86
 /	6
 &6
 "6
  6
 96
 
6
x 26 )-$("&;D5
5
 /	5
 &5
 "5
  5
 95
 
5
t  $ $ 15 )-$("&;DH
 H
 	H

 H
 /H
 &H
 "H
  H
 9H
 
GH
\ 26 )-$("&;D5
5
 /	5
 &5
 "5
  5
 95
 
!5
v 26 )-$("&;D;
;
 /	;
 &;
 ";
  ;
 9;
 
;
B 26 )-$("&;D?
?
 /	?
 &?
 "?
  ?
 9?
 
??
 ?
r2   c                      \ rS rSrSS jrSrg)r,   i#  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g rC   )	_batchesr   to_raw_response_wrapperrY   rh   r{   r   r   r   r.   batchess     r/   __init__BatchesWithRawResponse.__init__$  s    &>>NN
 )@@
 %<<LL
	 '>>NN
 '>>NN
 (??OO
r2   r   r   rY   r   r{   r   rh   Nr   r&   r   Noner   r   r   r   r   r   r   r2   r/   r,   r,   #      
r2   r,   c                      \ rS rSrSS jrSrg)r   i;  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g rC   )	r   r   async_to_raw_response_wrapperrY   rh   r{   r   r   r   r   s     r/   r   $AsyncBatchesWithRawResponse.__init__<  s    &DDNN
 )FF
 %BBLL
	 'DDNN
 'DDNN
 (EEOO
r2   r   Nr   r'   r   r   r   r   r2   r/   r   r   ;  r   r2   r   c                      \ rS rSrSS jrSrg)r5   iS  c                H   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        [        UR                  5      U l        g rC   )r   r   rY   rh   r{   r   r   r   r   s     r/   r   %BatchesWithStreamingResponse.__init__T  s    2NN
 5
 1LL
	 3NN
 3NN
 4OO
r2   r   Nr   r   r   r2   r/   r5   r5   S  r   r2   r5   c                      \ rS rSrSS jrSrg)r   ik  c                H   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        [        UR                  5      U l        g rC   )r   r   rY   rh   r{   r   r   r   r   s     r/   r   *AsyncBatchesWithStreamingResponse.__init__l  s    8NN
 ;
 7LL
	 9NN
 9NN
 :OO
r2   r   Nr   r   r   r2   r/   r   r   k  r   r2   r   )<
__future__r   typingr   r   	itertoolsr   httpx r   _typesr	   r
   r   r   r   r   r   _utilsr   r   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _exceptionsr   _base_clientr   r   _decoders.jsonlr   r   types.beta.messagesr    r!   types.anthropic_beta_paramr"   &types.beta.messages.beta_message_batchr#   .types.beta.messages.beta_deleted_message_batchr$   :types.beta.messages.beta_message_batch_individual_responser%   __all__r&   r'   r,   r   r5   r   r   r2   r/   <module>r      s    # !   ! L L L X X ' ; Z . * A ? J = G V mn
%@
o @
F@
# @
F
 
0
 
0
 
0
 
r2   