
    >'hK                       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mZ ddlmZ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mZmZm Z m!Z!m"Z"m#Z#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l0m1Z1 ddgZ2 G d de      Z3 G d de      Z4 G d d      Z5 G d d      Z6 G d d      Z7 G d d      Z8y)    )annotations)Mappingcast)LiteralN   )file_create_params)	NOT_GIVENBodyQueryHeadersNotGiven	FileTypes)extract_filesmaybe_transformdeepcopy_minimalasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)BinaryAPIResponseAsyncBinaryAPIResponseStreamedBinaryAPIResponseAsyncStreamedBinaryAPIResponseto_raw_response_wrapperto_streamed_response_wrapperasync_to_raw_response_wrapperto_custom_raw_response_wrapper"async_to_streamed_response_wrapper#to_custom_streamed_response_wrapper$async_to_custom_raw_response_wrapper)async_to_custom_streamed_response_wrapper)make_request_options)FileInfoResponse)FileListResponse)FileCreateResponse)FileDeleteResponseFiles
AsyncFilesc                     e Zd Zed
d       Ze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	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
        )FilesWithRawResponseselfs    [/home/kushmeetdev/Regenta/Chatbot/venv/lib/python3.12/site-packages/groq/resources/files.pywith_raw_responsezFiles.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
        )FilesWithStreamingResponser-   s    r/   with_streaming_responsezFiles.with_streaming_response1   s     *$//r1   Nextra_headersextra_query
extra_bodytimeoutc                  t        ||d      }t        t        t        t        t
        f   |      dgg      }ddi|xs i }| j                  dt        |t        j                        |t        ||||      t              S )	  
        Upload a file that can be used across various endpoints.

        The Batch API only supports `.jsonl` files up to 100 MB in size. The input also
        has a specific required [format](/docs/batch).

        Please contact us if you need to increase these storage limits.

        Args:
          file: The File object (not file name) to be uploaded.

          purpose: The intended purpose of the uploaded file. Use "batch" for
              [Batch API](/docs/api-reference#batches).

          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
        filepurposer>   pathsContent-Typemultipart/form-data/openai/v1/filesr6   bodyfilesoptionscast_to)r   r   r   r   strobject_postr   r   FileCreateParamsr"   r%   	r.   r>   r?   r7   r8   r9   r:   rF   rG   s	            r/   createzFiles.create:   s    D  "
 d73;#7>xjQ ()>X=CVTVXzz '9'J'JK(+Q[el '  
 	
r1   c          	     L    | j                  dt        ||||      t              S )Returns a list of files.rD   r6   rH   rI   _getr"   r$   r.   r7   r8   r9   r:   s        r/   listz
Files.listq   s5     yy(+Q[el %  
 	
r1   c          	     r    |st        d|      | j                  d| t        ||||      t              S )B  
        Delete a 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
        6Expected a non-empty value for `file_id` but received /openai/v1/files/r6   rR   
ValueError_deleter"   r&   r.   file_idr7   r8   r9   r:   s         r/   deletezFiles.delete   sT    . UV]U`abb||y)(+Q[el '  
 	
r1   c          	         |st        d|      ddi|xs i }| j                  d| dt        ||||      t              S )_  
        Returns the contents of the specified 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
        rY   Acceptapplication/octet-streamrZ   /contentr6   rR   )r\   rT   r"   r   r^   s         r/   contentzFiles.content   sl    . UV]U`abb!#=W-BUSUWyyy1(+Q[el &  
 	
r1   c          	     r    |st        d|      | j                  d| t        ||||      t              S )U  
        Returns information about a 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
        rY   rZ   r6   rR   r\   rT   r"   r#   r^   s         r/   infoz
Files.info   sT    . UV]U`abbyyy)(+Q[el %  
 	
r1   )returnr,   )rk   r4   r>   r   r?   zLiteral['batch']r7   Headers | Noner8   Query | Noner9   Body | Noner:   'float | httpx.Timeout | None | NotGivenrk   r%   
r7   rm   r8   rn   r9   ro   r:   rp   rk   r$   r_   rJ   r7   rm   r8   rn   r9   ro   r:   rp   rk   r&   )r_   rJ   r7   rm   r8   rn   r9   ro   r:   rp   rk   r   r_   rJ   r7   rm   r8   rn   r9   ro   r:   rp   rk   r#   __name__
__module____qualname__r   r0   r5   r	   rO   rV   r`   rf   rj    r1   r/   r'   r'   &   s   * * 0 0 )-$("&;D5
 5
 "	5
 &5
 "5
  5
 95
 
5
x )-$("&;D

 &
 "
  
 9
 

2 )-$("&;D

 &
 "
  
 9
 

N )-$("&;D 
 
 & 
 " 
   
 9 
 
 
P )-$("&;D

 &
 "
  
 9
 

r1   c                     e Zd Zed
d       Ze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	ddded	 	 	 	 	 	 	 	 	 	 	 ddZ
ddded	 	 	 	 	 	 	 	 	 	 	 dd	Zy)r(   c                    t        |       S r+   )AsyncFilesWithRawResponser-   s    r/   r0   zAsyncFiles.with_raw_response   s     )..r1   c                    t        |       S r3   )AsyncFilesWithStreamingResponser-   s    r/   r5   z"AsyncFiles.with_streaming_response   s     /t44r1   Nr6   c               4  K   t        ||d      }t        t        t        t        t
        f   |      dgg      }ddi|xs i }| j                  dt        |t        j                         d{   |t        ||||      t        	       d{   S 7 %7 w)
r<   r=   r>   r@   rB   rC   rD   Nr6   rE   )r   r   r   r   rJ   rK   rL   r   r   rM   r"   r%   rN   s	            r/   rO   zAsyncFiles.create   s     D  "
 d73;#7>xjQ ()>X=CVTVXZZ,T3E3V3VWW(+Q[el '   
 
 	
