§
    �’jÏY  ã                  ó’  — 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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¦  «        Z0dS )é    )Úannotations)ÚOptional)ÚLiteralNé   )Ú_legacy_response)Úbatch_list_paramsÚbatch_create_params)Ú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)ÚSyncCursorPageÚAsyncCursorPage)ÚBatch)ÚAsyncPaginatorÚmake_request_options)ÚMetadataÚBatchesÚAsyncBatchesc                  óš   — e Zd 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dS )-r   ú;Create large batches of API requests to run asynchronously.ÚreturnÚBatchesWithRawResponsec                ó    — 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
        )r$   ©Úselfs    úFC:\Projects\DSCons\.venv\Lib\site-packages\openai\resources\batches.pyÚwith_raw_responsezBatches.with_raw_response   s   € õ & dÑ+Ô+Ð+ó    ÚBatchesWithStreamingResponsec                ó    — 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
        )r,   r'   s    r)   Úwith_streaming_responsezBatches.with_streaming_response&   s   € õ ,¨DÑ1Ô1Ð1r+   N©ÚmetadataÚoutput_expires_afterÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚcompletion_windowúLiteral['24h']Úendpointú¤Literal['/v1/responses', '/v1/chat/completions', '/v1/embeddings', '/v1/completions', '/v1/moderations', '/v1/images/generations', '/v1/images/edits', '/v1/videos']Úinput_file_idÚstrr1   úOptional[Metadata] | Omitr2   ú-batch_create_params.OutputExpiresAfter | Omitr3   úHeaders | Noner4   úQuery | Noner5   úBody | Noner6   ú(float | httpx2.Timeout | None | NotGivenr   c       	        ó¢   — |                       dt          |||||dœt          j        ¦  «        t	          ||||	ddi¬¦  «        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`, `/v1/completions`,
              `/v1/moderations`, `/v1/images/generations`, `/v1/images/edits`, and
              `/v1/videos` 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©r7   r9   r;   r1   r2   Úbearer_authT©r3   r4   r5   r6   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r	   ÚBatchCreateParamsr   r   ©
