
    ei
R                    h   S SK Jr  S SKJr  S SKJr  S SKrSSKJr  SSK	J
r
Jr  SSKJrJrJrJrJrJrJr  SS	KJrJr  SS
KJr  SSKJrJr  SSKJrJr  SSKJ r J!r!  SSK"J#r#  SSK$J%r%J&r&  SSK'J(r(  SS/r) " S S\5      r* " S S\5      r+ " S S5      r, " S S5      r- " S S5      r. " S S5      r/g)    )annotations)Optional)LiteralN   )_legacy_response)batch_list_paramsbatch_create_params)BodyOmitQueryHeadersNotGivenomit	not_given)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                     \ rS rSr\SS j5       r\SS j5       r\\SSS\S.                   SS jjr	SSS\S.           SS jjr
\\SSS\S	.             SS
 jjrSSS\S.           SS jjrSrg)r      c                    [        U 5      $ z
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    f/var/www/html/BTCUSD/btcusdt_trading_app/venv/lib/python3.13/site-packages/openai/resources/batches.pywith_raw_responseBatches.with_raw_response   s     &d++    c                    [        U 5      $ 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_responseBatches.with_streaming_response$   s     ,D11r*   Nmetadataoutput_expires_afterextra_headersextra_query
extra_bodytimeoutc       	        z    U R                  S[        UUUUUS.[        R                  5      [	        XgXS9[
        S9$ )  
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`,
      and `/v1/moderations` 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_idr1   r2   r3   r4   r5   r6   bodyoptionscast_to)_postr   r	   BatchCreateParamsr   r   
r&   r;   r<   r=   r1   r2   r3   r4   r5   r6   s
             r'   createBatches.create-   sZ    t zz ): (%2 (,@ $55	 )+Q[   
 	
r*   r>   c          
     n    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9$ )  
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/r>   rA   rB   
ValueError_getr   r   r&   batch_idr3   r4   r5   r6   s         r'   retrieveBatches.retrievey   sO    . VW_Vbcddyyz"(+Q[   
 	
r*   afterlimitr3   r4   r5   r6   c                   U R                  S[        [           [        UUUU[	        UUS.[
        R                  5      S9[        S9$ 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
r9   )rU   rV   )r3   r4   r5   r6   query)pagerA   model)_get_api_listr   r   r   r   r   BatchListParamsr&   rU   rV   r3   r4   r5   r6   s          r'   listBatches.list   s_    B !!&(+'%%!&!& &55 ! " 
 	
r*   c          
     p    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9$ )  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
rJ   rK   /cancelr>   rL   rN   rC   r   r   rP   s         r'   cancelBatches.cancel   sQ    4 VW_Vbcddzzz)(+Q[   
 	
r*    )returnr$   )rh   r-   r;   zLiteral['24h']r<   zhLiteral['/v1/responses', '/v1/chat/completions', '/v1/embeddings', '/v1/completions', '/v1/moderations']r=   strr1   zOptional[Metadata] | Omitr2   z-batch_create_params.OutputExpiresAfter | Omitr3   Headers | Noner4   Query | Noner5   Body | Noner6   'float | httpx.Timeout | None | NotGivenrh   r   rQ   rj   r3   rk   r4   rl   r5   rm   r6   rn   rh   r   )rU   
str | OmitrV   
int | Omitr3   rk   r4   rl   r5   rm   r6   rn   rh   zSyncCursorPage[Batch]__name__
__module____qualname____firstlineno__r   r(   r.   r   r   rF   rR   r_   re   __static_attributes__rg   r*   r'   r   r      s   , , 2 2  /3NR )-$("&;DJ
 *J

	J
 J
 ,J
 LJ
 &J
 "J
  J
 9J
  
!J
d )-$("&;D

 &
 "
  
 9
 

H !  )-$("&;D2
 2
 	2
 &2
 "2
  2
 92
 
2
t )-$("&;D"
"
 &"
 ""
  "
 9"
 
"
 "
r*   c                     \ rS rSr\SS j5       r\SS j5       r\\SSS\S.                   SS jjr	SSS\S.           SS jjr
\\SSS\S	.             SS
 jjrSSS\S.           SS jjrSrg)r      c                    [        U 5      $ r#   )AsyncBatchesWithRawResponser%   s    r'   r(   AsyncBatches.with_raw_response   s     +400r*   c                    [        U 5      $ r,   )!AsyncBatchesWithStreamingResponser%   s    r'   r.   $AsyncBatches.with_streaming_response   s     166r*   Nr0   c       	           #    U R                  S[        UUUUUS.[        R                  5      I Sh  vN [	        XgXS9[
        S9I Sh  vN $  N N7f)r8   r9   r:   Nr>   r?   )rC   r   r	   rD   r   r   rE   s
             r'   rF   AsyncBatches.create  sq     t ZZ,): (%2 (,@ $55	 	 )+Q[    
 
 	
	
s!   0AA
A
AAAr>   c          
        #    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9I Sh  vN $  N7f)rI   rJ   rK   r>   rL   NrM   rP   s         r'   rR   AsyncBatches.retrieveS  s\     . VW_VbcddYYz"(+Q[   
 
 	
 
s   :AAArT   c                   U R                  S[        [           [        UUUU[	        UUS.[
        R                  5      S9[        S9$ rX   )r\   r   r   r   r   r   r]   r^   s          r'   r_   AsyncBatches.listt  s_    B !! '(+'%%!&!& &55 ! " 
 	
r*   c          
        #    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9I Sh  vN $  N7f)rb   rJ   rK   rc   r>   rL   Nrd   rP   s         r'   re   AsyncBatches.cancel  s^     4 VW_VbcddZZz)(+Q[    
 
 	
 
s   ;AAArg   )rh   r{   )rh   r~   ri   ro   )rU   rp   rV   rq   r3   rk   r4   rl   r5   rm   r6   rn   rh   z-AsyncPaginator[Batch, AsyncCursorPage[Batch]]rr   rg   r*   r'   r   r      s   1 1 7 7  /3NR )-$("&;DJ
 *J

	J
 J
 ,J
 LJ
 &J
 "J
  J
 9J
  
!J
d )-$("&;D

 &
 "
  
 9
 

H !  )-$("&;D2
 2
 	2
 &2
 "2
  2
 92
 
72
t )-$("&;D"
"
 &"
 ""
  "
 9"
 
"
 "
r*   c                      \ rS rSrSS jrSrg)r$   i  c                8   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        g N)_batchesr   to_raw_response_wrapperrF   rR   r_   re   r&   batchess     r'   __init__BatchesWithRawResponse.__init__  ss    &>>NN
 )@@
 %<<LL
	 '>>NN
r*   r   re   rF   r_   rR   Nr   r   rh   Noners   rt   ru   rv   r   rw   rg   r*   r'   r$   r$         
r*   r$   c                      \ rS rSrSS jrSrg)r{   i  c                8   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        g r   )r   r   async_to_raw_response_wrapperrF   rR   r_   re   r   s     r'   r   $AsyncBatchesWithRawResponse.__init__  ss    &DDNN
 )FF
 %BBLL
	 'DDNN
r*   r   Nr   r   rh   r   r   rg   r*   r'   r{   r{     r   r*   r{   c                      \ rS rSrSS jrSrg)r-   i  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        g r   )r   r   rF   rR   r_   re   r   s     r'   r   %BatchesWithStreamingResponse.__init__  s[    2NN
 5
 1LL
	 3NN
r*   r   Nr   r   rg   r*   r'   r-   r-     r   r*   r-   c                      \ rS rSrSS jrSrg)r~   i  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        g r   )r   r   rF   rR   r_   re   r   s     r'   r   *AsyncBatchesWithStreamingResponse.__init__  s[    8NN
 ;
 7LL
	 9NN
r*   r   Nr   r   rg   r*   r'   r~   r~     r   r*   r~   )0
__future__r   typingr   typing_extensionsr   httpx r   typesr   r	   _typesr
   r   r   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$   r{   r-   r~   rg   r*   r'   <module>r      s    #  %   : J J J ; % 9 X 8  ? 3n
%W
o W
tW
# W
t
 
$
 
$
 
$
 
r*   