
    >'h?                    `   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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mZmZ ddlmZ ddlm Z  ddl!m"Z" ddl#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      Z-y)    )annotations)DictOptional)LiteralN   )batch_create_params)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperto_streamed_response_wrapperasync_to_raw_response_wrapper"async_to_streamed_response_wrapper)make_request_options)BatchListResponse)BatchCancelResponse)BatchCreateResponse)BatchRetrieveResponse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ddded	 	 	 	 	 	 	 	 	 ddZ	ddded	 	 	 	 	 	 	 	 	 	 	 dd	Z
y)r   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/groq/groq-python#accessing-raw-response-data-eg-headers
        )BatchesWithRawResponseselfs    ]/home/kushmeetdev/Regenta/Chatbot/venv/lib/python3.12/site-packages/groq/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/groq/groq-python#with_streaming_response
        )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.
        [Learn more](/docs/batch).

        Args:
          completion_window: The time frame within which the batch should be processed. Durations from `24h`
              to `7d` are supported.

          endpoint: The endpoint to be used for all requests in the batch. Currently
              `/v1/chat/completions` is supported.

          input_file_id: The ID of an uploaded file that contains requests for the new batch.

              See [upload file](/docs/api-reference#files-upload) for how to upload a file.

              Your input file must be formatted as a [JSONL file](/docs/batch), and must be
              uploaded with the purpose `batch`. The file 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
        /openai/v1/batchescompletion_windowendpointinput_file_idr,   r-   r.   r/   r0   bodyoptionscast_to)_postr   r   BatchCreateParamsr   r   	r#   r5   r6   r7   r,   r-   r.   r/   r0   s	            r$   createzBatches.create2   s\    T zz  ): (%2 (	 $55 )+Q[el (  
 	
r&   r8   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 /openai/v1/batches/r8   r;   r<   
ValueError_getr   r   r#   batch_idr-   r.   r/   r0   s         r$   retrievezBatches.retrievem   sT    . VW_Vbcddyy!(,(+Q[el *  
 	
r&   c          	     L    | j                  dt        ||||      t              S )!List your organization's batches.r3   r8   rE   rH   r   r   r#   r-   r.   r/   r0   s        r$   listzBatches.list   s5     yy (+Q[el &  
 	
r&   c          	     t    |st        d|      | j                  d| dt        ||||      t              S )D  
        Cancels 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
        rC   rD   /cancelr8   rE   rG   r=   r   r   rI   s         r$   cancelzBatches.cancel   sV    . VW_Vbcddzz!(73(+Q[el (  
 	
r&   )returnr!   )rV   r)   r5   strr6   zLiteral['/v1/chat/completions']r7   rX   r,   z#Optional[Dict[str, str]] | NotGivenr-   Headers | Noner.   Query | Noner/   Body | Noner0   'float | httpx.Timeout | None | NotGivenrV   r   rJ   rX   r-   rY   r.   rZ   r/   r[   r0   r\   rV   r   
r-   rY   r.   rZ   r/   r[   r0   r\   rV   r   rJ   rX   r-   rY   r.   rZ   r/   r[   r0   r\   rV   r   __name__
__module____qualname__r   r%   r*   r	   r@   rK   rP   rU    r&   r$   r   r      s|   , , 2 2 9B )-$("&;D9
 9
 2	9

 9
 69
 &9
 "9
  9
 99
 
9
B )-$("&;D

 &
 "
  
 9
 

L )-$("&;D

 &
 "
  
 9
 

2 )-$("&;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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     166r&   Nr+   c          
        K   | j                  dt        ||||dt        j                         d{   t	        ||||      t
               d{   S 7 $7 w)r2   r3   r4   Nr8   r9   )r=   r   r   r>   r   r   r?   s	            r$   r@   zAsyncBatches.create   su     T ZZ ,): (%2 (	 $55  )+Q[el (   
 
 	

s!   /AA
AAAAr8   c          	        K   |st        d|      | j                  d| t        ||||      t               d{   S 7 w)rB   rC   rD   r8   rE   NrF   rI   s         r$   rK   zAsyncBatches.retrieve  sb     . VW_VbcddYY!(,(+Q[el *  
 
 	
 
s   <AAAc          	     h   K   | j                  dt        ||||      t               d{   S 7 w)rM   r3   r8   rE   NrN   rO   s        r$   rP   zAsyncBatches.list3  sC      YY (+Q[el &  
 
 	
 
s   )202c          	        K   |st        d|      | j                  d| dt        ||||      t               d{   S 7 w)rR   rC   rD   rS   r8   rE   NrT   rI   s         r$   rU   zAsyncBatches.cancelF  sd     . VW_VbcddZZ!(73(+Q[el (   
 
 	
 
s   =AA A)rV   rg   )rV   ri   rW   r]   r^   r_   r`   rd   r&   r$   r   r      s|   1 1 7 7 9B )-$("&;D9
 9
 2	9

 9
 69
 &9
 "9
  9
 99
 
9
B )-$("&;D

 &
 "
  
 9
 

L )-$("&;D

 &
 "
  
 9
 

2 )-$("&;D

 &
 "
  
 9
 

r&   c                      e Zd ZddZy)r!   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y N)_batchesr   r@   rK   rP   rU   r#   batchess     r$   __init__zBatchesWithRawResponse.__init__i  s]    -NN
 0
 ,LL
	 .NN
r&   Nrs   r   rV   Nonera   rb   rc   rt   rd   r&   r$   r!   r!   h      
r&   r!   c                      e Zd ZddZy)rg   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y rp   )rq   r   r@   rK   rP   rU   rr   s     r$   rt   z$AsyncBatchesWithRawResponse.__init__{  s]    3NN
 6
 2LL
	 4NN
r&   Nrs   r   rV   rv   rw   rd   r&   r$   rg   rg   z  rx   r&   rg   c                      e Zd ZddZy)r)   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y rp   )rq   r   r@   rK   rP   rU   rr   s     r$   rt   z%BatchesWithStreamingResponse.__init__  s]    2NN
 5
 1LL
	 3NN
r&   Nru   rw   rd   r&   r$   r)   r)     rx   r&   r)   c                      e Zd ZddZy)ri   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y rp   )rq   r   r@   rK   rP   rU   rr   s     r$   rt   z*AsyncBatchesWithStreamingResponse.__init__  s]    8NN
 ;
 7LL
	 9NN
r&   Nr{   rw   rd   r&   r$   ri   ri     rx   r&   ri   ).
__future__r   typingr   r   typing_extensionsr   httpxtypesr   _typesr	   r
   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   r   r   _base_clientr   types.batch_list_responser   types.batch_cancel_responser   types.batch_create_responser   types.batch_retrieve_responser   __all__r   r   r!   rg   r)   ri   rd   r&   r$   <module>r      s    # ! %  ' > > ; % 9  0 9 = = An
%b
o b
Jb
# b
J
 
$
 
$
 
$
 
r&   