Ë
    ²ŒjvQ  ã                  óh  — d dl mZ 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 ddlmZmZmZmZmZ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%m&Z& ddl'm(Z( ddgZ) G d„ de«      Z* G d„ de«      Z+ G d„ d«      Z, G d„ d«      Z- G d„ d«      Z. G d„ d«      Z/y)é    )Úannotations)ÚOptional)ÚLiteralNé   )Ú_legacy_response)Úbatch_list_paramsÚbatch_create_params)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚomitÚ	not_given)Úmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncCursorPageÚAsyncCursorPage)ÚBatch)ÚAsyncPaginatorÚmake_request_options)ÚMetadataÚBatchesÚAsyncBatchesc                  óô   — e Zd Zedd„«       Zedd„«       Zeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdddedœ	 	 	 	 	 	 	 	 	 	 	 dd„Z	ee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/openai/openai-python#accessing-raw-response-data-eg-headers
        )ÚBatchesWithRawResponse©Úselfs    úb/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/openai/resources/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/openai/openai-python#with_streaming_response
        )ÚBatchesWithStreamingResponser$   s    r&   Úwith_streaming_responsezBatches.with_streaming_response$   s   € ô ,¨DÓ1Ð1r(   N©ÚmetadataÚoutput_expires_afterÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutc       	        óŠ   — | j                  dt        |||||dœt        j                  «      t	        ||||	¬«      t
        ¬«      S )áˆ  
        Creates and executes a batch from an uploaded file of requests

        Args:
          completion_window: The time frame within which the batch should be processed. Currently only `24h`
              is supported.

          endpoint: The endpoint to be used for all requests in the batch. Currently
              `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions`
              are supported. Note that `/v1/embeddings` batches are also restricted to a
              maximum of 50,000 embedding inputs across all requests in the batch.

          input_file_id: The ID of an uploaded file that contains requests for the new batch.

              See [upload file](https://platform.openai.com/docs/api-reference/files/create)
              for how to upload a file.

              Your input file must be formatted as a
              [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input),
              and must be uploaded with the purpose `batch`. The file can contain up to 50,000
              requests, and can be up to 200 MB in size.

          metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
              for storing additional information about the object in a structured format, and
              querying for objects via API or the dashboard.

              Keys are strings with a maximum length of 64 characters. Values are strings with
              a maximum length of 512 characters.

          output_expires_after: The expiration policy for the output and/or error file that are generated for a
              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
        ú/batches©Úcompletion_windowÚendpointÚinput_file_idr.   r/   ©r0   r1   r2   r3   ©ÚbodyÚoptionsÚcast_to)Ú_postr   r	   ÚBatchCreateParamsr   r   ©
