
    .h2R                       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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' ddl(m)Z)m*Z* ddl+m,Z,m-Z- ddl.m/Z/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6 ddgZ7 G d de#      Z8 G d de$      Z9 G d d      Z: G d d      Z; G d d      Z< G d d      Z=y)     )annotations)Mappingcast)LiteralN   )_legacy_response   )ContentAsyncContentContentWithRawResponseAsyncContentWithRawResponseContentWithStreamingResponse!AsyncContentWithStreamingResponse)	BodyOmitQueryHeadersNoneTypeNotGiven	FileTypesomit	not_given)extract_filesmaybe_transformdeepcopy_minimalasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)file_list_paramsfile_create_params)FileListResponse)FileCreateResponse)FileRetrieveResponseFiles
AsyncFilesc                     e Zd Zedd       Zedd       Zedd       Zeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	ddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
eeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r+   c                ,    t        | j                        S N)r
   _clientselfs    h/var/www/html/axiom-chatbot/venv/lib/python3.12/site-packages/openai/resources/containers/files/files.pycontentzFiles.content#   s    t||$$    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/openai/openai-python#accessing-raw-response-data-eg-headers
        )FilesWithRawResponser1   s    r3   with_raw_responsezFiles.with_raw_response'   s     $D))r5   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/openai/openai-python#with_streaming_response
        )FilesWithStreamingResponser1   s    r3   with_streaming_responsezFiles.with_streaming_response1   s     *$//r5   Nfilefile_idextra_headersextra_query
extra_bodytimeoutc               ,   |st        d|      t        ||d      }t        t        t        t
        t        f   |      dgg      }	ddi|xs i }| j                  d| dt        |t        j                        |	t        ||||	      t        
      S )<  
        Create a Container File

        You can send either a multipart/form-data request with the raw file content, or
        a JSON request with a file ID.

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

          file_id: Name of the file to create.

          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
        ;Expected a non-empty value for `container_id` but received r?   r@   r?   pathsContent-Typemultipart/form-data/containers//filesrA   rB   rC   rD   bodyfilesoptionscast_to)
