Ë
    Ô~ïi1r  ã                  óˆ  — d dl mZ d dlmZ d dlZddlmZ ddlmZm	Z	m
Z
mZmZmZmZ ddlmZmZmZ ddlmZ dd	lmZmZ dd
lmZmZ ddlmZmZ ddlmZ ddl m!Z!m"Z" ddl#m$Z$m%Z% ddl&m'Z'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z. ddgZ/ G d„ de«      Z0 G d„ de«      Z1 G d„ d«      Z2 G d„ d«      Z3 G d„ d«      Z4 G d„ d«      Z5y)é    )Úannotations)ÚIterableNé   )Ú_legacy_response)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚomitÚ	not_given)Úpath_templateÚmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncPageÚ	AsyncPage)ÚAnthropicError)ÚAsyncPaginatorÚmake_request_options)Úbatch_list_paramsÚbatch_create_params)ÚJSONLDecoderÚAsyncJSONLDecoder)ÚMessageBatch)ÚDeletedMessageBatch)ÚMessageBatchIndividualResponseÚBatchesÚAsyncBatchesc                  ó:  — e Zd Zedd„«       Zedd„«       Zdddedœ	 	 	 	 	 	 	 	 	 	 	 dd„Zdddedœ	 	 	 	 	 	 	 	 	 	 	 dd„Ze	e	e	dddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z
dddedœ	 	 	 	 	 	 	 	 	 	 	 dd	„Zdddedœ	 	 	 	 	 	 	 	 	 	 	 dd
„Zdddedœ	 	 	 	 	 	 	 	 	 	 	 dd„Zy)r"   c                ó   — t        | «      S ©a  
        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    ú{/var/www/acinvestment.org/public_html/aci/backend/venv/lib/python3.12/site-packages/anthropic/resources/messages/batches.pyÚwith_raw_responsezBatches.with_raw_response   s   € ô & dÓ+Ð+ó    c                ó   — t        | «      S ©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_responsezBatches.with_streaming_response&   s   € ô ,¨DÓ1Ð1r,   N©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutc          
     ó‚   — | j                  dt        d|it        j                  «      t	        ||||¬«      t
        ¬«      S )áN  
        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.

          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
        ú/v1/messages/batchesÚrequestsr1   ©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚBatchCreateParamsr   r   ©r)   r9   r2   r3   r4   r5   s         r*   ÚcreatezBatches.create/   sL   € ðB �z‰zØ"Ü  *¨hÐ!7Ô9L×9^Ñ9^Ó_Ü(Ø+¸ÐQ[Ðelôô !ð ó 
ð 	
r,   c          	     ó‚   — |st        d|›�«      ‚| j                  t        d|¬«      t        ||||¬«      t        ¬«      S )áÂ  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.

          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 ú'/v1/messages/batches/{message_batch_id}©Úmessage_batch_idr1   ©r<   r=   ©Ú
