§
    ¨eîiáT  ã                  ó’  — 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    ú\/home/div/.hermes/hermes-agent/venv/lib/python3.11/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 | httpx.Timeout | None | NotGivenr   c       	        óœ   — |                       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`, `/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   ©r3   r4   r5   r6   ©ÚbodyÚoptionsÚcast_to)Ú_postr   r	   ÚBatchCreateParamsr   r   ©
r(   r7   r9   r;   r1   r2   r3   r4   r5   r6   s
             r)   ÚcreatezBatches.create/   su   € ðD �zŠzØÝ à):Ø (Ø%2Ø (Ø,@ðð õ $Ô5ñ	ô 	õ )Ø+¸ÐQ[Ðelðñ ô õ ð ñ 
ô 
ð 	
r+   rG   Úbatch_idc          	     ó¤   — |st          d|›�¦  «        ‚|                      t          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/{batch_id}©rP   rG   ©rJ   rK   ©Ú
ValueErrorÚ_getr   r   r   ©r(   rP   r3   r4   r5   r6   s         r)   ÚretrievezBatches.retrieveƒ   ss   € ð. ð 	eÝÐcÐW_ÐcÐcÑdÔdÐdØ�yŠyÝÐ/¸(ÐCÑCÔCÝ(Ø+¸ÐQ[Ðelðñ ô õ ð ñ 
ô 
ð 	
r+   ©ÚafterÚlimitr3   r4   r5   r6   r]   ú
str | Omitr^   ú
int | OmitúSyncCursorPage[Batch]c               ó¸   — |                       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
        rE   )r]   r^   )r3   r4   r5   r6   Úquery)ÚpagerJ   Úmodel)Ú_get_api_listr   r   r   r   r   ÚBatchListParams©r(   r]   r^   r3   r4   r5   r6   s          r)   ÚlistzBatches.list¤   su   € ðB ×!Ò!ØÝ¥Ô&Ý(Ø+Ø'Ø%ØÝ%à!&Ø!&ðð õ &Ô5ñô ðñ ô õ ð! "ñ 
ô 
ð 	
r+   c          	     ó¤   — |st          d|›�¦  «        ‚|                      t          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
        rS   ú/batches/{batch_id}/cancelrU   rG   rV   ©rX   rL   r   r   r   rZ   s         r)   ÚcancelzBatches.cancelØ   ss   € ð4 ð 	eÝÐcÐW_ÐcÐcÑdÔdÐdØ�zŠzÝÐ6ÀÐJÑJÔJÝ(Ø+¸ÐQ[Ðelðñ ô õ ð ñ 
ô 
ð 	
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   ©rP   r<   r3   r?   r4   r@   r5   rA   r6   rB   r#   r   )r]   r_   r^   r`   r3   r?   r4   r@   r5   rA   r6   rB   r#   ra   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r*   r/   r   r   rO   r[   rj   ro   © r+   r)   r   r      s!  € € € € € ØEÐEàð,ð ,ð ,ñ „_ð,ð ð2ð 2ð 2ñ „_ð2ð. /3ØNRð )-Ø$(Ø"&Ø;Dð-R
ð R
ð R
ð R
ð R
ð R
ðt )-Ø$(Ø"&Ø;Dð
ð 
ð 
ð 
ð 
ð 
ðH !Ø ð )-Ø$(Ø"&Ø;Dð2
ð 2
ð 2
ð 2
ð 2
ð 2
ðt )-Ø$(Ø"&Ø;Dð"
ð "
ð "
ð "
ð "
ð "
ð "
ð "
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&   )ry   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	          ||||	¬¦  «        t
          ¬¦  «        ƒ d{V —†S )rD   rE   rF   NrG   rH   )rL   r   r	   rM   r   r   rN   s
             r)   rO   zAsyncBatches.create  sµ   è è € ðD —Z’ZØÝ,à):Ø (Ø%2Ø (Ø,@ðð õ $Ô5ñ	ô 	ð 	ð 	ð 	ð 	ð 	ð 	õ )Ø+¸ÐQ[Ðelðñ ô õ ð  ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 	
r+   rG   rP   c          	   ƒ  ó´   K  — |st          d|›�¦  «        ‚|                      t          d|¬¦  «        t          ||||¬¦  «        t          ¬¦  «        ƒ d{V —†S )rR   rS   rT   rU   rG   rV   NrW   rZ   s         r)   r[   zAsyncBatches.retrieveg  s•   è è € ð. ð 	eÝÐcÐW_ÐcÐcÑdÔdÐdØ—Y’YÝÐ/¸(ÐCÑCÔCÝ(Ø+¸ÐQ[Ðelðñ ô õ ð ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 	
r+   r\   r]   r_   r^   r`   ú-AsyncPaginator[Batch, AsyncCursorPage[Batch]]c               ó¸   — |                       dt          t                   t          ||||t	          ||dœt
          j        ¦  «        ¬¦  «        t          ¬¦  «        S rc   )rg   r   r   r   r   r   rh   ri   s          r)   rj   zAsyncBatches.listˆ  su   € ðB ×!Ò!ØÝ ¥Ô'Ý(Ø+Ø'Ø%ØÝ%à!&Ø!&ðð õ &Ô5ñô ðñ ô õ ð! "ñ 
ô 
ð 	
r+   c          	   ƒ  ó´   K  — |st          d|›�¦  «        ‚|                      t          d|¬¦  «        t          ||||¬¦  «        t          ¬¦  «        ƒ d{V —†S )rl   rS   rm   rU   rG   rV   Nrn   rZ   s         r)   ro   zAsyncBatches.cancel¼  s•   è è € ð4 ð 	eÝÐcÐW_ÐcÐcÑdÔdÐdØ—Z’ZÝÐ6ÀÐJÑJÔJÝ(Ø+¸ÐQ[Ðelðñ ô õ ð  ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 	
r+   )r#   ry   )r#   r{   rp   rq   )r]   r_   r^   r`   r3   r?   r4   r@   r5   rA   r6   rB   r#   r   rr   rw   r+   r)   r    r    ý   s!  € € € € € ØEÐEàð1ð 1ð 1ñ „_ð1ð ð7ð 7ð 7ñ „_ð7ð. /3ØNRð )-Ø$(Ø"&Ø;Dð-R
ð R
ð R
ð R
ð R
ð R
ðt )-Ø$(Ø"&Ø;Dð
ð 
ð 
ð 
ð 
ð 
ðH !Ø ð )-Ø$(Ø"&Ø;Dð2
ð 2
ð 2
ð 2
ð 2
ð 2
ðt )-Ø$(Ø"&Ø;Dð"
ð "
ð "
ð "
ð "
ð "
ð "
ð "
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_wrapperrO   r[   rj   ro   ©r(   rƒ   s     r)   Ú__init__zBatchesWithRawResponse.__init__â  sx   € ØˆŒå&Ô>ØŒNñ
ô 
ˆŒõ )Ô@ØÔñ
ô 
ˆŒõ %Ô<ØŒLñ
ô 
ˆŒ	õ 'Ô>ØŒNñ
ô 
ˆŒˆˆr+   N©rƒ   r   r#   r„   ©rs   rt   ru   rŠ   rw   r+   r)   r$   r$   á  ó(   € € € € € ð
ð 
ð 
ð 
ð 
ð 
r+   r$   c                  ó   — e Zd Zdd„ZdS )ry   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_wrapperrO   r[   rj   ro   r‰   s     r)   rŠ   z$AsyncBatchesWithRawResponse.__init__ô  sx   € ØˆŒå&ÔDØŒNñ
ô 
ˆŒõ )ÔFØÔñ
ô 
ˆŒõ %ÔBØŒLñ
ô 
ˆŒ	õ 'ÔDØŒNñ
ô 
ˆŒˆˆr+   N©rƒ   r    r#   r„   rŒ   rw   r+   r)   ry   ry   ó  r�   r+   ry   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   rO   r[   rj   ro   r‰   s     r)   rŠ   z%BatchesWithStreamingResponse.__init__  sl   € ØˆŒå2ØŒNñ
ô 
ˆŒõ 5ØÔñ
ô 
ˆŒõ 1ØŒLñ
ô 
ˆŒ	õ 3ØŒNñ
ô 
ˆŒˆˆr+   Nr‹   rŒ   rw   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   rO   r[   rj   ro   r‰   s     r)   rŠ   z*AsyncBatchesWithStreamingResponse.__init__  sl   € ØˆŒå8ØŒNñ
ô 
ˆŒõ ;ØÔñ
ô 
ˆŒõ 7ØŒLñ
ô 
ˆŒ	õ 9ØŒNñ
ô 
ˆŒˆˆr+   Nr‘   rŒ   rw   r+   r)   r{   r{     r�   r+   r{   )1Ú
__future__r   Útypingr   Útyping_extensionsr   ÚhttpxÚ 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$   ry   r,   r{   rw   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Ð
%€ða
ð a
ð a
ð a
ð a
ˆoñ a
ô a
ð a
ðHa
ð a
ð a
ð a
ð a
Ð#ñ a
ô a
ð a
ðH
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð$
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð$
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð$
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
r+   