o
    jw                     @  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
 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 dd
l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+m,Z, ddl-m.Z.m/Z/ ddgZ0G dd deZ1G dd deZ2G dd dZ3G dd dZ4G dd dZ5G dd dZ6dS )    )annotations)ListIterableOptional)LiteralN   )_legacy_response   )Files
AsyncFilesFilesWithRawResponseAsyncFilesWithRawResponseFilesWithStreamingResponseAsyncFilesWithStreamingResponse)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)	AssistantAssistantDeletedAssistantToolParamassistant_list_paramsassistant_create_paramsassistant_update_params)AsyncPaginatormake_request_options
AssistantsAsyncAssistantsc                   @     e Zd Zed9ddZed:ddZed;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?d4d5Zddded$d@d7d8ZdS )Ar&   returnr
   c                 C  
   t | jS N)r
   _clientself r/   q/var/www/html/fyndo/pharma/fyndo/venv/lib/python3.10/site-packages/openai/resources/beta/assistants/assistants.pyfiles-      
zAssistants.filesAssistantsWithRawResponsec                 C     t | S r+   )r3   r-   r/   r/   r0   with_raw_response1      zAssistants.with_raw_responseAssistantsWithStreamingResponsec                 C  r4   r+   )r7   r-   r/   r/   r0   with_streaming_response5   r6   z"Assistants.with_streaming_responseN
descriptionfile_idsinstructionsmetadatanametoolsextra_headersextra_query
extra_bodytimeoutmodelstrr:   Optional[str] | NotGivenr;   List[str] | NotGivenr<   r=   Optional[object] | NotGivenr>   r?   'Iterable[AssistantToolParam] | NotGivenr@   Headers | NonerA   Query | NonerB   Body | NonerC   '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rD   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   bodyoptionscast_to)_postr   r"   AssistantCreateParamsr%   r   r.   rD   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   r/   r/   r0   create9   s&   6	zAssistants.createrS   assistant_idc                C  D   |s	t d|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
        ;Expected a non-empty value for `assistant_id` but received rO   rP   /assistants/rS   rV   rW   
ValueError_getr%   r   r.   r\   r@   rA   rB   rC   r/   r/   r0   retrieve      zAssistants.retriever:   r;   r<   r=   rD   r>   r?   r@   rA   rB   rC   str | NotGivenc                C  s^   |s	t d|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 previously 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
        r_   rO   rP   r`   r:   r;   r<   r=   rD   r>   r?   rS   rT   )rc   rX   r   r#   AssistantUpdateParamsr%   r   r.   r\   r:   r;   r<   r=   rD   r>   r?   r@   rA   rB   rC   r/   r/   r0   update   s*   :	zAssistants.updateafterbeforelimitorderr@   rA   rB   rC   rp   rq   rr   int | NotGivenrs   !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
        rO   rP   rQ   )rp   rq   rr   rs   )r@   rA   rB   rC   query)pagerV   rD   )_get_api_listr   r   r%   r   r!   AssistantListParams	r.   rp   rq   rr   rs   r@   rA   rB   rC   r/   r/   r0   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
        r_   rO   rP   r`   rS   ra   rc   _deleter%   r   re   r/   r/   r0   delete8  rg   zAssistants.delete)r)   r
   )r)   r3   )r)   r7   rD   rE   r:   rF   r;   rG   r<   rF   r=   rH   r>   rF   r?   rI   r@   rJ   rA   rK   rB   rL   rC   rM   r)   r   r\   rE   r@   rJ   rA   rK   rB   rL   rC   rM   r)   r   r\   rE   r:   rF   r;   rG   r<   rF   r=   rH   rD   ri   r>   rF   r?   rI   r@   rJ   rA   rK   rB   rL   rC   rM   r)   r   )rp   ri   rq   ri   rr   rt   rs   ru   r@   rJ   rA   rK   rB   rL   rC   rM   r)   rv   r\   rE   r@   rJ   rA   rK   rB   rL   rC   rM   r)   r   __name__