r%   r8   r9   r:   r.   r/   r0   r1   r2   r3   s
             r&   ÚcreatezBatches.create-   s_   € ðn �z‰zØÜ à):Ø (Ø%2Ø (Ø,@ñô $×5Ñ5ó	ô )Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r(   r;   c          	     ór   — |st        d|›�«      ‚| j                  d|› �t        ||||¬«      t        ¬«      S )áF  
        Retrieves a batch.

        Args:
          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
        ú7Expected a non-empty value for `batch_id` but received ú	/batches/r;   ©r>   r?   ©Ú
ValueErrorÚ_getr   r   ©r%   Úbatch_idr0   r1   r2   r3   s         r&   ÚretrievezBatches.retrievev   sT   € ñ. ÜÐVÐW_ÐVbÐcÓdÐdØ�y‰yØ˜�zÐ"Ü(Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r(   ©ÚafterÚlimitr0   r1   r2   r3   c               óœ   — | j                  dt        t           t        ||||t	        ||dœt
        j                  «      ¬«      t        ¬«      S ©a,  List your organization's batches.

        Args:
          after: A cursor for use in pagination.

        `after` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include after=obj_foo in order to
              fetch the next page of the list.

          limit: A limit on the number of objects to be returned. Limit can range between 1 and
              100, and the default is 20.

          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
        r6   )rP   rQ   )r0   r1   r2   r3   Úquery)Úpager>   Úmodel)Ú_get_api_listr   r   r   r   r   ÚBatchListParams©r%   rP   rQ   r0   r1   r2   r3   s          r&   ÚlistzBatches.list—   s_   € ðB ×!Ñ!ØÜ¤Ñ&Ü(Ø+Ø'Ø%ØÜ%à!&Ø!&ñô &×5Ñ5óôô ð! "ó 
ð 	
r(   c          	     ót   — |st        d|›�«      ‚| j                  d|› d�t        ||||¬«      t        ¬«      S )á
  Cancels an in-progress batch.

        The batch will be in status `cancelling` for up to
        10 minutes, before changing to `cancelled`, where it will have partial results
        (if any) available in the output file.

        Args:
          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
        rF   rG   ú/cancelr;   rH   ©rJ   r@   r   r   rL   s         r&   ÚcancelzBatches.cancelË   sV   € ñ4 ÜÐVÐW_ÐVbÐcÓdÐdØ�z‰zØ˜�z Ð)Ü(Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r(   )Úreturnr#   )r`   r+   ©r8   zLiteral['24h']r9   zULiteral['/v1/responses', '/v1/chat/completions', '/v1/embeddings', '/v1/completions']r:   Ústrr.   zOptional[Metadata] | Omitr/   z-batch_create_params.OutputExpiresAfter | Omitr0   úHeaders | Noner1   úQuery | Noner2   úBody | Noner3   ú'float | httpx.Timeout | None | NotGivenr`   r   ©rM   rb   r0   rc   r1   rd   r2   re   r3   rf   r`   r   )rP   ú
str | OmitrQ   ú
int | Omitr0   rc   r1   rd   r2   re   r3   rf   r`   zSyncCursorPage[Batch]©Ú__name__Ú
__module__Ú__qualname__r   r'   r,   r   r   rC   rN   rZ   r_   © r(   r&   r   r      s²  „ Øò,ó ð,ð ò2ó ð2ð /3ØNRð )-Ø$(Ø"&Ø;DñG
ð *ðG
ð hð	G
ð
 ðG
ð ,ðG
ð LðG
ð &ðG
ð "ðG
ð  ðG
ð 9ðG
ð 
óG
ð^ )-Ø$(Ø"&Ø;Dñ
àð
ð &ð
ð "ð
ð  ð
ð 9ð
ð 
ó
ðH !Ø ð )-Ø$(Ø"&Ø;Dñ2
ð ð2
ð ð	2
ð &ð2
ð "ð2
ð  ð2
ð 9ð2
ð 
ó2
ðt )-Ø$(Ø"&Ø;Dñ"
àð"
ð &ð"
ð "ð"
ð  ð"
ð 9ð"
ð 
ô"
r(   c                  óô   — e Zd Zedd„«       Zedd„«       Zeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdddedœ	 	 	 	 	 	 	 	 	 	 	 dd„Z	ee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_responseñ   s   € ô +¨4Ó0Ð0r(   c                ó   — t        | «      S r*   )Ú!AsyncBatchesWithStreamingResponser$   s    r&   r,   z$AsyncBatches.with_streaming_responseû   s   € ô 1°Ó6Ð6r(   Nr-   c       	      ƒ  óº   K  — | j                  dt        |||||dœt        j                  «      ƒ d{  –—† t	        ||||	¬«      t
        ¬«      ƒ d{  –—† S 7 Œ$7 Œ­w)r5   r6   r7   Nr;   r<   )r@   r   r	   rA   r   r   rB   s
             r&   rC   zAsyncBatches.create  sx   è ø€ ðn —Z‘ZØÜ,à):Ø (Ø%2Ø (Ø,@ñô $×5Ñ5ó	÷ 	ô )Ø+¸ÐQ[Ðelôô ð  ó 
÷ 
ð 	
ð	øð
ús!   ‚0A²A
³AÁAÁAÁAr;   c          	   ƒ  óŽ   K  — |st        d|›�«      ‚| j                  d|› �t        ||||¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)rE   rF   rG   r;   rH   NrI   rL   s         r&   rN   zAsyncBatches.retrieveM  sb   è ø€ ñ. ÜÐVÐW_ÐVbÐcÓdÐdØ—Y‘YØ˜�zÐ"Ü(Ø+¸ÐQ[Ðelôô ð ó 
÷ 
ð 	
ð 
ús   ‚<A¾A¿ArO   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.listn  s_   € ðB ×!Ñ!ØÜ ¤Ñ'Ü(Ø+Ø'Ø%ØÜ%à!&Ø!&ñô &×5Ñ5óôô ð! "ó 
ð 	
r(   c          	   ƒ  ó�   K  — |st        d|›�«      ‚| j                  d|› d�t        ||||¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)r\   rF   rG   r]   r;   rH   Nr^   rL   s         r&   r_   zAsyncBatches.cancel¢  sd   è ø€ ñ4 ÜÐVÐW_ÐVbÐcÓdÐdØ—Z‘ZØ˜�z Ð)Ü(Ø+¸ÐQ[Ðelôô ð  ó 
÷ 
ð 	
ð 
ús   ‚=A¿AÁ A)r`   rq   )r`   rs   ra   rg   )rP   rh   rQ   ri   r0   rc   r1   rd   r2   re   r3   rf   r`   z-AsyncPaginator[Batch, AsyncCursorPage[Batch]]rj   rn   r(   r&   r   r   ð   s²  „ Øò1ó ð1ð ò7ó ð7ð /3ØNRð )-Ø$(Ø"&Ø;DñG
ð *ðG
ð hð	G
ð
 ðG
ð ,ðG
ð LðG
ð &ðG
ð "ðG
ð  ðG
ð 9ðG
ð 
óG
ð^ )-Ø$(Ø"&Ø;Dñ
àð
ð &ð
ð "ð
ð  ð
ð 9ð
ð 
ó
ðH !Ø ð )-Ø$(Ø"&Ø;Dñ2
ð ð2
ð ð	2
ð &ð2
ð "ð2
ð  ð2
ð 9ð2
ð 
7ó2
ðt )-Ø$(Ø"&Ø;Dñ"
àð"
ð &ð"
ð "ð"
ð  ð"
ð 9ð"
ð 
ô"
r(   c                  ó   — e Zd Zdd„Zy)r#   c                ó2  — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        t        j                  |j                  «      | _        y ©N)Ú_batchesr   Úto_raw_response_wrapperrC   rN   rZ   r_   ©r%   Úbatchess     r&   Ú__init__zBatchesWithRawResponse.__init__È  su   € ØˆŒä&×>Ñ>Ø�N‰Nó
ˆŒô )×@Ñ@Ø×Ñó
ˆŒô %×<Ñ<Ø�L‰Ló
ˆŒ	ô '×>Ñ>Ø�N‰Nó
ˆ�r(   N©r~   r   r`   ÚNone©rk   rl   rm   r   rn   r(   r&   r#   r#   Ç  ó   „ ô
r(   r#   c                  ó   — e Zd Zdd„Zy)rq   c                ó2  — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        t        j                  |j                  «      | _        y rz   )r{   r   Úasync_to_raw_response_wrapperrC   rN   rZ   r_   r}   s     r&   r   z$AsyncBatchesWithRawResponse.__init__Ú  su   € ØˆŒä&×DÑDØ�N‰Nó
ˆŒô )×FÑFØ×Ñó
ˆŒô %×BÑBØ�L‰Ló
ˆŒ	ô '×DÑDØ�N‰Nó
ˆ�r(   N©r~   r   r`   r�   r‚   rn   r(   r&   rq   rq   Ù  rƒ   r(   rq   c                  ó   — e Zd Zdd„Zy)r+   c                óâ   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        y rz   )r{   r   rC   rN   rZ   r_   r}   s     r&   r   z%BatchesWithStreamingResponse.__init__ì  s]   € ØˆŒä2Ø�N‰Nó
ˆŒô 5Ø×Ñó
ˆŒô 1Ø�L‰Ló
ˆŒ	ô 3Ø�N‰Nó
ˆ�r(   Nr€   r‚   rn   r(   r&   r+   r+   ë  rƒ   r(   r+   c                  ó   — e Zd Zdd„Zy)rs   c                óâ   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        y rz   )r{   r   rC   rN   rZ   r_   r}   s     r&   r   z*AsyncBatchesWithStreamingResponse.__init__þ  s]   € ØˆŒä8Ø�N‰Nó
ˆŒô ;Ø×Ñó
ˆŒô 7Ø�L‰Ló
ˆŒ	ô 9Ø�N‰Nó
ˆ�r(   Nr‡   r‚   rn   r(   r&   rs   rs   ý  rƒ   r(   rs   )0Ú
__future__r   Útypingr   Útyping_extensionsr   ÚhttpxÚ r   Útypesr   r	   Ú_typesr
   r   r   r   r   r   r   Ú_utilsr   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú
paginationr   r   Útypes.batchr   Ú_base_clientr   r   Útypes.shared_params.metadatar   Ú__all__r   r   r#   rq   r+   rs   rn   r(   r&   Ú<module>rœ      s‹   ðõ #å Ý %ã å ß :ß J× JÑ Jß ;Ý %ß 9ß Xß 8Ý ß ?Ý 3à�nÐ
%€ôT
ˆoô T
ônT
Ð#ô T
÷n
ñ 
÷$
ñ 
÷$
ñ 
÷$
ò 
r(   