ValueErrorr   r   r   r   strobject_postr   r'   FileCreateParamsr%   r)   
r2   container_idr?   r@   rA   rB   rC   rD   rQ   rR   s
             r3   createzFiles.create:   s    @ Z[gZjkll"
 d73;#7>xjQ ()>X=CVTVXzz<./ '9'J'JK(+Q[el '  
 	
r5   rO   c          	         |st        d|      |st        d|      | j                  d| d| t        ||||      t              S )K  
        Retrieve Container 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
        rG   6Expected a non-empty value for `file_id` but received rM   /files/rO   rS   rT   rU   _getr%   r*   r2   r@   r[   rA   rB   rC   rD   s          r3   retrievezFiles.retrieveq   sr    0 Z[gZjkllUV]U`abbyy<.y9(+Q[el )  
 	
r5   afterlimitorderrA   rB   rC   rD   c                   |st        d|      | j                  d| dt        t           t	        ||||t        |||dt        j                              t              S a  List Container files

        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.

          order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending
              order and `desc` for descending order.

          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
        rG   rM   rN   )rg   rh   ri   )rA   rB   rC   rD   query)pagerS   model)rU   _get_api_listr"   r(   r%   r   r&   FileListParams	r2   r[   rg   rh   ri   rA   rB   rC   rD   s	            r3   listz
Files.list   s    L Z[gZjkll!!<./ 01(+'%%!&!&!&
 %33 ## " 
 	
r5   c          	         |st        d|      |st        d|      ddi|xs i }| j                  d| d| t        ||||      t              S )	I  
        Delete Container 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
        rG   r_   Accept*/*rM   r`   rO   ra   rU   _deleter%   r   rd   s          r3   deletezFiles.delete   s    0 Z[gZjkllUV]U`abb!5B]-@bB||<.y9(+Q[el   
 	
r5   )returnr
   )rz   r8   )rz   r<   r[   rV   r?   zFileTypes | Omitr@   
str | OmitrA   Headers | NonerB   Query | NonerC   Body | NonerD   'float | httpx.Timeout | None | NotGivenrz   r)   r@   rV   r[   rV   rA   r}   rB   r~   rC   r   rD   r   rz   r*   )r[   rV   rg   r|   rh   
int | Omitri   Literal['asc', 'desc'] | OmitrA   r}   rB   r~   rC   r   rD   r   rz   z SyncCursorPage[FileListResponse]r@   rV   r[   rV   rA   r}   rB   r~   rC   r   rD   r   rz   None__name__
__module____qualname__r   r4   r9   r=   r   r   r\   re   rr   ry    r5   r3   r+   r+   "   s   % % * * 0 0 "&" )-$("&;D5
5
 	5

 5
 &5
 "5
  5
 95
 
5
| )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
P ! /3 )-$("&;D:
:
 	:

 :
 -:
 &:
 ":
  :
 9:
 
*:
F )-$("&;D#
#
 	#
 &#
 "#
  #
 9#
 
#
r5   c                     e Zd Zedd       Zedd       Zedd       Zeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	ddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
eeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r,   c                ,    t        | j                        S r/   )r   r0   r1   s    r3   r4   zAsyncFiles.content   s    DLL))r5   c                    t        |       S r7   )AsyncFilesWithRawResponser1   s    r3   r9   zAsyncFiles.with_raw_response   s     )..r5   c                    t        |       S r;   )AsyncFilesWithStreamingResponser1   s    r3   r=   z"AsyncFiles.with_streaming_response  s     /t44r5   Nr>   c               \  K   |st        d|      t        ||d      }t        t        t        t
        t        f   |      dgg      }	ddi|xs i }| j                  d| dt        |t        j                         d	{   |	t        ||||
      t               d	{   S 7 %7 w)rF   rG   rH   r?   rI   rK   rL   rM   rN   NrO   rP   )rU   r   r   r   r   rV   rW   rX   r   r'   rY   r%   r)   rZ   s
             r3   r\   zAsyncFiles.create  s     @ Z[gZjkll"
 d73;#7>xjQ ()>X=CVTVXZZ<./,T3E3V3VWW(+Q[el '   
 
 	
W
s$   B B,B(
 B,#B*$B,*B,rO   c          	        K   |st        d|      |st        d|      | j                  d| d| t        ||||      t               d{   S 7 w)r^   rG   r_   rM   r`   rO   ra   Nrb   rd   s          r3   re   zAsyncFiles.retrieveF  s     0 Z[gZjkllUV]U`abbYY<.y9(+Q[el )  
 
 	
 
s   AAAArf   c                   |st        d|      | j                  d| dt        t           t	        ||||t        |||dt        j                              t              S rk   )rU   ro   r#   r(   r%   r   r&   rp   rq   s	            r3   rr   zAsyncFiles.listj  s    L Z[gZjkll!!<./ !12(+'%%!&!&!&
 %33 ## " 
 	
r5   c          	        K   |st        d|      |st        d|      ddi|xs i }| j                  d| d| t        ||||      t               d	{   S 7 w)
rt   rG   r_   ru   rv   rM   r`   rO   ra   Nrw   rd   s          r3   ry   zAsyncFiles.delete  s     0 Z[gZjkllUV]U`abb!5B]-@bB\\<.y9(+Q[el  " 
 
 	
 
s   AA"A A")rz   r   )rz   r   )rz   r   r{   r   )r[   rV   rg   r|   rh   r   ri   r   rA   r}   rB   r~   rC   r   rD   r   rz   zCAsyncPaginator[FileListResponse, AsyncCursorPage[FileListResponse]]r   r   r   r5   r3   r,   r,      s   * * / / 5 5 "&" )-$("&;D5
5
 	5

 5
 &5
 "5
  5
 95
 
5
| )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
P ! /3 )-$("&;D:
:
 	:

 :
 -:
 &:
 ":
  :
 9:
 
M:
F )-$("&;D#
#
 	#
 &#
 "#
  #
 9#
 
#
r5   c                  &    e Zd ZddZedd       Zy)r8   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r/   )_filesr   to_raw_response_wrapperr\   re   rr   ry   r2   rR   s     r3   __init__zFilesWithRawResponse.__init__  ss    &>>LL
 )@@NN
 %<<JJ
	 '>>LL
r5   c                @    t        | j                  j                        S r/   )r   r   r4   r1   s    r3   r4   zFilesWithRawResponse.content  s    %dkk&9&9::r5   NrR   r+   rz   r   )rz   r   r   r   r   r   r   r4   r   r5   r3   r8   r8     s    
  ; ;r5   r8   c                  &    e Zd ZddZedd       Zy)r   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r/   )r   r   async_to_raw_response_wrapperr\   re   rr   ry   r   s     r3   r   z"AsyncFilesWithRawResponse.__init__  ss    &DDLL
 )FFNN
 %BBJJ
	 'DDLL
r5   c                @    t        | j                  j                        S r/   )r   r   r4   r1   s    r3   r4   z!AsyncFilesWithRawResponse.content  s    *4;;+>+>??r5   NrR   r,   rz   r   )rz   r   r   r   r5   r3   r   r     s    
  @ @r5   r   c                  &    e Zd ZddZedd       Zy)r<   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r/   )r   r    r\   re   rr   ry   r   s     r3   r   z#FilesWithStreamingResponse.__init__  s[    2LL
 5NN
 1JJ
	 3LL
r5   c                @    t        | j                  j                        S r/   )r   r   r4   r1   s    r3   r4   z"FilesWithStreamingResponse.content	  s    +DKK,?,?@@r5   Nr   )rz   r   r   r   r5   r3   r<   r<     s    
  A Ar5   r<   c                  &    e Zd ZddZedd       Zy)r   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r/   )r   r!   r\   re   rr   ry   r   s     r3   r   z(AsyncFilesWithStreamingResponse.__init__  s[    8LL
 ;NN
 7JJ
	 9LL
r5   c                @    t        | j                  j                        S r/   )r   r   r4   r1   s    r3   r4   z'AsyncFilesWithStreamingResponse.content  s    01D1DEEr5   Nr   )rz   r   r   r   r5   r3   r   r     s    
  F Fr5   r   )>
__future__r   typingr   r   typing_extensionsr   httpx r   r4   r
   r   r   r   r   r   _typesr   r   r   r   r   r   r   r   r   _utilsr   r   r   r   _compatr   	_resourcer   r   	_responser    r!   
paginationr"   r#   _base_clientr$   r%   types.containersr&   r'   #types.containers.file_list_responser(   %types.containers.file_create_responser)   'types.containers.file_retrieve_responser*   __all__r+   r,   r8   r   r<   r   r   r5   r3   <module>r      s    #   %  !  b a a ^ ^ ' ; Z : A E D H LL
!R
O R
jR
! R
j; ;,@ @,A A,F Fr5   