Ë
    ¼ßÍiáT  ã                  ól  — 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«      Z0y)é    )Ú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y)r   ú;Create large batches of API requests to run asynchronously.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    úd/root/rosshost/parking-map/parking-api/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`, `/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©Úcompletion_windowÚendpointÚinput_file_idr0   r1   ©r2   r3   r4   r5   ©ÚbodyÚoptionsÚcast_to)Ú_postr   r	   ÚBatchCreateParamsr   r   ©
r'   r:   r;   r<   r0   r1   r2   r3   r4   r5   s
             r(   ÚcreatezBatches.create/   s_   € ðD �z‰zØÜ à):Ø (Ø%2Ø (Ø,@ñô $×5Ñ5ó	ô )Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r*   r=   c          	     ó‚   — |st        d|›�«      ‚| j                  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}©Úbatch_idr=   ©r@   rA   ©Ú
ValueErrorÚ_getr   r   r   ©r'   rK   r2   r3   r4   r5   s         r(   ÚretrievezBatches.retrieveƒ   sU   € ñ. ÜÐVÐW_ÐVbÐcÓdÐdØ�y‰yÜÐ/¸(ÔCÜ(Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r*   ©ÚafterÚlimitr2   r3   r4   r5   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
        r8   )rS   rT   )r2   r3   r4   r5   Úquery)Úpager@   Úmodel)Ú_get_api_listr   r   r   r   r   ÚBatchListParams©r'   rS   rT   r2   r3   r4   r5   s          r(   ÚlistzBatches.list¤   s_   € ðB ×!Ñ!ØÜ¤Ñ&Ü(Ø+Ø'Ø%ØÜ%à!&Ø!&ñô &×5Ñ5óôô ð! "ó 
ð 	
r*   c          	     ó‚   — |st        d|›�«      ‚| j                  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
        rH   ú/batches/{batch_id}/cancelrJ   r=   rL   ©rN   rB   r   r   r   rP   s         r(   ÚcancelzBatches.cancelØ   sU   € ñ4 ÜÐVÐW_ÐVbÐcÓdÐdØ�z‰zÜÐ6ÀÔJÜ(Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r*   )Úreturnr%   )rc   r-   ©r:   zLiteral['24h']r;   z¤Literal['/v1/responses', '/v1/chat/completions', '/v1/embeddings', '/v1/completions', '/v1/moderations', '/v1/images/generations', '/v1/images/edits', '/v1/videos']r<   Ústrr0   zOptional[Metadata] | Omitr1   z-batch_create_params.OutputExpiresAfter | Omitr2   úHeaders | Noner3   úQuery | Noner4   úBody | Noner5   ú'float | httpx.Timeout | None | NotGivenrc   r   ©rK   re   r2   rf   r3   rg   r4   rh   r5   ri   rc   r   )rS   ú
