
    +h@                        d dl mZ d dlmZ d dlmZ d dlZddlmZ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mZmZmZ erddl m!Z!m"Z" ddgZ# G d de      Z$ G d de      Z% G d d      Z& G d d      Z'y)    )annotations)TYPE_CHECKING)LiteralN   )	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transform)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperasync_to_raw_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)AssistantFileFileDeleteResponsefile_list_paramsfile_create_params)OpenAIAsyncOpenAIFiles
AsyncFilesc            	           e Zd ZU ded<   d fdZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Z	 xZ
S )r   FilesWithRawResponsewith_raw_responsec                D    t         |   |       t        |       | _        y N)super__init__r   r   selfclient	__class__s     Y/var/www/html/venv/lib/python3.12/site-packages/openai/resources/beta/assistants/files.pyr#   zFiles.__init__    s     !5d!;    Nextra_headersextra_query
extra_bodytimeoutc          
         ddi|xs i }| j                  d| dt        d|it        j                        t	        ||||      t
              S )  
        Create an assistant file by attaching a
        [File](https://platform.openai.com/docs/api-reference/files) to an
        [assistant](https://platform.openai.com/docs/api-reference/assistants).

        Args:
          file_id: A [File](https://platform.openai.com/docs/api-reference/files) ID (with
              `purpose="assistants"`) that the assistant should use. Useful for tools like
              `retrieval` and `code_interpreter` that can access files.

          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-Betaassistants=v1/assistants//filesfile_idr*   bodyoptionscast_to_postr   r   FileCreateParamsr   r   r%   assistant_idr5   r+   r,   r-   r.   s          r(   createzFiles.create$   sh    < 'QM<ORQzz<./ )W!57I7Z7Z[(+Q[el "  
 	
r)   c          	     l    ddi|xs i }| j                  d| d| t        ||||      t              S )O  
        Retrieves an AssistantFile.

        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
        r1   r2   r3   /files/r*   r8   r9   _getr   r   r%   r5   r>   r+   r,   r-   r.   s          r(   retrievezFiles.retrieveL   sV    0 'QM<ORQyy<.y9(+Q[el "  
 	
r)   afterbeforelimitorderr+   r,   r-   r.   c                   ddi|xs i }| j                  d| dt        t           t        ||||	t	        ||||dt
        j                              t              S a  
        Returns a list of assistant 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.

          before: A cursor for use in pagination. `before` 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 before=obj_foo in order to
              fetch the previous 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
        r1   r2   r3   r4   )rI   rJ   rK   rL   )r+   r,   r-   r.   query)pager8   model)_get_api_listr   r   r   r   r   FileListParams
r%   r>   rI   rJ   rK   rL   r+   r,   r-   r.   s
             r(   listz
Files.listm   s    V 'QM<ORQ!!<./.(+'%%!&"(!&!&	 %33  % " 
 	
r)   c          	     l    ddi|xs i }| j                  d| d| t        ||||      t              S )M  
        Delete an assistant 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
        r1   r2   r3   rB   r*   rC   _deleter   r   rF   s          r(   deletezFiles.delete   sV    0 'QM<ORQ||<.y9(+Q[el '  
 	
r)   )r&   r   returnNoner>   strr5   r^   r+   Headers | Noner,   Query | Noner-   Body | Noner.   'float | httpx.Timeout | None | NotGivenr[   r   r5   r^   r>   r^   r+   r_   r,   r`   r-   ra   r.   rb   r[   r   )r>   r^   rI   str | NotGivenrJ   rd   rK   int | NotGivenrL   !Literal['asc', 'desc'] | NotGivenr+   r_   r,   r`   r-   ra   r.   rb   r[   zSyncCursorPage[AssistantFile]r5   r^   r>   r^   r+   r_   r,   r`   r-   ra   r.   rb   r[   r   __name__
__module____qualname____annotations__r#   r   r?   rG   rU   rZ   __classcell__r'   s   @r(   r   r      s   ++< )-$("&;D&
&
 	&
 &&
 "&
  &
 9&
 
