Ë
    ñEj€H  ã                  óX  — d dl mZ d dlmZ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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)ÚDictÚ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Ú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 ©N)ÚBatchesWithRawResponse©Úselfs    ú[/var/www/html/peoplehubportal/venv/lib/python3.12/site-packages/openai/resources/batches.pyÚwith_raw_responsezBatches.with_raw_response   s   € ä% dÓ+Ð+ó    c                ó   — t        | «      S r    )Ú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/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 100 MB in size.

          metadata: Optional custom metadata for the 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,   r-   r.   r/   ©ÚbodyÚoptionsÚcast_to)Ú_postr   r
   ÚBatchCreateParamsr   r   ©	r#   r4   r5   r6   r+   r,   r-   r.   r/   s	            r$   ÚcreatezBatches.create'   s\   € ð\ �z‰zØÜ à):Ø (Ø%2Ø (ñ	ô $×5Ñ5óô )Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r&   r7   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/r7   ©r:   r;   ©Ú
ValueErrorÚ_getr   r   ©r#   Úbatch_idr,   r-   r.   r/   s         r$   ÚretrievezBatches.retrievef   sT   € ñ. ÜÐVÐW_ÐVbÐcÓdÐdØ�y‰yØ˜�zÐ"Ü(Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r&   ©ÚafterÚlimitr,   r-   r.   r/   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
        r2   )rL   rM   )r,   r-   r.   r/   Úquery)Úpager:   Úmodel)Ú_get_api_listr   r   r   r   r	   ÚBatchListParams©r#   rL   rM   r,   r-   r.   r/   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
        rB   rC   ú/cancelr7   rD   ©rF   r<   r   r   rH   s         r$   ÚcancelzBatches.cancel»   sV   € ñ4 ÜÐVÐW_ÐVbÐcÓdÐdØ�z‰zØ˜�z Ð)Ü(Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r&   )Úreturnr!   )r\   r(   ©r4   zLiteral['24h']r5   zDLiteral['/v1/chat/completions', '/v1/embeddings', '/v1/completions']r6   Ústrr+   z#Optional[Dict[str, str]] | NotGivenr,   úHeaders | Noner-   úQuery | Noner.   úBody | Noner/   ú'float | httpx.Timeout | None | NotGivenr\   r   ©rI   r^   r,   r_   r-   r`   r.   ra   r/   rb   r\   r   )rL   ústr | NotGivenrM   úint | NotGivenr,   r_   r-   r`   r.   ra   r/   rb   r\   zSyncCursorPage[Batch]©Ú__name__Ú
__module__Ú__qualname__r   r%   r)   r   r?   rJ   rV   r[   © r&   r$   r   r      sš  „ Øò,ó ð,ð ò2ó ð2ð 9Bð )-Ø$(Ø"&Ø;Dñ=
ð *ð=
ð Wð	=
ð
 ð=
ð 6ð=
ð &ð=
ð "ð=
ð  ð=
ð 9ð=
ð 
ó=
ðJ )-Ø$(Ø"&Ø;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   € ä0°Ó6Ð6r&   Nr*   c          
   ƒ  ó¸   K  — | j                  dt        ||||dœt        j                  «      ƒ d{  –—† t	        ||||¬«      t
        ¬«      ƒ d{  –—† S 7 Œ$7 Œ­w)r1   r2   r3   Nr7   r8   )r<   r   r
   r=   r   r   r>   s	            r$   r?   zAsyncBatches.createé   su   è ø€ ð\ —Z‘ZØÜ,à):Ø (Ø%2Ø (ñ	ô $×5Ñ5ó÷ ô )Ø+¸ÐQ[Ðelôô ð  ó 
÷ 
ð 	
ðøð
ús!   ‚/A±A
²AÁAÁAÁAr7   c          	   ƒ  óŽ   K  — |st        d|›�«      ‚| j                  d|› �t        ||||¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)rA   rB   rC   r7   rD   NrE   rH   s         r$   rJ   zAsyncBatches.retrieve(  sb   è ø€ ñ. ÜÐVÐW_ÐVbÐcÓdÐdØ—Y‘YØ˜�zÐ"Ü(Ø+¸ÐQ[Ðelôô ð ó 
÷ 
ð 	
ð 
ús   ‚<A¾A¿ArK   c               óœ   — | j                  dt        t           t        ||||t	        ||dœt
        j                  «      ¬«      t        ¬«      S rO   )rS   r   r   r   r   r	   rT   rU   s          r$   rV   zAsyncBatches.listI  s_   € ðB ×!Ñ!ØÜ ¤Ñ'Ü(Ø+Ø'Ø%ØÜ%à!&Ø!&ñô &×5Ñ5óôô ð! "ó 
ð 	
r&   c          	   ƒ  ó�   K  — |st        d|›�«      ‚| j                  d|› d�t        ||||¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)rX   rB   rC   rY   r7   rD   NrZ   rH   s         r$   r[   zAsyncBatches.cancel}  sd   è ø€ ñ4 ÜÐVÐW_ÐVbÐcÓdÐdØ—Z‘ZØ˜�z Ð)Ü(Ø+¸ÐQ[Ðelôô ð  ó 
÷ 
ð 	
ð 
ús   ‚=A¿AÁ A)r\   rm   )r\   ro   r]   rc   )rL   rd   rM   re   r,   r_   r-   r`   r.   ra   r/   rb   r\   z-AsyncPaginator[Batch, AsyncCursorPage[Batch]]rf   rj   r&   r$   r   r   à   sš  „ Øò1ó ð1ð ò7ó ð7ð 9Bð )-Ø$(Ø"&Ø;Dñ=
ð *ð=
ð Wð	=
ð
 ð=
ð 6ð=
ð &ð=
ð "ð=
ð  ð=
ð 9ð=
ð 
ó=
ðJ )-Ø$(Ø"&Ø;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 r    )Ú_batchesr   Úto_raw_response_wrapperr?   rJ   rV   r[   ©r#   Úbatchess     r$   Ú__init__zBatchesWithRawResponse.__init__£  su   € ØˆŒä&×>Ñ>Ø�N‰Nó
ˆŒô )×@Ñ@Ø×Ñó
ˆŒô %×<Ñ<Ø�L‰Ló
ˆŒ	ô '×>Ñ>Ø�N‰Nó
ˆ�r&   N©ry   r   r\   ÚNone©rg   rh   ri   rz   rj   r&   r$   r!   r!   ¢  ó   „ ô
r&   r!   c                  ó   — e Zd Zdd„Zy)rm   c                ó2  — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        t        j                  |j                  «      | _        y r    )rv   r   Úasync_to_raw_response_wrapperr?   rJ   rV   r[   rx   s     r$   rz   z$AsyncBatchesWithRawResponse.__init__µ  su   € ØˆŒä&×DÑDØ�N‰Nó
ˆŒô )×FÑFØ×Ñó
ˆŒô %×BÑBØ�L‰Ló
ˆŒ	ô '×DÑDØ�N‰Nó
ˆ�r&   N©ry   r   r\   r|   r}   rj   r&   r$   rm   rm   ´  r~   r&   rm   c                  ó   — e Zd Zdd„Zy)r(   c                óâ   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        y r    )rv   r   r?   rJ   rV   r[   rx   s     r$   rz   z%BatchesWithStreamingResponse.__init__Ç  s]   € ØˆŒä2Ø�N‰Nó
ˆŒô 5Ø×Ñó
ˆŒô 1Ø�L‰Ló
ˆŒ	ô 3Ø�N‰Nó
ˆ�r&   Nr{   r}   rj   r&   r$   r(   r(   Æ  r~   r&   r(   c                  ó   — e Zd Zdd„Zy)ro   c                óâ   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        y r    )rv   r   r?   rJ   rV   r[   rx   s     r$   rz   z*AsyncBatchesWithStreamingResponse.__init__Ù  s]   € ØˆŒä8Ø�N‰Nó
ˆŒô ;Ø×Ñó
ˆŒô 7Ø�L‰Ló
ˆŒ	ô 9Ø�N‰Nó
ˆ�r&   Nr‚   r}   rj   r&   r$   ro   ro   Ø  r~   r&   ro   )-Ú
__future__r   Útypingr   r   Ú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   Ú__all__r   r   r!   rm   r(   ro   rj   r&   r$   ú<module>r–      s�   ðõ #ç !Ý %ã å ß :ß >Õ >÷õ &ß 9ß Xß 8Ý ÷ð
 �nÐ
%€ô
ˆoô 
ôD
Ð#ô 
÷D
ñ 
÷$
ñ 
÷$
ñ 
÷$
ò 
r&   