str | OmitrT   ú
int | Omitr2   rf   r3   rg   r4   rh   r5   ri   rc   zSyncCursorPage[Batch]©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r)   r.   r   r   rE   rQ   r]   rb   © r*   r(   r   r      s´  „ ÙEàò,ó ð,ð ò2ó ð2ð. /3ØNRð )-Ø$(Ø"&Ø;Dñ-R
ð *ðR
ð	
ð	R
ð ðR
ð ,ðR
ð  Lð!R
ð& &ð'R
ð( "ð)R
ð*  ð+R
ð, 9ð-R
ð. 
ó/R
ðt )-Ø$(Ø"&Ø;Dñ
àð
ð &ð
ð "ð
ð  ð
ð 9ð
ð 
ó
ðH !Ø ð )-Ø$(Ø"&Ø;Dñ2
ð ð2
ð ð	2
ð &ð2
ð "ð2
ð  ð2
ð 9ð2
ð 
ó2
ðt )-Ø$(Ø"&Ø;Dñ"
àð"
ð &ð"
ð "ð"
ð  ð"
ð 9ð"
ð 
ô"
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y)r    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)r7   r8   r9   Nr=   r>   )rB   r   r	   rC   r   r   rD   s
             r(   rE   zAsyncBatches.create  sx   è ø€ ðD —Z‘ZØÜ,à):Ø (Ø%2Ø (Ø,@ñô $×5Ñ5ó	÷ 	ô )Ø+¸ÐQ[Ðelôô ð  ó 
÷ 
ð 	
ð	øð
ús!   ‚0A²A
³AÁAÁAÁAr=   c          	   ƒ  óž   K  — |st        d|›�«      ‚| j                  t        d|¬«      t        ||||¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)rG   rH   rI   rJ   r=   rL   NrM   rP   s         r(   rQ   zAsyncBatches.retrieveg  sc   è ø€ ñ. ÜÐVÐW_ÐVbÐcÓdÐdØ—Y‘YÜÐ/¸(ÔCÜ(Ø+¸ÐQ[Ðelôô ð ó 
÷ 
ð 	
ð 
úó   ‚AAÁAÁArR   c               óœ   — | j                  dt        t           t        ||||t	        ||dœt
        j                  «      ¬«      t        ¬«      S rV   )rZ   r   r   r   r   r   r[   r\   s          r(   r]   zAsyncBatches.listˆ  s_   € ðB ×!Ñ!ØÜ ¤Ñ'Ü(Ø+Ø'Ø%ØÜ%à!&Ø!&ñô &×5Ñ5óôô ð! "ó 
ð 	
r*   c          	   ƒ  óž   K  — |st        d|›�«      ‚| j                  t        d|¬«      t        ||||¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)r_   rH   r`   rJ   r=   rL   Nra   rP   s         r(   rb   zAsyncBatches.cancel¼  sc   è ø€ ñ4 ÜÐVÐW_ÐVbÐcÓdÐdØ—Z‘ZÜÐ6ÀÔJÜ(Ø+¸ÐQ[Ðelôô ð  ó 
÷ 
ð 	
ð 
úrz   )rc   ru   )rc   rw   rd   rj   )rS   rk   rT   rl   r2   rf   r3   rg   r4   rh   r5   ri   rc   z-AsyncPaginator[Batch, AsyncCursorPage[Batch]]rm   rr   r*   r(   r    r    ý   s´  „ ÙEàò1ó ð1ð ò7ó ð7ð. /3ØNRð )-Ø$(Ø"&Ø;Dñ-R
ð *ðR
ð	
ð	R
ð ðR
ð ,ðR
ð  Lð!R
ð& &ð'R
ð( "ð)R
ð*  ð+R
ð, 9ð-R
ð. 
ó/R
ð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_wrapperrE   rQ   r]   rb   ©r'   Úbatchess     r(   Ú__init__zBatchesWithRawResponse.__init__â  su   € ØˆŒä&×>Ñ>Ø�N‰Nó
ˆŒô )×@Ñ@Ø×Ñó
ˆŒô %×<Ñ<Ø�L‰Ló
ˆŒ	ô '×>Ñ>Ø�N‰Nó
ˆ�r*   N©rƒ   r   rc   ÚNone©rn   ro   rp   r„   rr   r*   r(   r%   r%   á  ó   „ ô
r*   r%   c                  ó   — e Zd Zdd„Zy)ru   c                ó2  — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        t        j                  |j                  «      | _        y r   )r€   r   Úasync_to_raw_response_wrapperrE   rQ   r]   rb   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    rc   r†   r‡   rr   r*   r(   ru   ru   ó  rˆ   r*   ru   c                  ó   — e Zd Zdd„Zy)r-   c                óâ   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        y r   )r€   r   rE   rQ   r]   rb   r‚   s     r(   r„   z%BatchesWithStreamingResponse.__init__  s]   € ØˆŒä2Ø�N‰Nó
ˆŒô 5Ø×Ñó
ˆŒô 1Ø�L‰Ló
ˆŒ	ô 3Ø�N‰Nó
ˆ�r*   Nr…   r‡   rr   r*   r(   r-   r-     rˆ   r*   r-   c                  ó   — e Zd Zdd„Zy)rw   c                óâ   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        y r   )r€   r   rE   rQ   r]   rb   r‚   s     r(   r„   z*AsyncBatchesWithStreamingResponse.__init__  s]   € ØˆŒä8Ø�N‰Nó
ˆŒô ;Ø×Ñó
ˆŒô 7Ø�L‰Ló
ˆŒ	ô 9Ø�N‰Nó
ˆ�r*   NrŒ   r‡   rr   r*   r(   rw   rw     rˆ   r*   rw   )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%   ru   r-   rw   rr   r*   r(   ú<module>r¡      sŽ   ðõ #å Ý %ã å ß :ß J× JÑ Jß JÑ JÝ %ß 9ß Xß 8Ý ß ?Ý 3à�nÐ
%€ôa
ˆoô a
ôHa
Ð#ô a
÷H
ñ 
÷$
ñ 
÷$
ñ 
÷$
ò 
r*   