o
    Cjixk                     @  s,  d dl mZ d dlmZmZmZ d dlmZ d dlZddl	m
Z
mZmZm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!m"Z"m#Z#m$Z$ ddl%m&Z&m'Z' errd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ListOptional)LiteralN   )Files
AsyncFilesFilesWithRawResponseAsyncFilesWithRawResponse   )	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transform)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperasync_to_raw_response_wrapper)SyncCursorPageAsyncCursorPage)	AssistantAssistantDeletedassistant_list_paramsassistant_create_paramsassistant_update_params)AsyncPaginatormake_request_options)OpenAIAsyncOpenAI
AssistantsAsyncAssistantsc                         e Zd ZU ded< ded< d: fd	d
Zeeeeeeddded
d;d"d#Zddded$d<d&d'Zeeeeeeeddded(d=d+d,Zeeeeddded-d>d5d6Z	ddded$d?d8d9Z
  ZS )@r"   r   filesAssistantsWithRawResponsewith_raw_responseclientr    returnNonec                   $   t  | t|| _t| | _d S N)super__init__r   r%   r&   r'   selfr(   	__class__ /var/www/html/Resume-Parser/resume-parser-inhouse/venv/lib/python3.10/site-packages/openai/resources/beta/assistants/assistants.pyr.   #      
zAssistants.__init__N
descriptionfile_idsinstructionsmetadatanametoolsextra_headersextra_query
extra_bodytimeoutmodelstrr7   Optional[str] | NotGivenr8   List[str] | NotGivenr9   r:   Optional[object] | NotGivenr;   r<   -List[assistant_create_params.Tool] | NotGivenr=   Headers | Noner>   Query | Noner?   Body | Noner@   'float | httpx.Timeout | None | NotGivenr   c                C  sF   ddi|pi }| j dt|||||||dtjt||	|
|dtdS )  
        Create an assistant with a model and instructions.

        Args:
          model: ID of the model to use. You can use the
              [List models](https://platform.openai.com/docs/api-reference/models/list) API to
              see all of your available models, or see our
              [Model overview](https://platform.openai.com/docs/models/overview) for
              descriptions of them.

          description: The description of the assistant. The maximum length is 512 characters.

          file_ids: A list of [file](https://platform.openai.com/docs/api-reference/files) IDs
              attached to this assistant. There can be a maximum of 20 files attached to the
              assistant. Files are ordered by their creation date in ascending order.

          instructions: The system instructions that the assistant uses. The maximum length is 32768
              characters.

          metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
              for storing additional information about the object in a structured format. Keys
              can be a maximum of 64 characters long and values can be a maxium of 512
              characters long.

          name: The name of the assistant. The maximum length is 256 characters.

          tools: A list of tool enabled on the assistant. There can be a maximum of 128 tools per
              assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.

          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rA   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   bodyoptionscast_to_postr   r   AssistantCreateParamsr   r   r0   rA   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   r3   r3   r4   create(   s&   6	zAssistants.createrP   assistant_idc                C  2   ddi|pi }| j d| t||||dtdS )K  
        Retrieves an assistant.

        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
        rL   rM   /assistants/rP   rS   rT   _getr   r   r0   rZ   r=   r>   r?   r@   r3   r3   r4   retrieves      zAssistants.retriever7   r8   r9   r:   rA   r;   r<   r=   r>   r?   r@   str | NotGiven-List[assistant_update_params.Tool] | NotGivenc                C  sL   ddi|	pi }	| j d| t|||||||dtjt|	|
||dtdS )k  Modifies an assistant.

        Args:
          description: The description of the assistant.

        The maximum length is 512 characters.

          file_ids: A list of [File](https://platform.openai.com/docs/api-reference/files) IDs
              attached to this assistant. There can be a maximum of 20 files attached to the
              assistant. Files are ordered by their creation date in ascending order. If a
              file was previosuly attached to the list but does not show up in the list, it
              will be deleted from the assistant.

          instructions: The system instructions that the assistant uses. The maximum length is 32768
              characters.

          metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
              for storing additional information about the object in a structured format. Keys
              can be a maximum of 64 characters long and values can be a maxium of 512
              characters long.

          model: ID of the model to use. You can use the
              [List models](https://platform.openai.com/docs/api-reference/models/list) API to
              see all of your available models, or see our
              [Model overview](https://platform.openai.com/docs/models/overview) for
              descriptions of them.

          name: The name of the assistant. The maximum length is 256 characters.

          tools: A list of tool enabled on the assistant. There can be a maximum of 128 tools per
              assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.

          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
        rL   rM   r]   r7   r8   r9   r:   rA   r;   r<   rP   rQ   rV   r   r   AssistantUpdateParamsr   r   r0   rZ   r7   r8   r9   r:   rA   r;   r<   r=   r>   r?   r@   r3   r3   r4   update   s&   :	zAssistants.updateafterbeforelimitorderr=   r>   r?   r@   rn   ro   rp   int | NotGivenrq   !Literal['asc', 'desc'] | NotGivenSyncCursorPage[Assistant]c          	      C  F   ddi|pi }| j dtt t||||t||||dtjdtdS a  Returns a list of assistants.

        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
        rL   rM   rN   )rn   ro   rp   rq   )r=   r>   r?   r@   query)pagerS   rA   )_get_api_listr   r   r   r   r   AssistantListParams	r0   rn   ro   rp   rq   r=   r>   r?   r@   r3   r3   r4   list   (   +zAssistants.listr   c                C  r[   )H  
        Delete an assistant.

        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
        rL   rM   r]   rP   r^   _deleter   r   ra   r3   r3   r4   delete#  rc   zAssistants.delete)r(   r    r)   r*   rA   rB   r7   rC   r8   rD   r9   rC   r:   rE   r;   rC   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r)   r   rZ   rB   r=   rG   r>   rH   r?   rI   r@   rJ   r)   r   rZ   rB   r7   rC   r8   rD   r9   rC   r:   rE   rA   re   r;   rC   r<   rf   r=   rG   r>   rH   r?   rI   r@   rJ   r)   r   )rn   re   ro   re   rp   rr   rq   rs   r=   rG   r>   rH   r?   rI   r@   rJ   r)   rt   rZ   rB   r=   rG   r>   rH   r?   rI   r@   rJ   r)   r   __name__
