
    f jw                       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Z0 G d de          Z1 G d de          Z2 G d d          Z3 G d d          Z4 G d d          Z5 G 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d1d            Zed2d            Zed3d            Zeeeeeeddded	
d4dZddded d5d"Z	eeeeeeeddded#d6d%Z
eeeeddded&d7d.Zddded d8d0ZdS )9r'   returnr   c                *    t          | j                  S N)r   _clientselfs    C:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\openai/resources/beta/assistants/assistants.pyfileszAssistants.files-   s    T\"""    AssistantsWithRawResponsec                     t          |           S r,   )r3   r.   s    r0   with_raw_responsezAssistants.with_raw_response1   s    (...r2   AssistantsWithStreamingResponsec                     t          |           S r,   )r6   r.   s    r0   with_streaming_responsez"Assistants.with_streaming_response5   s    .t444r2   N
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                   ddi|pi }|                      dt          |||||||dt          j                  t	          ||	|
|          t
                    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   s               r0   createzAssistants.create9   s    l 'QM<ORQzz "#. ($0 ( "  (=  )+Q[el   #  
 
 	
r2   rT   assistant_idc          	         |st          d|          ddi|pi }|                     d| t          ||||          t                    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 rP   rQ   /assistants/rT   rW   rX   
ValueError_getr&   r   r/   r]   r@   rA   rB   rC   s         r0   retrievezAssistants.retrieve   s    .  	mk[gkklll&QM<ORQyy)<))(+Q[el     
 
 	
r2   r:   r;   r<   r=   rD   r>   r?   r@   rA   rB   rC   str | NotGivenc                   |st          d|          ddi|	pi }	|                     d| t          |||||||dt          j                  t          |	|
||          t                    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`   rP   rQ   ra   r:   r;   r<   r=   rD   r>   r?   rT   rU   )rd   rY   r   r$   AssistantUpdateParamsr&   r   r/   r]   r:   r;   r<   r=   rD   r>   r?   r@   rA   rB   rC   s                r0   updatezAssistants.update   s    t  	mk[gkklll&QM<ORQzz)<)) #. ($0 (" "  (=  )+Q[el   #  
 
 	
r2   afterbeforelimitorderr@   rA   rB   rC   rq   rr   rs   int | NotGivenrt   !Literal['asc', 'desc'] | NotGivenSyncCursorPage[Assistant]c                   ddi|pi }|                      dt          t                   t          ||||t	          ||||dt
          j                            t                    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
        rP   rQ   rR   )rq   rr   rs   rt   )r@   rA   rB   rC   query)pagerW   rD   )_get_api_listr   r   r&   r   r"   AssistantListParams	r/   rq   rr   rs   rt   r@   rA   rB   rC   s	            r0   listzAssistants.list   s    V 'QM<ORQ!!	*(+'%%!&"(!&!&	  *=    % " 
 
 	
r2   r    c          	         |st          d|          ddi|pi }|                     d| t          ||||          t                    S )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`   rP   rQ   ra   rT   rb   rd   _deleter&   r    rf   s         r0   deletezAssistants.delete8  s    .  	mk[gkklll&QM<ORQ||)<))(+Q[el   %  
 
 	
r2   )r*   r   )r*   r3   )r*   r6   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   )rq   ri   rr   ri   rs   ru   rt   rv   r@   rJ   rA   rK   rB   rL   rC   rM   r*   rw   r]   rE   r@   rJ   rA   rK   rB   rL   rC   rM   r*   r    __name__
__module____qualname__r   r1   r5   r8   r   r\   rg   ro   r   r    r2   r0   r'   r'   ,   s       # # # _# / / / _/ 5 5 5 _5 1:)21:09)29B )-$("&;DI
 I
 I
 I
 I
 I
