
    f jX                       d dl mZ d dl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' ddl(m)Z)m*Z*m+Z+m,Z, ddgZ- G d de          Z. G d de          Z/ G d d          Z0 G d d          Z1 G d d          Z2 G d d          Z3dS )    )annotations)List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)AsyncPaginatormake_request_options)Messagemessage_list_paramsmessage_create_paramsmessage_update_paramsMessagesAsyncMessagesc            	          e Zd Zed,d            Zed-d            Zed.d            Zeeddded	d/dZdddedd0dZ	eddded d1d!Z
eeeeddded"d2d+ZdS )3r$   returnr
   c                *    t          | j                  S N)r
   _clientselfs    C:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\openai/resources/beta/threads/messages/messages.pyfileszMessages.files&   s    T\"""    MessagesWithRawResponsec                     t          |           S r)   )r0   r+   s    r-   with_raw_responsezMessages.with_raw_response*   s    &t,,,r/   MessagesWithStreamingResponsec                     t          |           S r)   )r3   r+   s    r-   with_streaming_responsez Messages.with_streaming_response.   s    ,T222r/   Nfile_idsmetadataextra_headersextra_query
extra_bodytimeout	thread_idstrcontentroleLiteral['user']r7   List[str] | NotGivenr8   Optional[object] | NotGivenr9   Headers | Noner:   Query | Noner;   Body | Noner<   'float | httpx.Timeout | None | NotGivenr    c          
         |st          d|          ddi|pi }|                     d| dt          ||||dt          j                  t          ||||	          t                    S )	`  
        Create a message.

        Args:
          content: The content of the message.

          role: The role of the entity that is creating the message. Currently only `user` is
              supported.

          file_ids: A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that
              the message should use. There can be a maximum of 10 files attached to a
              message. Useful for tools like `retrieval` and `code_interpreter` that can
              access and use files.

          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.

          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
        8Expected a non-empty value for `thread_id` but received OpenAI-Betaassistants=v1	/threads/	/messagesr?   r@   r7   r8   r9   r:   r;   r<   bodyoptionscast_to)
ValueError_postr   r"   MessageCreateParamsr   r    
r,   r=   r?   r@   r7   r8   r9   r:   r;   r<   s
             r-   createzMessages.create2   s    T  	geXaeefff&QM<ORQzz,	,,, &  ( (	  &9  )+Q[el     
 
 	
r/   rP   
message_idc          	         |st          d|          |st          d|          ddi|pi }|                     d| d| t          ||||          t                    S )	G  
        Retrieve a message.

        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
        rJ   9Expected a non-empty value for `message_id` but received rK   rL   rM   
/messages/rP   rS   rT   rU   _getr   r    r,   rZ   r=   r9   r:   r;   r<   s          r-   retrievezMessages.retrievep   s    0  	geXaeefff 	igYcgghhh&QM<ORQyy9	99Z99(+Q[el     
 
 	
r/   r8   r9   r:   r;   r<   c          
         |st          d|          |st          d|          ddi|pi }|                     d| d| t          d|it          j                  t          ||||          t          	          S )
  
        Modifies a message.

        Args:
          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.

          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
        rJ   r]   rK   rL   rM   r^   r8   rP   rQ   )rU   rV   r   r#   MessageUpdateParamsr   r    r,   rZ   r=   r8   r9   r:   r;   r<   s           r-   updatezMessages.update   s    <  	geXaeefff 	igYcgghhh&QM<ORQzz9	99Z99 *h!79N9bcc(+Q[el     
 
 	
r/   afterbeforelimitorderr9   r:   r;   r<   rk   str | NotGivenrl   rm   int | NotGivenrn   !Literal['asc', 'desc'] | NotGivenSyncCursorPage[Message]c                   |st          d|          ddi|pi }|                     d| dt          t                   t	          ||||	t          ||||dt          j                            t                    S 	a   
        Returns a list of messages for a given thread.

        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
        rJ   rK   rL   rM   rN   )rk   rl   rm   rn   )r9   r:   r;   r<   query)pagerS   model)rU   _get_api_listr   r    r   r   r!   MessageListParams
r,   r=   rk   rl   rm   rn   r9   r:   r;   r<   s
             r-   listzMessages.list   s    V  	geXaeefff&QM<ORQ!!,	,,,((+'%%!&"(!&!&	  (9    % " 
 
 	
r/   )r'   r
   )r'   r0   )r'   r3   r=   r>   r?   r>   r@   rA   r7   rB   r8   rC   r9   rD   r:   rE   r;   rF   r<   rG   r'   r    rZ   r>   r=   r>   r9   rD   r:   rE   r;   rF   r<   rG   r'   r    rZ   r>   r=   r>   r8   rC   r9   rD   r:   rE   r;   rF   r<   rG   r'   r    )r=   r>   rk   ro   rl   ro   rm   rp   rn   rq   r9   rD   r:   rE   r;   rF   r<   rG   r'   rr   __name__
__module____qualname__r   r.   r2   r5   r   rY   rc   ri   r{    r/   r-   r$   r$   %   sH       # # # _# - - - _- 3 3 3 _3 *309 )-$("&;D<
 <
 <
 <
 <
 <
J )-$("&;D#
 #
 #
 #
 #
 #
T 1: )-$("&;D*
 *
 *
 *
 *
 *
` !*!* )3< )-$("&;DA
 A
 A
 A
 A
 A
 A
 A
r/   c            	          e Zd Zed,d            Zed-d            Zed.d            Zeeddded	d/dZdddedd0dZ	eddded d1d!Z
eeeeddded"d2d+ZdS )3r%   r'   r   c                *    t          | j                  S r)   )r   r*   r+   s    r-   r.   zAsyncMessages.files  s    $,'''r/   AsyncMessagesWithRawResponsec                     t          |           S r)   )r   r+   s    r-   r2   zAsyncMessages.with_raw_response
  s    +D111r/   "AsyncMessagesWithStreamingResponsec                     t          |           S r)   )r   r+   s    r-   r5   z%AsyncMessages.with_streaming_response  s    1$777r/   Nr6   r=   r>   r?   r@   rA   r7   rB   r8   rC   r9   rD   r:   rE   r;   rF   r<   rG   r    c          
        K   |st          d|          ddi|pi }|                     d| dt          ||||dt          j                   d{V t          ||||	          t          	           d{V S )
rI   rJ   rK   rL   rM   rN   rO   NrP   rQ   )rU   rV   r   r"   rW   r   r    rX   s
             r-   rY   zAsyncMessages.create  s      T  	geXaeefff&QM<ORQZZ,	,,,,&  ( (	  &9        )+Q[el      
 
 
 
 
 
 
 
 	
r/   rP   rZ   c          	        K   |st          d|          |st          d|          ddi|pi }|                     d| d| t          ||||          t                     d	{V S )
r\   rJ   r]   rK   rL   rM   r^   rP   r_   Nr`   rb   s          r-   rc   zAsyncMessages.retrieveP  s      0  	geXaeefff 	igYcgghhh&QM<ORQYY9	99Z99(+Q[el     
 
 
 
 
 
 
 
 	
r/   rd   c          
       K   |st          d|          |st          d|          ddi|pi }|                     d| d| t          d|it          j                   d{V t          ||||	          t          
           d{V S )rf   rJ   r]   rK   rL   rM   r^   r8   NrP   rQ   )rU   rV   r   r#   rg   r   r    rh   s           r-   ri   zAsyncMessages.updateu  s      <  	geXaeefff 	igYcgghhh&QM<ORQZZ9	99Z99,j(-CEZEnoooooooo(+Q[el      
 
 
 
 
 
 
 
 	
r/   rj   rk   ro   rl   rm   rp   rn   rq   1AsyncPaginator[Message, AsyncCursorPage[Message]]c                   |st          d|          ddi|pi }|                     d| dt          t                   t	          ||||	t          ||||dt          j                            t                    S rt   )rU   rx   r   r    r   r   r!   ry   rz   s
             r-   r{   zAsyncMessages.list  s    V  	geXaeefff&QM<ORQ!!,	,,, )(+'%%!&"(!&!&	  (9    % " 
 
 	
r/   )r'   r   )r'   r   )r'   r   r|   r}   r~   )r=   r>   rk   ro   rl   ro   rm   rp   rn   rq   r9   rD   r:   rE   r;   rF   r<   rG   r'   r   r   r   r/   r-   r%   r%     sH       ( ( ( _( 2 2 2 _2 8 8 8 _8 *309 )-$("&;D<
 <
 <
 <
 <
 <
J )-$("&;D#
 #
 #
 #
 #
 #
T 1: )-$("&;D*
 *
 *
 *
 *
 *
` !*!* )3< )-$("&;DA
 A
 A
 A
 A
 A
 A
 A
r/   c                  .    e Zd Zd	dZed
d            ZdS )r0   messagesr$   r'   Nonec                   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r)   )	_messagesr   to_raw_response_wrapperrY   rc   ri   r{   r,   r   s     r-   __init__z MessagesWithRawResponse.__init__  sx    !&>O
 
 )@
 
 '>O
 
 %<M
 
			r/   r   c                4    t          | j        j                  S r)   )r   r   r.   r+   s    r-   r.   zMessagesWithRawResponse.files  s    #DN$8999r/   Nr   r$   r'   r   )r'   r   r   r   r   r   r   r.   r   r/   r-   r0   r0     sH        
 
 
 
  : : : _: : :r/   r0   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                  | _        d S r)   )r   r   async_to_raw_response_wrapperrY   rc   ri   r{   r   s     r-   r   z%AsyncMessagesWithRawResponse.__init__  sx    !&DO
 
 )F
 
 'DO
 
 %BM
 
			r/   r   c                4    t          | j        j                  S r)   )r   r   r.   r+   s    r-   r.   z"AsyncMessagesWithRawResponse.files  s    ()=>>>r/   Nr   r%   r'   r   )r'   r   r   r   r/   r-   r   r     sH        
 
 
 
  ? ? ? _? ? ?r/   r   c                  .    e Zd Zd	dZed
d            ZdS )r3   r   r$   r'   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r)   )r   r   rY   rc   ri   r{   r   s     r-   r   z&MessagesWithStreamingResponse.__init__  sl    !2O
 
 5
 
 3O
 
 1M
 
			r/   r   c                4    t          | j        j                  S r)   )r   r   r.   r+   s    r-   r.   z#MessagesWithStreamingResponse.files"  s    )$.*>???r/   Nr   )r'   r   r   r   r/   r-   r3   r3     sN        
 
 
 
  @ @ @ _@ @ @r/   r3   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                  | _        d S r)   )r   r   rY   rc   ri   r{   r   s     r-   r   z+AsyncMessagesWithStreamingResponse.__init__(  sl    !8O
 
 ;
 
 9O
 
 7M
 
			r/   r   c                4    t          | j        j                  S r)   )r   r   r.   r+   s    r-   r.   z(AsyncMessagesWithStreamingResponse.files8  s    .t~/CDDDr/   Nr   )r'   r   r   r   r/   r-   r   r   '  sN        
 
 
 
  E E E _E E Er/   r   )4
__future__r   typingr   r   typing_extensionsr   httpx r   r.   r
   r   r   r   r   r   _typesr   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.beta.threadsr    r!   r"   r#   __all__r$   r%   r0   r   r3   r   r   r/   r-   <module>r      s   # " " " " " ! ! ! ! ! ! ! ! % % % % % %  " " " " " "                B A A A A A A A A A A A A A        ) ( ( ( ( ( < < < < < < < < [ [ [ [ [ [ [ [ ; ; ; ; ; ; ; ;        o n n n n n n n n n n n
']
 ]
 ]
 ]
 ]
 ]
 ]
 ]
@]
 ]
 ]
 ]
 ]
$ ]
 ]
 ]
@: : : : : : : :,? ? ? ? ? ? ? ?,@ @ @ @ @ @ @ @,E E E E E E E E E Er/   