&
^ )-$("&;D

 	
 &
 "
  
 9
 

J !*!* )3< )-$("&;D?
?
 	?

 ?
 ?
 1?
 &?
 "?
  ?
 9?
 
'?
P )-$("&;D

 	
 &
 "
  
 9
 

r)   c            	           e Zd ZU ded<   d fdZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Z	 xZ
S )r   AsyncFilesWithRawResponser   c                D    t         |   |       t        |       | _        y r!   )r"   r#   rp   r   r$   s     r(   r#   zAsyncFiles.__init__   s     !:4!@r)   Nr*   c          
        K   ddi|xs i }| j                  d| dt        d|it        j                        t	        ||||      t
               d{   S 7 w)	r0   r1   r2   r3   r4   r5   r*   r6   Nr:   r=   s          r(   r?   zAsyncFiles.create   sv     < 'QM<ORQZZ<./ )W!57I7Z7Z[(+Q[el "   
 
 	
 
s   AAAAc          	        K   ddi|xs i }| j                  d| d| t        ||||      t               d{   S 7 w)rA   r1   r2   r3   rB   r*   rC   NrD   rF   s          r(   rG   zAsyncFiles.retrieve   sd     0 'QM<ORQYY<.y9(+Q[el "  
 
 	
 
   9AA ArH   c                   ddi|xs i }| j                  d| dt        t           t        ||||	t	        ||||dt
        j                              t              S rN   )rR   r   r   r   r   r   rS   rT   s
             r(   rU   zAsyncFiles.list   s    V 'QM<ORQ!!<./ /(+'%%!&"(!&!&	 %33  % " 
 	
r)   c          	        K   ddi|xs i }| j                  d| d| t        ||||      t               d{   S 7 w)rW   r1   r2   r3   rB   r*   rC   NrX   rF   s          r(   rZ   zAsyncFiles.deletea  sd     0 'QM<ORQ\\<.y9(+Q[el ' " 
 
 	
 
rt   )r&   r   r[   r\   r]   rc   )r>   r^   rI   rd   rJ   rd   rK   re   rL   rf   r+   r_   r,   r`   r-   ra   r.   rb   r[   z=AsyncPaginator[AssistantFile, AsyncCursorPage[AssistantFile]]rg   rh   rn   s   @r(   r   r      s   00A )-$("&;D&
&
 	&
 &&
 "&
  &
 9&
 
&
^ )-$("&;D

 	
 &
 "
  
 9
 

J !*!* )3< )-$("&;D?
?
 	?

 ?
 ?
 1?
 &?
 "?
  ?
 9?
 
G?
P )-$("&;D

 	
 &
 "
  
 9
 

r)   c                      e Zd ZddZy)r   c                    t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j                        | _        y r!   )r   r?   rG   rU   rZ   r%   filess     r(   r#   zFilesWithRawResponse.__init__  sT    -LL
 0NN
 ,JJ
	 .LL
r)   N)rz   r   r[   r\   ri   rj   rk   r#    r)   r(   r   r         
r)   r   c                      e Zd ZddZy)rp   c                    t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j                        | _        y r!   )r   r?   rG   rU   rZ   ry   s     r(   r#   z"AsyncFilesWithRawResponse.__init__  sT    3LL
 6NN
 2JJ
	 4LL
r)   N)rz   r   r[   r\   r{   r|   r)   r(   rp   rp     r}   r)   rp   )(
__future__r   typingr   typing_extensionsr   httpx_typesr   r   r	   r
   r   _utilsr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.beta.assistantsr   r   r   r   _clientr   r   __all__r   r   r   rp   r|   r)   r(   <module>r      sw    #   %  @ @ & ; P : A  /L
!p
O p
fp
! p
f
 
 
 
r)   