ValueErrorÚ_getr   r   r   ©r)   rG   r2   r3   r4   r5   s         r*   ÚretrievezBatches.retrieveY   sV   € ñ>  ÜÐ^Ð_oÐ^rÐsÓtÐtØ�y‰yÜÐCÐVfÔgÜ(Ø+¸ÐQ[Ðelôô !ð ó 
ð 	
r,   ©Úafter_idÚ	before_idÚlimitr2   r3   r4   r5   c               óž   — | j                  dt        t           t        ||||t	        |||dœt
        j                  «      ¬«      t        ¬«      S ©aâ  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`.

          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
        r8   )rO   rP   rQ   )r2   r3   r4   r5   Úquery)Úpager<   Úmodel)Ú_get_api_listr   r   r   r   r   ÚBatchListParams©r)   rO   rP   rQ   r2   r3   r4   r5   s           r*   ÚlistzBatches.list‚   sb   € ðP ×!Ñ!Ø"Üœ,Ñ'Ü(Ø+Ø'Ø%ØÜ%à$,Ø%.Ø!&ñô
 &×5Ñ5óôô ð# "ó 
ð 	
r,   c          	     ó‚   — |st        d|›�«      ‚| j                  t        d|¬«      t        ||||¬«      t        ¬«      S )á²  
        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.

          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
        rD   rE   rF   r1   rH   ©rJ   Ú_deleter   r   r    rL   s         r*   ÚdeletezBatches.delete¾   sV   € ñ>  ÜÐ^Ð_oÐ^rÐsÓtÐtØ�|‰|ÜÐCÐVfÔgÜ(Ø+¸ÐQ[Ðelôô (ð ó 
ð 	
r,   c          	     ó‚   — |st        d|›�«      ‚| j                  t        d|¬«      t        ||||¬«      t        ¬«      S )á   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.

          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
        rD   ú./v1/messages/batches/{message_batch_id}/cancelrF   r1   rH   ©rJ   r>   r   r   r   rL   s         r*   ÚcancelzBatches.cancelç   sW   € ñJ  ÜÐ^Ð_oÐ^rÐsÓtÐtØ�z‰zÜÐJÐ]mÔnÜ(Ø+¸ÐQ[Ðelôô !ð ó 
ð 	
r,   c          	     ó&  — |st        d|›�«      ‚| j                  |¬«      }|j                  st        d|j                  › �«      ‚ddi|xs i ¥}| j                  t        |j                  |¬«      t        ||||¬«      t        t           d¬«      S )	á.  
        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.

          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
        rD   rF   úBNo `results_url` for the given batch; Has it finished processing? ÚAcceptúapplication/binaryr1   T©r<   r=   Ústream)
rJ   rM   Úresults_urlr   Úprocessing_statusrK   r   r   r   r!   ©r)   rG   r2   r3   r4   r5   Úbatchs          r*   ÚresultszBatches.results  sµ   € ñ@  ÜÐ^Ð_oÐ^rÐsÓtÐtà—‘Ð/?�Ó@ˆØ× Ò Ü ØTÐUZ×UlÑUlÐTmÐnóð ð "Ð#7ÐQ¸MÒ<OÈRÐQˆØ�y‰yÜ˜%×+Ñ+Ð>NÔOÜ(Ø+¸ÐQ[Ðelôô !Ô!?Ñ@Øð ó 
ð 	
r,   )Úreturnr'   )rq   r/   ©r9   z%Iterable[batch_create_params.Request]r2   úHeaders | Noner3   úQuery | Noner4   úBody | Noner5   ú'float | httpx.Timeout | None | NotGivenrq   r   ©rG   Ústrr2   rs   r3   rt   r4   ru   r5   rv   rq   r   )rO   ú
str | OmitrP   ry   rQ   ú
int | Omitr2   rs   r3   rt   r4   ru   r5   rv   rq   zSyncPage[MessageBatch]©rG   rx   r2   rs   r3   rt   r4   ru   r5   rv   rq   r    )rG   rx   r2   rs   r3   rt   r4   ru   r5   rv   rq   z,JSONLDecoder[MessageBatchIndividualResponse]©Ú__name__Ú
__module__Ú__qualname__r   r+   r0   r   rA   rM   r   rZ   r_   rd   rp   © r,   r*   r"   r"      s  „ Øò,ó ð,ð ò2ó ð2ð )-Ø$(Ø"&Ø;Dñ(
ð 8ð(
ð &ð(
ð "ð(
ð  ð(
ð 9ð(
ð 
ó(
ð` )-Ø$(Ø"&Ø;Dñ'
àð'
ð &ð'
ð "ð'
ð  ð'
ð 9ð'
ð 
ó'
ðX  $Ø $Ø ð )-Ø$(Ø"&Ø;Dñ:
ð ð:
ð ð	:
ð
 ð:
ð &ð:
ð "ð:
ð  ð:
ð 9ð:
ð 
 ó:
ðD )-Ø$(Ø"&Ø;Dñ'
àð'
ð &ð'
ð "ð'
ð  ð'
ð 9ð'
ð 
ó'
ð^ )-Ø$(Ø"&Ø;Dñ-
àð-
ð &ð-
ð "ð-
ð  ð-
ð 9ð-
ð 
ó-
ðj )-Ø$(Ø"&Ø;Dñ1
àð1
ð &ð1
ð "ð1
ð  ð1
ð 9ð1
ð 
6ô1
r,   c                  ó:  — e Zd Zedd„«       Zedd„«       Zdddedœ	 	 	 	 	 	 	 	 	 	 	 dd„Zdddedœ	 	 	 	 	 	 	 	 	 	 	 dd„Ze	e	e	dddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z
dddedœ	 	 	 	 	 	 	 	 	 	 	 dd	„Zdddedœ	 	 	 	 	 	 	 	 	 	 	 dd
„Zdddedœ	 	 	 	 	 	 	 	 	 	 	 dd„Zy)r#   c                ó   — t        | «      S r&   )ÚAsyncBatchesWithRawResponser(   s    r*   r+   zAsyncBatches.with_raw_responseK  s   € ô +¨4Ó0Ð0r,   c                ó   — t        | «      S r.   )Ú!AsyncBatchesWithStreamingResponser(   s    r*   r0   z$AsyncBatches.with_streaming_responseU  s   € ô 1°Ó6Ð6r,   Nr1   c          
   ƒ  ó²   K  — | j                  dt        d|it        j                  «      ƒ d{  –—† t	        ||||¬«      t
        ¬«      ƒ d{  –—† S 7 Œ$7 Œ­w)r7   r8   r9   Nr1   r:   )r>   r   r   r?   r   r   r@   s         r*   rA   zAsyncBatches.create^  sa   è ø€ ðB —Z‘ZØ"Ü,¨j¸(Ð-CÔEX×EjÑEjÓk×kÜ(Ø+¸ÐQ[Ðelôô !ð  ó 
÷ 
ð 	
àkøð
ús!   ‚,A®A
¯AÁAÁAÁAc          	   ƒ  óž   K  — |st        d|›�«      ‚| j                  t        d|¬«      t        ||||¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)rC   rD   rE   rF   r1   rH   NrI   rL   s         r*   rM   zAsyncBatches.retrieveˆ  sd   è ø€ ñ>  ÜÐ^Ð_oÐ^rÐsÓtÐtØ—Y‘YÜÐCÐVfÔgÜ(Ø+¸ÐQ[Ðelôô !ð ó 
÷ 
ð 	
ð 
úó   ‚AAÁAÁArN   c               óž   — | j                  dt        t           t        ||||t	        |||dœt
        j                  «      ¬«      t        ¬«      S rS   )rW   r   r   r   r   r   rX   rY   s           r*   rZ   zAsyncBatches.list±  sb   € ðP ×!Ñ!Ø"Üœ<Ñ(Ü(Ø+Ø'Ø%ØÜ%à$,Ø%.Ø!&ñô
 &×5Ñ5óôô ð# "ó 
ð 	
r,   c          	   ƒ  óž   K  — |st        d|›�«      ‚| j                  t        d|¬«      t        ||||¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)r\   rD   rE   rF   r1   rH   Nr]   rL   s         r*   r_   zAsyncBatches.deleteí  sd   è ø€ ñ>  ÜÐ^Ð_oÐ^rÐsÓtÐtØ—\‘\ÜÐCÐVfÔgÜ(Ø+¸ÐQ[Ðelôô (ð "ó 
÷ 
ð 	
ð 
úrˆ   c          	   ƒ  óž   K  — |st        d|›�«      ‚| j                  t        d|¬«      t        ||||¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)ra   rD   rb   rF   r1   rH   Nrc   rL   s         r*   rd   zAsyncBatches.cancel  se   è ø€ ñJ  ÜÐ^Ð_oÐ^rÐsÓtÐtØ—Z‘ZÜÐJÐ]mÔnÜ(Ø+¸ÐQ[Ðelôô !ð  ó 
÷ 
ð 	
ð 
úrˆ   c          	   ƒ  óV  K  — |st        d|›�«      ‚| j                  |¬«      ƒ d{  –—† }|j                  st        d|j                  › �«      ‚ddi|xs i ¥}| j                  t        |j                  |¬«      t        ||||¬«      t        t           d¬	«      ƒ d{  –—† S 7 Œ|7 Œ­w)
rf   rD   rF   Nrg   rh   ri   r1   Trj   )
rJ   rM   rl   r   rm   rK   r   r   r   r!   rn   s          r*   rp   zAsyncBatches.resultsE  sÍ   è ø€ ñ@  ÜÐ^Ð_oÐ^rÐsÓtÐtà—m‘mÐ5E�mÓF×FˆØ× Ò Ü ØTÐUZ×UlÑUlÐTmÐnóð ð "Ð#7ÐQ¸MÒ<OÈRÐQˆØ—Y‘YÜ˜%×+Ñ+Ð>NÔOÜ(Ø+¸ÐQ[Ðelôô &Ô&DÑEØð ó 
÷ 
ð 	
ð Gøð
ús"   ‚&B)¨B%©A7B)Â B'Â!B)Â'B))rq   rƒ   )rq   r…   rr   rw   )rO   ry   rP   ry   rQ   rz   r2   rs   r3   rt   r4   ru   r5   rv   rq   z5AsyncPaginator[MessageBatch, AsyncPage[MessageBatch]]r{   )rG   rx   r2   rs   r3   rt   r4   ru   r5   rv   rq   z1AsyncJSONLDecoder[MessageBatchIndividualResponse]r|   r€   r,   r*   r#   r#   J  s  „ Øò1ó ð1ð ò7ó ð7ð )-Ø$(Ø"&Ø;Dñ(
ð 8ð(
ð &ð(
ð "ð(
ð  ð(
ð 9ð(
ð 
ó(
ð` )-Ø$(Ø"&Ø;Dñ'
àð'
ð &ð'
ð "ð'
ð  ð'
ð 9ð'
ð 
ó'
ðX  $Ø $Ø ð )-Ø$(Ø"&Ø;Dñ:
ð ð:
ð ð	:
ð
 ð:
ð &ð:
ð "ð:
ð  ð:
ð 9ð:
ð 
?ó:
ðD )-Ø$(Ø"&Ø;Dñ'
àð'
ð &ð'
ð "ð'
ð  ð'
ð 9ð'
ð 
ó'
ð^ )-Ø$(Ø"&Ø;Dñ-
àð-
ð &ð-
ð "ð-
ð  ð-
ð 9ð-
ð 
ó-
ðj )-Ø$(Ø"&Ø;Dñ1
àð1
ð &ð1
ð "ð1
ð  ð1
ð 9ð1
ð 
;ô1
r,   c                  ó   — e Zd Zdd„Zy)r'   c                óz  — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        t        j                  |j                  «      | _        t        j                  |j                  «      | _        y ©N)Ú_batchesr   Úto_raw_response_wrapperrA   rM   rZ   r_   rd   ©r)   Úbatchess     r*   Ú__init__zBatchesWithRawResponse.__init__z  s�   € ØˆŒä&×>Ñ>Ø�N‰Nó
ˆŒô )×@Ñ@Ø×Ñó
ˆŒô %×<Ñ<Ø�L‰Ló
ˆŒ	ô '×>Ñ>Ø�N‰Nó
ˆŒô '×>Ñ>Ø�N‰Nó
ˆ�r,   N©r“   r"   rq   ÚNone©r}   r~   r   r”   r€   r,   r*   r'   r'   y  ó   „ ô
r,   r'   c                  ó   — e Zd Zdd„Zy)rƒ   c                óz  — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        t        j                  |j                  «      | _        t        j                  |j                  «      | _        y r�   )r�   r   Úasync_to_raw_response_wrapperrA   rM   rZ   r_   rd   r’   s     r*   r”   z$AsyncBatchesWithRawResponse.__init__�  s�   € ØˆŒä&×DÑDØ�N‰Nó
ˆŒô )×FÑFØ×Ñó
ˆŒô %×BÑBØ�L‰Ló
ˆŒ	ô '×DÑDØ�N‰Nó
ˆŒô '×DÑDØ�N‰Nó
ˆ�r,   N©r“   r#   rq   r–   r—   r€   r,   r*   rƒ   rƒ   Ž  r˜   r,   rƒ   c                  ó   — e Zd Zdd„Zy)r/   c                ó  — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        t        |j                  «      | _        y r�   )r�   r   rA   rM   rZ   r_   rd   r’   s     r*   r”   z%BatchesWithStreamingResponse.__init__¤  sr   € ØˆŒä2Ø�N‰Nó
ˆŒô 5Ø×Ñó
ˆŒô 1Ø�L‰Ló
ˆŒ	ô 3Ø�N‰Nó
ˆŒô 3Ø�N‰Nó
ˆ�r,   Nr•   r—   r€   r,   r*   r/   r/   £  r˜   r,   r/   c                  ó   — e Zd Zdd„Zy)r…   c                ó  — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        t        |j                  «      | _        y r�   )r�   r   rA   rM   rZ   r_   rd   r’   s     r*   r”   z*AsyncBatchesWithStreamingResponse.__init__¹  sr   € ØˆŒä8Ø�N‰Nó
ˆŒô ;Ø×Ñó
ˆŒô 7Ø�L‰Ló
ˆŒ	ô 9Ø�N‰Nó
ˆŒô 9Ø�N‰Nó
ˆ�r,   Nrœ   r—   r€   r,   r*   r…   r…   ¸  r˜   r,   r…   )6Ú
__future__r   Útypingr   ÚhttpxÚ r   Ú_typesr   r   r	   r
   r   r   r   Ú_utilsr   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú
paginationr   r   Ú_exceptionsr   Ú_base_clientr   r   Útypes.messagesr   r   Ú_decoders.jsonlr   r   Útypes.messages.message_batchr   Ú$types.messages.deleted_message_batchr    Ú0types.messages.message_batch_individual_responser!   Ú__all__r"   r#   r'   rƒ   r/   r…   r€   r,   r*   ú<module>r³      s”   ðõ #å ã å  ß K× KÑ Kß KÑ KÝ &ß :ß Yß -Ý )ß @ß Dß >Ý 8Ý GÝ ^à�nÐ
%€ôl
ˆoô l
ô^	l
Ð#ô l
÷^	
ñ 
÷*
ñ 
÷*
ñ 
÷*
ò 
r,   