W
s$   A,B.B
/ BBBBc          	     h   K   | j                  dt        ||||      t               d{   S 7 w)rQ   rD   r6   rR   NrS   rU   s        r/   rV   zAsyncFiles.list4  sC      YY(+Q[el %  
 
 	
 
s   )202c          	        K   |st        d|      | j                  d| t        ||||      t               d{   S 7 w)rX   rY   rZ   r6   rR   Nr[   r^   s         r/   r`   zAsyncFiles.deleteG  sb     . UV]U`abb\\y)(+Q[el ' " 
 
 	
 
   <AAAc          	        K   |st        d|      ddi|xs i }| j                  d| dt        ||||      t               d{   S 7 w)	rb   rY   rc   rd   rZ   re   r6   rR   N)r\   rT   r"   r   r^   s         r/   rf   zAsyncFiles.contenth  sz     . UV]U`abb!#=W-BUSUWYYy1(+Q[el +  
 
 	
 
s   AA	A
Ac          	        K   |st        d|      | j                  d| t        ||||      t               d{   S 7 w)rh   rY   rZ   r6   rR   Nri   r^   s         r/   rj   zAsyncFiles.info  sb     . UV]U`abbYYy)(+Q[el %  
 
 	
 
r   )rk   r{   )rk   r}   rl   rq   rr   )r_   rJ   r7   rm   r8   rn   r9   ro   r:   rp   rk   r   rs   rt   rx   r1   r/   r(   r(      s   / / 5 5 )-$("&;D5
 5
 "	5
 &5
 "5
  5
 95
 
5
x )-$("&;D

 &
 "
  
 9
 

2 )-$("&;D

 &
 "
  
 9
 

N )-$("&;D 
 
 & 
 " 
   
 9 
 
  
P )-$("&;D

 &
 "
  
 9
 

r1   c                      e Zd ZddZy)r,   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j                  t              | _        t        |j                        | _        y N)	_filesr   rO   rV   r`   r   rf   r   rj   r.   rG   s     r/   __init__zFilesWithRawResponse.__init__  ss    -LL
 ,JJ
	 .LL
 6MM
 ,JJ
	r1   NrG   r'   rk   Noneru   rv   rw   r   rx   r1   r/   r,   r,         
r1   r,   c                      e Zd ZddZy)r{   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j                  t              | _        t        |j                        | _        y r   )	r   r   rO   rV   r`   r    rf   r   rj   r   s     r/   r   z"AsyncFilesWithRawResponse.__init__  ss    3LL
 2JJ
	 4LL
 <MM"
 2JJ
	r1   NrG   r(   rk   r   r   rx   r1   r/   r{   r{     r   r1   r{   c                      e Zd ZddZy)r4   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j                  t              | _        t        |j                        | _        y r   )	r   r   rO   rV   r`   r   rf   r   rj   r   s     r/   r   z#FilesWithStreamingResponse.__init__  ss    2LL
 1JJ
	 3LL
 ;MM%
 1JJ
	r1   Nr   r   rx   r1   r/   r4   r4     r   r1   r4   c                      e Zd ZddZy)r}   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j                  t              | _        t        |j                        | _        y r   )	r   r   rO   rV   r`   r!   rf   r   rj   r   s     r/   r   z(AsyncFilesWithStreamingResponse.__init__  st    8LL
 7JJ
	 9LL
 AMM*
 7JJ
	r1   Nr   r   rx   r1   r/   r}   r}     r   r1   r}   )9
__future__r   typingr   r   typing_extensionsr   httpxtypesr   _typesr	   r
   r   r   r   r   _utilsr   r   r   r   _compatr   	_resourcer   r   	_responser   r   r   r   r   r   r   r   r   r   r    r!   _base_clientr"   types.file_info_responser#   types.file_list_responser$   types.file_create_responser%   types.file_delete_responser&   __all__r'   r(   r,   r{   r4   r}   rx   r1   r/   <module>r      s    #   %  & I I \ \ % 9    0 7 7 ; ;L
!@
O @
F@
! @
F
 
,
 
,
 
,
 
r1   