o
    Cji@                     @  s  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 deZ$G dd deZ%G dd dZ&G dd dZ'dS )    )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dZd	d	d	ed
d*ddZd	d	d	ed
d+ddZeeeed	d	d	edd,d$d%Zd	d	d	ed
d-d'd(Z	  Z
S ).r   FilesWithRawResponsewith_raw_responseclientr   returnNonec                      t  | t| | _d S N)super__init__r   r   selfr   	__class__ }/var/www/html/Resume-Parser/resume-parser-inhouse/venv/lib/python3.10/site-packages/openai/resources/beta/assistants/files.pyr%          zFiles.__init__Nextra_headersextra_query
extra_bodytimeoutassistant_idstrfile_idr.   Headers | Noner/   Query | Noner0   Body | Noner1   'float | httpx.Timeout | None | NotGivenr   c             	   C  sB   ddi|pi }| j d| dtd|itjt||||dtd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//filesr4   r-   bodyoptionscast_to_postr   r   FileCreateParamsr   r   r'   r2   r4   r.   r/   r0   r1   r*   r*   r+   create$   s   
zFiles.createc                C  8   ddi|pi }| j d| d| t||||dtd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
        r:   r;   r<   /files/r-   r@   rA   _getr   r   r'   r4   r2   r.   r/   r0   r1   r*   r*   r+   retrieveL      zFiles.retrieveafterbeforelimitorderr.   r/   r0   r1   rQ   str | NotGivenrR   rS   int | NotGivenrT   !Literal['asc', 'desc'] | NotGivenSyncCursorPage[AssistantFile]c          
      C  N   ddi|pi }| j d| dtt t||||	t||||dtjdtd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
        r:   r;   r<   r=   )rQ   rR   rS   rT   )r.   r/   r0   r1   query)pager@   model)_get_api_listr   r   r   r   r   FileListParams
r'   r2   rQ   rR   rS   rT   r.   r/   r0   r1   r*   r*   r+   listm   (   +
z
Files.listr   c                C  rG   )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
        r:   r;   r<   rI   r-   rJ   _deleter   r   rM   r*   r*   r+   delete   rO   zFiles.delete)r   r   r    r!   r2   r3   r4   r3   r.   r5   r/   r6   r0   r7   r1   r8   r    r   r4   r3   r2   r3   r.   r5   r/   r6   r0   r7   r1   r8   r    r   )r2   r3   rQ   rU   rR   rU   rS   rV   rT   rW   r.   r5   r/   r6   r0   r7   r1   r8   r    rX   r4   r3   r2   r3   r.   r5   r/   r6   r0   r7   r1   r8   r    r   __name__
__module____qualname____annotations__r%   r   rF   rN   ra   rf   __classcell__r*   r*   r(   r+   r      6   
 /%Hc                	      r   ).r   AsyncFilesWithRawResponser   r   r   r    r!   c                   r"   r#   )r$   r%   rq   r   r&   r(   r*   r+   r%      r,   zAsyncFiles.__init__Nr-   r2   r3   r4   r.   r5   r/   r6   r0   r7   r1   r8   r   c             	     sJ   ddi|pi }| j d| dtd|itjt||||dtdI dH S )	r9   r:   r;   r<   r=   r4   r-   r>   NrB   rE   r*   r*   r+   rF      s   
zAsyncFiles.createc                  @   ddi|pi }| j d| d| t||||dtdI dH S )rH   r:   r;   r<   rI   r-   rJ   NrK   rM   r*   r*   r+   rN         zAsyncFiles.retrieverP   rQ   rU   rR   rS   rV   rT   rW   =AsyncPaginator[AssistantFile, AsyncCursorPage[AssistantFile]]c          
      C  rY   rZ   )r^   r   r   r   r   r   r_   r`   r*   r*   r+   ra      rb   zAsyncFiles.listr   c                  rr   )rc   r:   r;   r<   rI   r-   rJ   Nrd   rM   r*   r*   r+   rf   a  rs   zAsyncFiles.delete)r   r   r    r!   rg   rh   )r2   r3   rQ   rU   rR   rU   rS   rV   rT   rW   r.   r5   r/   r6   r0   r7   r1   r8   r    rt   ri   rj   r*   r*   r(   r+   r      rp   c                   @     e Zd ZdddZdS )	r   filesr   r    r!   c                 C  4   t |j| _t |j| _t |j| _t |j| _d S r#   )r   rF   rN   ra   rf   r'   rv   r*   r*   r+   r%        
zFilesWithRawResponse.__init__N)rv   r   r    r!   rk   rl   rm   r%   r*   r*   r*   r+   r         r   c                   @  ru   )	rq   rv   r   r    r!   c                 C  rw   r#   )r   rF   rN   ra   rf   rx   r*   r*   r+   r%     ry   z"AsyncFilesWithRawResponse.__init__N)rv   r   r    r!   rz   r*   r*   r*   r+   rq     r{   rq   )(
__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   rq   r*   r*   r*   r+   <module>   s(    4 4