
    %GgI                    l   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 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      Z0y)    )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)to_raw_response_wrapperto_streamed_response_wrapperasync_to_raw_response_wrapper"async_to_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    q/home/kushmeetdev/apache_webroot/langgraph_flaskproject/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_response.   s     *$//r)   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purposer6   pathsContent-Typemultipart/form-data/openai/v1/filesr.   bodyfilesoptionscast_to)r   r   r   r   strobject_postr   r   FileCreateParamsr   r   	r&   r6   r7   r/   r0   r1   r2   r>   r?   s	            r'   createzFiles.create7   s    D  "
 d73;#7>xjQ ()>X=CVTVXzz '9'J'JK(+Q[el '  
 	
r)   c          	     L    | j                  dt        ||||      t              S )Returns a list of files.r<   r.   r@   rA   _getr   r   r&   r/   r0   r1   r2   s        r'   listz
Files.listn   s5     yy(+Q[el %  
 	
r)   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/r.   rJ   
ValueError_deleter   r   r&   file_idr/   r0   r1   r2   s         r'   deletezFiles.delete   sT    . UV]U`abb||y)(+Q[el '  
 	
r)   c          	     t    |st        d|      | 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
        rQ   rR   /contentr.   rJ   rT   rL   r   rB   rV   s         r'   contentzFiles.content   sV    . UV]U`abbyyy1(+Q[el   
 	
r)   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
        rQ   rR   r.   rJ   rT   rL   r   r   rV   s         r'   infoz
Files.info   sT    . UV]U`abbyyy)(+Q[el %  
 	
r)   )returnr$   )rb   r,   r6   r   r7   zLiteral['batch']r/   Headers | Noner0   Query | Noner1   Body | Noner2   'float | httpx.Timeout | None | NotGivenrb   r   
r/   rd   r0   re   r1   rf   r2   rg   rb   r   rW   rB   r/   rd   r0   re   r1   rf   r2   rg   rb   r   rW   rB   r/   rd   r0   re   r1   rf   r2   rg   rb   rB   rW   rB   r/   rd   r0   re   r1   rf   r2   rg   rb   r   __name__
__module____qualname__r   r(   r-   r	   rG   rN   rX   r]   ra    r)   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
 

N )-$("&;D

 &
 "
  
 9
 

r)   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'   r(   zAsyncFiles.with_raw_response   s     )..r)   c                    t        |       S r+   )AsyncFilesWithStreamingResponser%   s    r'   r-   z"AsyncFiles.with_streaming_response   s     /t44r)   Nr.   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)
r4   r5   r6   r8   r:   r;   r<   Nr.   r=   )r   r   r   r   rB   rC   rD   r   r   rE   r   r   rF   s	            r'   rG   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)rI   r<   r.   rJ   NrK   rM   s        r'   rN   zAsyncFiles.list0  sC      YY(+Q[el %  
 
 	
 
s   )202c          	        K   |st        d|      | j                  d| t        ||||      t               d{   S 7 w)rP   rQ   rR   r.   rJ   NrS   rV   s         r'   rX   zAsyncFiles.deleteC  sb     . UV]U`abb\\y)(+Q[el ' " 
 
 	
 
   <AAAc          	        K   |st        d|      | j                  d| dt        ||||      t               d{   S 7 w)rZ   rQ   rR   r[   r.   rJ   Nr\   rV   s         r'   r]   zAsyncFiles.contentd  sd     . UV]U`abbYYy1(+Q[el   
 
 	
 
s   =AA Ac          	        K   |st        d|      | j                  d| t        ||||      t               d{   S 7 w)r_   rQ   rR   r.   rJ   Nr`   rV   s         r'   ra   zAsyncFiles.info  sb     . UV]U`abbYYy)(+Q[el %  
 
 	
 
ry   )rb   rs   )rb   ru   rc   rh   ri   rj   rk   rl   rp   r)   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
 

N )-$("&;D

 &
 "
  
 9
 

r)   c                      e Zd ZddZy)r$   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y N)_filesr   rG   rN   rX   r]   ra   r&   r?   s     r'   __init__zFilesWithRawResponse.__init__  sp    -LL
 ,JJ
	 .LL
 /MM
 ,JJ
	r)   Nr?   r   rb   Nonerm   rn   ro   r   rp   r)   r'   r$   r$         
r)   r$   c                      e Zd ZddZy)rs   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r~   )r   r   rG   rN   rX   r]   ra   r   s     r'   r   z"AsyncFilesWithRawResponse.__init__  sp    3LL
 2JJ
	 4LL
 5MM
 2JJ
	r)   Nr?   r    rb   r   r   rp   r)   r'   rs   rs     r   r)   rs   c                      e Zd ZddZy)r,   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r~   )r   r   rG   rN   rX   r]   ra   r   s     r'   r   z#FilesWithStreamingResponse.__init__  sp    2LL
 1JJ
	 3LL
 4MM
 1JJ
	r)   Nr   r   rp   r)   r'   r,   r,     r   r)   r,   c                      e Zd ZddZy)ru   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r~   )r   r   rG   rN   rX   r]   ra   r   s     r'   r   z(AsyncFilesWithStreamingResponse.__init__  sp    8LL
 7JJ
	 9LL
 :MM
 7JJ
	r)   Nr   r   rp   r)   r'   ru   ru     r   r)   ru   )1
__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   _base_clientr   types.file_info_responser   types.file_list_responser   types.file_create_responser   types.file_delete_responser   __all__r   r    r$   rs   r,   ru   rp   r)   r'   <module>r      s    #   %  & I I  & 9  0 7 7 ; ;L
!
O 
D
! 
D
 
*
 
*
 
*
 
r)   