
    MiK                       S SK Jr  S SKJrJr  S SKJr  S SKrSSKJ	r	  SSK
JrJrJrJrJrJr  SSKJrJrJrJ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"J#r#J$r$J%r%J&r&J'r'  SSK(J)r)  SSK*J+r+  SSK,J-r-  SSK.J/r/  SSK0J1r1  SS/r2 " S S\5      r3 " S S\5      r4 " S S5      r5 " S S5      r6 " S S5      r7 " S S5      r8g)    )annotations)Mappingcast)LiteralN   )file_create_params)BodyQueryHeadersNotGiven	FileTypes	not_given)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                  "   \ 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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/groq/groq-python#accessing-raw-response-data-eg-headers
)FilesWithRawResponseselfs    n/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/groq/resources/files.pywith_raw_responseFiles.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/groq/groq-python#with_streaming_response
)FilesWithStreamingResponser.   s    r0   with_streaming_responseFiles.with_streaming_response1   s     *$//r3   Nextra_headersextra_query
extra_bodytimeoutc                   [        UUS.5      n[        [        [        [        [
        4   U5      S//S9nSS0U=(       d    0 EnU R                  S[        U[        R                  5      U[        X4XVS9[        S9$ )	  
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purposerA   pathsContent-Typemultipart/form-data/openai/v1/filesr9   bodyfilesoptionscast_to)r   r   r   r   strobject_postr   r   FileCreateParamsr"   r%   	r/   rA   rB   r:   r;   r<   r=   rI   rJ   s	            r0   createFiles.create:   s    D  "
 d73;#7>xjQ ()>X=CVTVXzz '9'J'JK(+Q[ '  
 	
r3   c          
     <    U R                  S[        XX4S9[        S9$ )Returns a list of files.rG   r9   rK   rL   _getr"   r$   r/   r:   r;   r<   r=   s        r0   list
Files.listq   s0     yy(+Q[ %  
 	
r3   c          
     n    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9$ )
  
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/r9   rV   
ValueError_deleter"   r&   r/   file_idr:   r;   r<   r=   s         r0   deleteFiles.delete   sO    . UV]U`abb||y)(+Q[ '  
 	
r3   c          
         U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU S3[        X#XES9[        S9$ )'  
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
r^   Acceptapplication/octet-streamr_   /contentr9   rV   )ra   rX   r"   r   rc   s         r0   contentFiles.content   sg    . UV]U`abb!#=W-BUSUWyyy1(+Q[ &  
 	
r3   c          
     n    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9$ )  
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
r^   r_   r9   rV   ra   rX   r"   r#   rc   s         r0   info
Files.info   sO    . UV]U`abbyyy)(+Q[ %  
 	
r3    )returnr-   )rt   r6   rA   r   rB   zLiteral['batch']r:   Headers | Noner;   Query | Noner<   Body | Noner=   'float | httpx.Timeout | None | NotGivenrt   r%   
r:   rv   r;   rw   r<   rx   r=   ry   rt   r$   rd   rM   r:   rv   r;   rw   r<   rx   r=   ry   rt   r&   )rd   rM   r:   rv   r;   rw   r<   rx   r=   ry   rt   r   rd   rM   r:   rv   r;   rw   r<   rx   r=   ry   rt   r#   __name__
__module____qualname____firstlineno__r   r1   r7   r   rR   rZ   re   rl   rq   __static_attributes__rs   r3   r0   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
 

 
r3   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SS\S.           SS
 jjrSrg)r(      c                    [        U 5      $ r,   )AsyncFilesWithRawResponser.   s    r0   r1   AsyncFiles.with_raw_response   s     )..r3   c                    [        U 5      $ r5   )AsyncFilesWithStreamingResponser.   s    r0   r7   "AsyncFiles.with_streaming_response   s     /t44r3   Nr9   c               (  #    [        UUS.5      n[        [        [        [        [
        4   U5      S//S9nSS0U=(       d    0 EnU R                  S[        U[        R                  5      I Sh  vN U[        X4XVS9[        S	9I Sh  vN $  N N7f)
r?   r@   rA   rC   rE   rF   rG   Nr9   rH   )r   r   r   r   rM   rN   rO   r   r   rP   r"   r%   rQ   s	            r0   rR   AsyncFiles.create   s     D  "
 d73;#7>xjQ ()>X=CVTVXZZ,T3E3V3VWW(+Q[ '   
 
 	
W
s$   A.B0B
1B	B
BBc          
     X   #    U R                  S[        XX4S9[        S9I Sh  vN $  N7f)rU   rG   r9   rV   NrW   rY   s        r0   rZ   AsyncFiles.list4  s=      YY(+Q[ %  
 
 	
 
s   !*(*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)r]   r^   r_   r9   rV   Nr`   rc   s         r0   re   AsyncFiles.deleteG  s\     . UV]U`abb\\y)(+Q[ ' " 
 
 	
 
   :AAAc          
        #    U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU S3[        X#XES9[        S9I Sh  vN $  N7f)	rh   r^   ri   rj   r_   rk   r9   rV   N)ra   rX   r"   r   rc   s         r0   rl   AsyncFiles.contenth  st     . UV]U`abb!#=W-BUSUWYYy1(+Q[ +  
 
 	
 
s   A
AAA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)ro   r^   r_   r9   rV   Nrp   rc   s         r0   rq   AsyncFiles.info  s\     . UV]U`abbYYy)(+Q[ %  
 
 	
 
r   rs   )rt   r   )rt   r   ru   rz   r{   )rd   rM   r:   rv   r;   rw   r<   rx   r=   ry   rt   r   r|   r}   rs   r3   r0   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
 

 
r3   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        [        UR                  5      U l        g N)	_filesr   rR   rZ   re   r   rl   r   rq   r/   rJ   s     r0   __init__FilesWithRawResponse.__init__  sq    -LL
 ,JJ
	 .LL
 6MM
 ,JJ
	r3   r   rl   rR   re   rq   rZ   NrJ   r'   rt   Noner~   r   r   r   r   r   rs   r3   r0   r-   r-         
r3   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        [        UR                  5      U l        g r   )	r   r   rR   rZ   re   r    rl   r   rq   r   s     r0   r   "AsyncFilesWithRawResponse.__init__  sq    3LL
 2JJ
	 4LL
 <MM"
 2JJ
	r3   r   NrJ   r(   rt   r   r   rs   r3   r0   r   r     r   r3   r   c                      \ rS rSrSS jrSrg)r6   i  c                   Xl         [        UR                  5      U 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   rR   rZ   re   r   rl   r   rq   r   s     r0   r   #FilesWithStreamingResponse.__init__  sq    2LL
 1JJ
	 3LL
 ;MM%
 1JJ
	r3   r   Nr   r   rs   r3   r0   r6   r6     r   r3   r6   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        [        UR                  5      U l        g r   )	r   r   rR   rZ   re   r!   rl   r   rq   r   s     r0   r   (AsyncFilesWithStreamingResponse.__init__  sr    8LL
 7JJ
	 9LL
 AMM*
 7JJ
	r3   r   Nr   r   rs   r3   r0   r   r     r   r3   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   r6   r   rs   r3   r0   <module>r      s    #   %  & I I \ \ % 9    0 7 7 ; ;L
!@
O @
F@
! @
F
 
,
 
,
 
,
 
r3   