Ë
    $Æ%hhO  ã                  ó`  — 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 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)Ú	NOT_GIVENÚBodyÚQueryÚHeadersÚNotGiven)Ú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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    úV/var/www/skyplay_api_hub/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Ú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.

          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-   r.   r/   r0   ©ÚbodyÚoptionsÚcast_to)Ú_postr   r	   ÚBatchCreateParamsr   r   ©	r#   r5   r6   r7   r,   r-   r.   r/   r0   s	            r$   ÚcreatezBatches.create-   s\   € ðf �z‰zØÜ à):Ø (Ø%2Ø (ñ	ô $×5Ñ5óô )Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r&   r8   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/r8   ©r;   r<   ©Ú
ValueErrorÚ_getr   r   ©r#   Úbatch_idr-   r.   r/   r0   s         r$   ÚretrievezBatches.retrieveq   sT   € ñ. ÜÐVÐW_ÐVbÐcÓdÐdØ�y‰yØ˜�zÐ"Ü(Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r&   ©ÚafterÚlimitr-   r.   r/   r0   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
        r3   )rM   rN   )r-   r.   r/   r0   Úquery)Úpager;   Úmodel)Ú_get_api_listr   r   r   r   r   ÚBatchListParams©r#   rM   rN   r-   r.   r/   r0   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
        rC   rD   ú/cancelr8   rE   ©rG   r=   r   r   rI   s         r$   ÚcancelzBatches.cancelÆ   sV   € ñ4 ÜÐVÐW_ÐVbÐcÓdÐdØ�z‰zØ˜�z Ð)Ü(Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r&   )Úreturnr!   )r]   r)   ©r5   zLiteral['24h']r6   zULiteral['/v1/responses', '/v1/chat/completions', '/v1/embeddings', '/v1/completions']r7   Ústrr,   zOptional[Metadata] | NotGivenr-   úHeaders | Noner.   úQuery | Noner/   úBody | Noner0   ú'float | httpx.Timeout | None | NotGivenr]   r   ©rJ   r_   r-   r`   r.   ra   r/   rb   r0   rc   r]   r   )rM   ústr | NotGivenrN   úint | NotGivenr-   r`   r.   ra   r/   rb   r0   rc   r]   zSyncCursorPage[Batch]©Ú__name__Ú
__module__Ú__qualname__r   r%   r*   r
   r@   rK   rW   r\   © r&   r$   r   r      s£  „ Øò,ó ð,ð ò2ó ð2ð 3<ð )-Ø$(Ø"&Ø;DñB
ð *ðB
ð hð	B
ð
 ðB
ð 0ðB
ð &ðB
ð "ðB
ð  ðB
ð 9ðB
ð 
óB
ðT )-Ø$(Ø"&Ø;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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)r2   r3   r4   Nr8   r9   )r=   r   r	   r>   r   r   r?   s	            r$   r@   zAsyncBatches.createÿ   su   è ø€ ðf —Z‘ZØÜ,à):Ø (Ø%2Ø (ñ	ô $×5Ñ5ó÷ ô )Ø+¸ÐQ[Ðelôô ð  ó 
÷ 
ð 	
ðøð
ús!   ‚/A±A
²AÁAÁAÁAr8   c          	   ƒ  óŽ   K  — |st        d|›�«      ‚| j                  d|› �t        ||||¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)rB   rC   rD   r8   rE   NrF   rI   s         r$   rK   zAsyncBatches.retrieveC  sb   è ø€ ñ. ÜÐVÐW_ÐVbÐcÓdÐdØ—Y‘YØ˜�zÐ"Ü(Ø+¸ÐQ[Ðelôô ð ó 
÷ 
ð 	
ð 
ús   ‚<A¾A¿ArL   c               óœ   — | j                  dt        t           t        ||||t	        ||dœt
        j                  «      ¬«      t        ¬«      S rP   )rT   r   r   r   r   r   rU   rV   s          r$   rW   zAsyncBatches.listd  s_   € ðB ×!Ñ!ØÜ ¤Ñ'Ü(Ø+Ø'Ø%ØÜ%à!&Ø!&ñô &×5Ñ5óôô ð! "ó 
ð 	
r&   c          	   ƒ  ó�   K  — |st        d|›�«      ‚| j                  d|› d�t        ||||¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)rY   rC   rD   rZ   r8   rE   Nr[   rI   s         r$   r\   zAsyncBatches.cancel˜  sd   è ø€ ñ4 ÜÐVÐW_ÐVbÐcÓdÐdØ—Z‘ZØ˜�z Ð)Ü(Ø+¸ÐQ[Ðelôô ð  ó 
÷ 
ð 	
ð 
ús   ‚=A¿AÁ A)r]   rn   )r]   rp   r^   rd   )rM   re   rN   rf   r-   r`   r.   ra   r/   rb   r0   rc   r]   z-AsyncPaginator[Batch, AsyncCursorPage[Batch]]rg   rk   r&   r$   r   r   ë   s£  „ Øò1ó ð1ð ò7ó ð7ð 3<ð )-Ø$(Ø"&Ø;DñB
ð *ðB
ð hð	B
ð
 ðB
ð 0ðB
ð &ðB
ð "ðB
ð  ðB
ð 9ðB
ð 
óB
ðT )-Ø$(Ø"&Ø;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_wrapperr@   rK   rW   r\   ©r#   Úbatchess     r$   Ú__init__zBatchesWithRawResponse.__init__¾  su   € ØˆŒä&×>Ñ>Ø�N‰Nó
ˆŒô )×@Ñ@Ø×Ñó
ˆŒô %×<Ñ<Ø�L‰Ló
ˆŒ	ô '×>Ñ>Ø�N‰Nó
ˆ�r&   N©r{   r   r]   ÚNone©rh   ri   rj   r|   rk   r&   r$   r!   r!   ½  ó   „ ô
r&   r!   c                  ó   — e Zd Zdd„Zy)rn   c                ó2  — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        t        j                  |j                  «      | _        y rw   )rx   r   Úasync_to_raw_response_wrapperr@   rK   rW   r\   rz   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   rk   r&   r$   rn   rn   Ï  r€   r&   rn   c                  ó   — e Zd Zdd„Zy)r)   c                óâ   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        y rw   )rx   r   r@   rK   rW   r\   rz   s     r$   r|   z%BatchesWithStreamingResponse.__init__â  s]   € ØˆŒä2Ø�N‰Nó
ˆŒô 5Ø×Ñó
ˆŒô 1Ø�L‰Ló
ˆŒ	ô 3Ø�N‰Nó
ˆ�r&   Nr}   r   rk   r&   r$   r)   r)   á  r€   r&   r)   c                  ó   — e Zd Zdd„Zy)rp   c                óâ   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        y rw   )rx   r   r@   rK   rW   r\   rz   s     r$   r|   z*AsyncBatchesWithStreamingResponse.__init__ô  s]   € ØˆŒä8Ø�N‰Nó
ˆŒô ;Ø×Ñó
ˆŒô 7Ø�L‰Ló
ˆŒ	ô 9Ø�N‰Nó
ˆ�r&   Nr„   r   rk   r&   r$   rp   rp   ó  r€   r&   rp   ).Ú
__future__r   Útypingr   Útyping_extensionsr   ÚhttpxÚ r   Útypesr   r	   Ú_typesr
   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!   rn   r)   rp   rk   r&   r$   ú<module>r™      sˆ   ðõ #å Ý %ã å ß :ß >Õ >ß ;Ý %ß 9ß Xß 8Ý ß ?Ý 3à�nÐ
%€ôO
ˆoô O
ôdO
Ð#ô O
÷d
ñ 
÷$
ñ 
÷$
ñ 
÷$
ò 
r&   