__module____qualname__r   r1   r5   r8   r   r[   rf   rn   r~   r   r/   r/   r/   r0   r&   ,   b    Q&TGc                   @  r(   )Ar'   r)   r   c                 C  r*   r+   )r   r,   r-   r/   r/   r0   r1   \  r2   zAsyncAssistants.filesAsyncAssistantsWithRawResponsec                 C  r4   r+   )r   r-   r/   r/   r0   r5   `  r6   z!AsyncAssistants.with_raw_response$AsyncAssistantsWithStreamingResponsec                 C  r4   r+   )r   r-   r/   r/   r0   r8   d  r6   z'AsyncAssistants.with_streaming_responseNr9   rD   rE   r:   rF   r;   rG   r<   r=   rH   r>   r?   rI   r@   rJ   rA   rK   rB   rL   rC   rM   r   c                  sT   ddi|pi }| j dt|||||||dtjI dH t||	|
|dtdI dH S )rN   rO   rP   rQ   rR   NrS   rT   )rX   r   r"   rY   r%   r   rZ   r/   r/   r0   r[   h  s(   6	zAsyncAssistants.createrS   r\   c                  L   |s
t d|ddi|pi }| jd| t||||dtdI dH S )r^   r_   rO   rP   r`   rS   ra   Nrb   re   r/   r/   r0   rf        zAsyncAssistants.retrieverh   ri   c                  sl   |s
t d|ddi|	pi }	| jd| t|||||||dtjI dH t|	|
||dtdI dH S )	rj   r_   rO   rP   r`   rk   NrS   rT   )rc   rX   r   r#   rl   r%   r   rm   r/   r/   r0   rn     s,   :	zAsyncAssistants.updatero   rp   rq   rr   rt   rs   ru   5AsyncPaginator[Assistant, AsyncCursorPage[Assistant]]c          	      C  rw   rx   )r{   r   r   r%   r   r!   r|   r}   r/   r/   r0   r~   &  r   zAsyncAssistants.listr   c                  r   )r   r_   rO   rP   r`   rS   ra   Nr   re   r/   r/   r0   r   g  r   zAsyncAssistants.delete)r)   r   )r)   r   )r)   r   r   r   r   )rp   ri   rq   ri   rr   rt   rs   ru   r@   rJ   rA   rK   rB   rL   rC   rM   r)   r   r   r   r/   r/   r/   r0   r'   [  r   c                   @  $   e Zd ZdddZeddd	Zd
S )r3   
assistantsr&   r)   Nonec                 C  P   || _ t|j| _t|j| _t|j| _t|j| _t|j| _d S r+   )_assistantsr   to_raw_response_wrapperr[   rf   rn   r~   r   r.   r   r/   r/   r0   __init__      
z"AssistantsWithRawResponse.__init__r   c                 C     t | jjS r+   )r   r   r1   r-   r/   r/   r0   r1        zAssistantsWithRawResponse.filesNr   r&   r)   r   )r)   r   r   r   r   r   r   r1   r/   r/   r/   r0   r3         
r3   c                   @  r   )r   r   r'   r)   r   c                 C  r   r+   )r   r   async_to_raw_response_wrapperr[   rf   rn   r~   r   r   r/   r/   r0   r     r   z'AsyncAssistantsWithRawResponse.__init__r   c                 C  r   r+   )r   r   r1   r-   r/   r/   r0   r1     r   z$AsyncAssistantsWithRawResponse.filesNr   r'   r)   r   )r)   r   r   r/   r/   r/   r0   r     r   r   c                   @  r   )r7   r   r&   r)   r   c                 C  F   || _ t|j| _t|j| _t|j| _t|j| _t|j| _d S r+   )r   r   r[   rf   rn   r~   r   r   r/   r/   r0   r         
z(AssistantsWithStreamingResponse.__init__r   c                 C  r   r+   )r   r   r1   r-   r/   r/   r0   r1     r   z%AssistantsWithStreamingResponse.filesNr   )r)   r   r   r/   r/   r/   r0   r7     r   r7   c                   @  r   )r   r   r'   r)   r   c                 C  r   r+   )r   r   r[   rf   rn   r~   r   r   r/   r/   r0   r     r   z-AsyncAssistantsWithStreamingResponse.__init__r   c                 C  r   r+   )r   r   r1   r-   r/   r/   r0   r1     r   z*AsyncAssistantsWithStreamingResponse.filesNr   )r)   r   r   r/   r/   r/   r0   r     r   r   )7
__future__r   typingr   r   r   typing_extensionsr   httpx r   r1   r
   r   r   r   r   r   _typesr   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   
types.betar   r   r    r!   r"   r#   _base_clientr$   r%   __all__r&   r'   r3   r   r7   r   r/   r/   r/   r0   <module>   s2       1  1