__module____qualname____annotations__r.   r   rY   rb   rl   r|   r   __classcell__r3   r3   r1   r4   r"      \   
 	Q$RGc                      r$   )@r#   r	   r%   AsyncAssistantsWithRawResponser'   r(   r!   r)   r*   c                   r+   r,   )r-   r.   r	   r%   r   r'   r/   r1   r3   r4   r.   H  r5   zAsyncAssistants.__init__Nr6   rA   rB   r7   rC   r8   rD   r9   r:   rE   r;   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r   c                  sN   ddi|pi }| j dt|||||||dtjt||	|
|dtdI dH S )rK   rL   rM   rN   rO   rP   rQ   NrU   rX   r3   r3   r4   rY   M  s(   6	zAsyncAssistants.createrP   rZ   c                  :   ddi|pi }| j d| t||||dtdI dH S )r\   rL   rM   r]   rP   r^   Nr_   ra   r3   r3   r4   rb        zAsyncAssistants.retrieverd   re   rf   c                  sT   ddi|	pi }	| j d| t|||||||dtjt|	|
||dtdI dH S )rg   rL   rM   r]   rh   rP   rQ   Nri   rk   r3   r3   r4   rl     s(   :	zAsyncAssistants.updaterm   rn   ro   rp   rr   rq   rs   5AsyncPaginator[Assistant, AsyncCursorPage[Assistant]]c          	      C  ru   rv   )ry   r   r   r   r   r   rz   r{   r3   r3   r4   r|     r}   zAsyncAssistants.listr   c                  r   )r~   rL   rM   r]   rP   r^   Nr   ra   r3   r3   r4   r   H  r   zAsyncAssistants.delete)r(   r!   r)   r*   r   r   r   )rn   re   ro   re   rp   rr   rq   rs   r=   rG   r>   rH   r?   rI   r@   rJ   r)   r   r   r   r3   r3   r1   r4   r#   D  r   c                   @     e Zd ZdddZdS )	r&   
assistantsr"   r)   r*   c                 C  L   t |j| _t|j| _t|j| _t|j| _t|j| _t|j| _d S r,   )r
   r%   r   rY   rb   rl   r|   r   r0   r   r3   r3   r4   r.   j      
z"AssistantsWithRawResponse.__init__N)r   r"   r)   r*   r   r   r   r.   r3   r3   r3   r4   r&   i      r&   c                   @  r   )	r   r   r#   r)   r*   c                 C  r   r,   )r   r%   r   rY   rb   rl   r|   r   r   r3   r3   r4   r.     r   z'AsyncAssistantsWithRawResponse.__init__N)r   r#   r)   r*   r   r3   r3   r3   r4   r   ~  r   r   )0
__future__r   typingr   r   r   typing_extensionsr   httpxr%   r   r	   r
   r   _typesr   r   r   r   r   _utilsr   	_resourcer   r   	_responser   r   
paginationr   r   
types.betar   r   r   r   r   _base_clientr   r   _clientr    r!   __all__r"   r#   r&   r   r3   r3   r3   r4   <module>   s.     '  '