b )-$("&;D 
  
  
  
  
  
L 1:)21:09 ))29B )-$("&;D!O
 O
 O
 O
 O
 O
h !*!* )3< )-$("&;D?
 ?
 ?
 ?
 ?
 ?
N )-$("&;D 
  
  
  
  
  
  
  
r2   c                      e Zd Zed1d            Zed2d            Zed3d            Zeeeeeeddded	
d4dZddded d5d"Z	eeeeeeeddded#d6d%Z
eeeeddded&d7d.Zddded d8d0ZdS )9r(   r*   r   c                *    t          | j                  S r,   )r   r-   r.   s    r0   r1   zAsyncAssistants.files\  s    $,'''r2   AsyncAssistantsWithRawResponsec                     t          |           S r,   )r   r.   s    r0   r5   z!AsyncAssistants.with_raw_response`  s    -d333r2   $AsyncAssistantsWithStreamingResponsec                     t          |           S r,   )r   r.   s    r0   r8   z'AsyncAssistants.with_streaming_responsed  s    3D999r2   Nr9   rD   rE   r:   rF   r;   rG   r<   r=   rH   r>   r?   rI   r@   rJ   rA   rK   rB   rL   rC   rM   r   c                  K   ddi|pi }|                      dt          |||||||dt          j                   d{V t	          ||	|
|          t
                     d{V S )rO   rP   rQ   rR   rS   NrT   rU   )rY   r   r#   rZ   r&   r   r[   s               r0   r\   zAsyncAssistants.createh  s      l 'QM<ORQZZ,"#. ($0 ( "  (=        )+Q[el   #   
 
 
 
 
 
 
 
 	
r2   rT   r]   c          	        K   |st          d|          ddi|pi }|                     d| t          ||||          t                     d{V S )r_   r`   rP   rQ   ra   rT   rb   Nrc   rf   s         r0   rg   zAsyncAssistants.retrieve  s      .  	mk[gkklll&QM<ORQYY)<))(+Q[el     
 
 
 
 
 
 
 
 	
r2   rh   ri   c                  K   |st          d|          ddi|	pi }	|                     d| t          |||||||dt          j                   d{V t          |	|
||          t                     d{V S )	rk   r`   rP   rQ   ra   rl   NrT   rU   )rd   rY   r   r$   rm   r&   r   rn   s                r0   ro   zAsyncAssistants.update  s      t  	mk[gkklll&QM<ORQZZ)<)),#. ($0 (" "  (=        )+Q[el   #   
 
 
 
 
 
 
 
 	
r2   rp   rq   rr   rs   ru   rt   rv   5AsyncPaginator[Assistant, AsyncCursorPage[Assistant]]c                   ddi|pi }|                      dt          t                   t          ||||t	          ||||dt
          j                            t                    S ry   )r|   r   r   r&   r   r"   r}   r~   s	            r0   r   zAsyncAssistants.list&  s    V 'QM<ORQ!! +(+'%%!&"(!&!&	  *=    % " 
 
 	
r2   r    c          	        K   |st          d|          ddi|pi }|                     d| t          ||||          t                     d{V S )r   r`   rP   rQ   ra   rT   rb   Nr   rf   s         r0   r   zAsyncAssistants.deleteg  s      .  	mk[gkklll&QM<ORQ\\)<))(+Q[el   % " 
 
 
 
 
 
 
 
 	
r2   )r*   r   )r*   r   )r*   r   r   r   r   )rq   ri   rr   ri   rs   ru   rt   rv   r@   rJ   rA   rK   rB   rL   rC   rM   r*   r   r   r   r   r2   r0   r(   r(   [  s       ( ( ( _( 4 4 4 _4 : : : _: 1:)21:09)29B )-$("&;DI
 I
 I
 I
 I
 I
b )-$("&;D 
  
  
  
  
  
L 1:)21:09 ))29B )-$("&;D!O
 O
 O
 O
 O
 O
h !*!* )3< )-$("&;D?
 ?
 ?
 ?
 ?
 ?
N )-$("&;D 
  
  
  
  
  
  
  
r2   c                  .    e Zd Zd	dZed
d            ZdS )r3   
assistantsr'   r*   Nonec                @   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r,   )_assistantsr	   to_raw_response_wrapperr\   rg   ro   r   r   r/   r   s     r0   __init__z"AssistantsWithRawResponse.__init__  s    %&>
 
 )@
 
 '>
 
 %<O
 
	 '>
 
r2   r   c                4    t          | j        j                  S r,   )r   r   r1   r.   s    r0   r1   zAssistantsWithRawResponse.files  s    #D$4$:;;;r2   Nr   r'   r*   r   )r*   r   r   r   r   r   r   r1   r   r2   r0   r3   r3     sH        
 
 
 
& < < < _< < <r2   r3   c                  .    e Zd Zd	dZed
d            ZdS )r   r   r(   r*   r   c                @   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r,   )r   r	   async_to_raw_response_wrapperr\   rg   ro   r   r   r   s     r0   r   z'AsyncAssistantsWithRawResponse.__init__  s    %&D
 
 )F
 
 'D
 
 %BO
 
	 'D
 
r2   r   c                4    t          | j        j                  S r,   )r   r   r1   r.   s    r0   r1   z$AsyncAssistantsWithRawResponse.files  s    ()9)?@@@r2   Nr   r(   r*   r   )r*   r   r   r   r2   r0   r   r     sN        
 
 
 
& A A A _A A Ar2   r   c                  .    e Zd Zd	dZed
d            ZdS )r6   r   r'   r*   r   c                   || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r,   )r   r   r\   rg   ro   r   r   r   s     r0   r   z(AssistantsWithStreamingResponse.__init__  s    %2
 
 5
 
 3
 
 1O
 
	 3
 
r2   r   c                4    t          | j        j                  S r,   )r   r   r1   r.   s    r0   r1   z%AssistantsWithStreamingResponse.files  s    )$*:*@AAAr2   Nr   )r*   r   r   r   r2   r0   r6   r6     sN        
 
 
 
& B B B _B B Br2   r6   c                  .    e Zd Zd	dZed
d            ZdS )r   r   r(   r*   r   c                   || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r,   )r   r   r\   rg   ro   r   r   r   s     r0   r   z-AsyncAssistantsWithStreamingResponse.__init__  s    %8
 
 ;
 
 9
 
 7O
 
	 9
 
r2   r   c                4    t          | j        j                  S r,   )r   r   r1   r.   s    r0   r1   z*AsyncAssistantsWithStreamingResponse.files  s    .t/?/EFFFr2   Nr   )r*   r   r   r   r2   r0   r   r     sN        
 
 
 
& G G G _G G Gr2   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   r6   r   r   r2   r0   <module>r      s   # " " " " " + + + + + + + + + + % % % % % %  ! ! ! ! ! !                A @ @ @ @ @ @ @ @ @ @ @ @ @        ( ' ' ' ' ' ; ; ; ; ; ; ; ; Z Z Z Z Z Z Z Z : : : : : : : :                      
 *
+l
 l
 l
 l
 l
 l
 l
 l
^	l
 l
 l
 l
 l
& l
 l
 l
^	< < < < < < < <2A A A A A A A A2B B B B B B B B2G G G G G G G G G Gr2   