r(   r7   r9   r;   r1   r2   r3   r4   r5   r6   s
             r)   ÚcreatezBatches.create/   s~   € ðD �zŠzØÝ à):Ø (Ø%2Ø (Ø,@ðð õ $Ô5ñ	ô 	õ )Ø+Ø'Ø%ØØ'¨Ð.ðñ ô õ ð' ñ 
ô 
ð 	
r+   ©r3   r4   r5   r6   Úbatch_idc               óª   — |st          d|›�¦  «        ‚|                      t          d|¬¦  «        t          ||||ddi¬¦  «        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/{batch_id}©rS   rG   TrH   ©rL   rM   ©Ú
ValueErrorÚ_getr   r   r   ©r(   rS   r3   r4   r5   r6   s         r)   ÚretrievezBatches.retrieve‡   s|   € ð. ð 	eÝÐcÐW_ÐcÐcÑdÔdÐdØ�yŠyÝÐ/¸(ÐCÑCÔCÝ(Ø+Ø'Ø%ØØ'¨Ð.ðñ ô õ ð ñ 

ô 

ð 
	
r+   ©ÚafterÚlimitr3   r4   r5   r6   r`   ú
str | Omitra   ú
int | OmitúSyncCursorPage[Batch]c               ó¾   — |                       dt          t                   t          ||||t	          ||dœt
          j        ¦  «        ddi¬¦  «        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
        rE   )r`   ra   rG   T)r3   r4   r5   r6   ÚqueryrI   )ÚpagerL   Úmodel)Ú_get_api_listr   r   r   r   r   ÚBatchListParams©r(   r`   ra   r3   r4   r5   r6   s          r)   ÚlistzBatches.list¬   s   € ðB ×!Ò!ØÝ¥Ô&Ý(Ø+Ø'Ø%ØÝ%à!&Ø!&ðð õ &Ô5ñô ð (¨Ð.ðñ ô õ ð# "ñ 
ô 
ð 	
r+   c               óª   — |st          d|›�¦  «        ‚|                      t          d|¬¦  «        t          ||||ddi¬¦  «        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
        rV   ú/batches/{batch_id}/cancelrX   rG   TrH   rY   ©r[   rN   r   r   r   r]   s         r)   ÚcancelzBatches.cancelá   s|   € ð4 ð 	eÝÐcÐW_ÐcÐcÑdÔdÐdØ�zŠzÝÐ6ÀÐJÑJÔJÝ(Ø+Ø'Ø%ØØ'¨Ð.ðñ ô õ ð ñ 

ô 

ð 
	
r+   )r#   r$   )r#   r,   ©r7   r8   r9   r:   r;   r<   r1   r=   r2   r>   r3   r?   r4   r@   r5   rA   r6   rB   r#   r   ©rS   r<   r3   r?   r4   r@   r5   rA   r6   rB   r#   r   )r`   rb   ra   rc   r3   r?   r4   r@   r5   rA   r6   rB   r#   rd   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r*   r/   r   r   rQ   r^   rm   rr   © r+   r)   r   r      s!  € € € € € ØEÐEàð,ð ,ð ,ñ „_ð,ð ð2ð 2ð 2ñ „_ð2ð. /3ØNRð )-Ø$(Ø"&Ø<Eð-V
ð V
ð V
ð V
ð V
ð V
ð| )-Ø$(Ø"&Ø<Eð#
ð #
ð #
ð #
ð #
ð #
ðP !Ø ð )-Ø$(Ø"&Ø<Eð3
ð 3
ð 3
ð 3
ð 3
ð 3
ðv )-Ø$(Ø"&Ø<Eð&
ð &
ð &
ð &
ð &
ð &
ð &
ð &
r+   c                  óš   — e Zd 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dS )-r    r"   r#   ÚAsyncBatchesWithRawResponsec                ó    — t          | ¦  «        S r&   )r|   r'   s    r)   r*   zAsyncBatches.with_raw_response  s   € õ +¨4Ñ0Ô0Ð0r+   Ú!AsyncBatchesWithStreamingResponsec                ó    — t          | ¦  «        S r.   )r~   r'   s    r)   r/   z$AsyncBatches.with_streaming_response  s   € õ 1°Ñ6Ô6Ð6r+   Nr0   r7   r8   r9   r:   r;   r<   r1   r=   r2   r>   r3   r?   r4   r@   r5   rA   r6   rB   r   c       	      ƒ  ó¾   K  — |                       dt          |||||dœt          j        ¦  «        ƒ d{V —†t	          ||||	ddi¬¦  «        t
          ¬¦  «        ƒ d{V —†S )rD   rE   rF   NrG   TrH   rJ   )rN   r   r	   rO   r   r   rP   s
             r)   rQ   zAsyncBatches.create   s¾   è è € ðD —Z’ZØÝ,à):Ø (Ø%2Ø (Ø,@ðð õ $Ô5ñ	ô 	ð 	ð 	ð 	ð 	ð 	ð 	õ )Ø+Ø'Ø%ØØ'¨Ð.ðñ ô õ ð'  ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 	
r+   rR   rS   c             ƒ  óº   K  — |st          d|›�¦  «        ‚|                      t          d|¬¦  «        t          ||||ddi¬¦  «        t          ¬¦  «        ƒ d{V —†S )	rU   rV   rW   rX   rG   TrH   rY   NrZ   r]   s         r)   r^   zAsyncBatches.retrievex  sž   è è € ð. ð 	eÝÐcÐW_ÐcÐcÑdÔdÐdØ—Y’YÝÐ/¸(ÐCÑCÔCÝ(Ø+Ø'Ø%ØØ'¨Ð.ðñ ô õ ð ñ 

ô 

ð 

ð 

ð 

ð 

ð 

ð 

ð 
	
r+   r_   r`   rb   ra   rc   ú-AsyncPaginator[Batch, AsyncCursorPage[Batch]]c               ó¾   — |                       dt          t                   t          ||||t	          ||dœt
          j        ¦  «        ddi¬¦  «        t          ¬¦  «        S rf   )rj   r   r   r   r   r   rk   rl   s          r)   rm   zAsyncBatches.list�  s   € ðB ×!Ò!ØÝ ¥Ô'Ý(Ø+Ø'Ø%ØÝ%à!&Ø!&ðð õ &Ô5ñô ð (¨Ð.ðñ ô õ ð# "ñ 
ô 
ð 	
r+   c             ƒ  óº   K  — |st          d|›�¦  «        ‚|                      t          d|¬¦  «        t          ||||ddi¬¦  «        t          ¬¦  «        ƒ d{V —†S )	ro   rV   rp   rX   rG   TrH   rY   Nrq   r]   s         r)   rr   zAsyncBatches.cancelÒ  sž   è è € ð4 ð 	eÝÐcÐW_ÐcÐcÑdÔdÐdØ—Z’ZÝÐ6ÀÐJÑJÔJÝ(Ø+Ø'Ø%ØØ'¨Ð.ðñ ô õ ð  ñ 

ô 

ð 

ð 

ð 

ð 

ð 

ð 

ð 
	
r+   )r#   r|   )r#   r~   rs   rt   )r`   rb   ra   rc   r3   r?   r4   r@   r5   rA   r6   rB   r#   r‚   ru   rz   r+   r)   r    r    
  s!  € € € € € ØEÐEàð1ð 1ð 1ñ „_ð1ð ð7ð 7ð 7ñ „_ð7ð. /3ØNRð )-Ø$(Ø"&Ø<Eð-V
ð V
ð V
ð V
ð V
ð V
ð| )-Ø$(Ø"&Ø<Eð#
ð #
ð #
ð #
ð #
ð #
ðP !Ø ð )-Ø$(Ø"&Ø<Eð3
ð 3
ð 3
ð 3
ð 3
ð 3
ðv )-Ø$(Ø"&Ø<Eð&
ð &
ð &
ð &
ð &
ð &
ð &
ð &
r+   c                  ó   — e Zd Zdd„ZdS )r$   Úbatchesr   r#   ÚNonec                ó  — || _         t          j        |j        ¦  «        | _        t          j        |j        ¦  «        | _        t          j        |j        ¦  «        | _        t          j        |j        ¦  «        | _        d S ©N)Ú_batchesr   Úto_raw_response_wrapperrQ   r^   rm   rr   ©r(   r†   s     r)   Ú__init__zBatchesWithRawResponse.__init__ü  sx   € ØˆŒå&Ô>ØŒNñ
ô 
ˆŒõ )Ô@ØÔñ
ô 
ˆŒõ %Ô<ØŒLñ
ô 
ˆŒ	õ 'Ô>ØŒNñ
ô 
ˆŒˆˆr+   N©r†   r   r#   r‡   ©rv   rw   rx   r�   rz   r+   r)   r$   r$   û  ó(   € € € € € ð
ð 
ð 
ð 
ð 
ð 
r+   r$   c                  ó   — e Zd Zdd„ZdS )r|   r†   r    r#   r‡   c                ó  — || _         t          j        |j        ¦  «        | _        t          j        |j        ¦  «        | _        t          j        |j        ¦  «        | _        t          j        |j        ¦  «        | _        d S r‰   )rŠ   r   Úasync_to_raw_response_wrapperrQ   r^   rm   rr   rŒ   s     r)   r�   z$AsyncBatchesWithRawResponse.__init__  sx   € ØˆŒå&ÔDØŒNñ
ô 
ˆŒõ )ÔFØÔñ
ô 
ˆŒõ %ÔBØŒLñ
ô 
ˆŒ	õ 'ÔDØŒNñ
ô 
ˆŒˆˆr+   N©r†   r    r#   r‡   r�   rz   r+   r)   r|   r|     r�   r+   r|   c                  ó   — e Zd Zdd„ZdS )r,   r†   r   r#   r‡   c                óÜ   — || _         t          |j        ¦  «        | _        t          |j        ¦  «        | _        t          |j        ¦  «        | _        t          |j        ¦  «        | _        d S r‰   )rŠ   r   rQ   r^   rm   rr   rŒ   s     r)   r�   z%BatchesWithStreamingResponse.__init__   sl   € ØˆŒå2ØŒNñ
ô 
ˆŒõ 5ØÔñ
ô 
ˆŒõ 1ØŒLñ
ô 
ˆŒ	õ 3ØŒNñ
ô 
ˆŒˆˆr+   NrŽ   r�   rz   r+   r)   r,   r,     r�   r+   r,   c                  ó   — e Zd Zdd„ZdS )r~   r†   r    r#   r‡   c                óÜ   — || _         t          |j        ¦  «        | _        t          |j        ¦  «        | _        t          |j        ¦  «        | _        t          |j        ¦  «        | _        d S r‰   )rŠ   r   rQ   r^   rm   rr   rŒ   s     r)   r�   z*AsyncBatchesWithStreamingResponse.__init__2  sl   € ØˆŒå8ØŒNñ
ô 
ˆŒõ ;ØÔñ
ô 
ˆŒõ 7ØŒLñ
ô 
ˆŒ	õ 9ØŒNñ
ô 
ˆŒˆˆr+   Nr”   r�   rz   r+   r)   r~   r~   1  r�   r+   r~   )1Ú
__future__r   Útypingr   Útyping_extensionsr   Úhttpx2Ú r   Útypesr   r	   Ú_typesr
   r   r   r   r   r   r   Ú_utilsr   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú
paginationr   r   Útypes.batchr   Ú_base_clientr   r   Útypes.shared_params.metadatar   Ú__all__r   r    r$   r|   r,   r~   rz   r+   r)   ú<module>r©      su  ðð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ø %Ð %Ð %Ð %Ð %Ð %à €€€à Ð Ð Ð Ð Ð Ø :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ø JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JØ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JØ %Ð %Ð %Ð %Ð %Ð %Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø XÐ XÐ XÐ XÐ XÐ XÐ XÐ XØ 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø Ð Ð Ð Ð Ð Ø ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3à�nÐ
%€ðn
ð n
ð n
ð n
ð n
ˆoñ n
ô n
ð n
ðbn
ð n
ð n
ð n
ð n
Ð#ñ n
ô n
ð n
ðb
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð$
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð$
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð$
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
r+   