
    +hpK                    @   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! 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e      Z+ G d de      Z, G d d      Z- G d d      Z.y)    )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)AsyncPaginatormake_request_options)ThreadMessagemessage_list_paramsmessage_create_paramsmessage_update_params)OpenAIAsyncOpenAIMessagesAsyncMessagesc            	          e Zd ZU ded<   ded<   d fdZeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded		 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	 xZ
S )r"   r	   filesMessagesWithRawResponsewith_raw_responsec                d    t         |   |       t        |      | _        t	        |       | _        y N)super__init__r	   r%   r&   r'   selfclient	__class__s     b/var/www/html/venv/lib/python3.12/site-packages/openai/resources/beta/threads/messages/messages.pyr+   zMessages.__init__"   s(     6]
!8!>    Nfile_idsmetadataextra_headersextra_query
extra_bodytimeoutc          
         ddi|xs i }| j                  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
        OpenAI-Betaassistants=v1	/threads/	/messagescontentroler3   r4   r5   r6   r7   r8   bodyoptionscast_to_postr   r   MessageCreateParamsr   r   
r-   	thread_idr@   rA   r3   r4   r5   r6   r7   r8   s
             r0   createzMessages.create'   sy    T 'QM<ORQzz	{), &  ( (	 &99 )+Q[el "  
 	
r1   rB   c          	     l    ddi|xs i }| j                  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
        r;   r<   r=   
/messages/rB   rE   rF   _getr   r   r-   
message_idrK   r5   r6   r7   r8   s          r0   retrievezMessages.retrievec   sV    0 'QM<ORQyy	{*ZL9(+Q[el "  
 	
r1   r4   r5   r6   r7   r8   c          
         ddi|xs i }| j                  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
        r;   r<   r=   rO   r4   rB   rC   rH   r   r   MessageUpdateParamsr   r   r-   rT   rK   r4   r5   r6   r7   r8   s           r0   updatezMessages.update   sl    < 'QM<ORQzz	{*ZL9 *h!79N9b9bc(+Q[el "  
 	
r1   afterbeforelimitorderr5   r6   r7   r8   c                   ddi|xs i }| j                  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
        r;   r<   r=   r>   )r^   r_   r`   ra   )r5   r6   r7   r8   query)pagerE   model)_get_api_listr   r   r   r   r   MessageListParams
r-   rK   r^   r_   r`   ra   r5   r6   r7   r8   s
             r0   listzMessages.list   s    V 'QM<ORQ!!	{),.(+'%%!&"(!&!&	 (99  % " 
 	
r1   )r.   r    returnNonerK   strr@   rn   rA   zLiteral['user']r3   zList[str] | NotGivenr4   Optional[object] | NotGivenr5   Headers | Noner6   Query | Noner7   Body | Noner8   'float | httpx.Timeout | None | NotGivenrk   r   rT   rn   rK   rn   r5   rp   r6   rq   r7   rr   r8   rs   rk   r   rT   rn   rK   rn   r4   ro   r5   rp   r6   rq   r7   rr   r8   rs   rk   r   )rK   rn   r^   str | NotGivenr_   rv   r`   int | NotGivenra   !Literal['asc', 'desc'] | NotGivenr5   rp   r6   rq   r7   rr   r8   rs   rk   zSyncCursorPage[ThreadMessage]__name__
__module____qualname____annotations__r+   r   rL   rU   r\   rj   __classcell__r/   s   @r0   r"   r"      s   L..? *309 )-$("&;D:
:
 	:

 :
 ':
 .:
 &:
 ":
  :
 9:
 
:
F )-$("&;D

 	
 &
 "
  
 9
 

L 1: )-$("&;D&
&
 	&

 .&
 &&
 "&
  &
 9&
 
&
X !*!* )3< )-$("&;D?
?
 	?

 ?
 ?
 1?
 &?
 "?
  ?
 9?
 
'?
r1   c            	          e Zd ZU ded<   ded<   d fdZeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded		 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	 xZ
S )r#   r
   r%   AsyncMessagesWithRawResponser'   c                d    t         |   |       t        |      | _        t	        |       | _        y r)   )r*   r+   r
   r%   r   r'   r,   s     r0   r+   zAsyncMessages.__init__   s)     '
!=d!Cr1   Nr2   c          
        K   ddi|xs i }| j                  d| dt        ||||dt        j                        t	        ||||	      t
               d{   S 7 w)	r:   r;   r<   r=   r>   r?   rB   rC   NrG   rJ   s
             r0   rL   zAsyncMessages.create   s     T 'QM<ORQZZ	{), &  ( (	 &99 )+Q[el "   
 
 	
 
s   AAAArB   c          	        K   ddi|xs i }| j                  d| d| t        ||||      t               d{   S 7 w)rN   r;   r<   r=   rO   rB   rP   NrQ   rS   s          r0   rU   zAsyncMessages.retrieve3  sd     0 'QM<ORQYY	{*ZL9(+Q[el "  
 
 	
 
s   9AA ArV   c          
        K   ddi|xs i }| j                  d| d| t        d|it        j                        t	        ||||      t
               d{   S 7 w)	rX   r;   r<   r=   rO   r4   rB   rC   NrY   r[   s           r0   r\   zAsyncMessages.updateT  sz     < 'QM<ORQZZ	{*ZL9 *h!79N9b9bc(+Q[el "   
 
 	
 
s   AAAAr]   c                   ddi|xs i }| j                  d| dt        t           t        ||||	t	        ||||dt
        j                              t              S rc   )rg   r   r   r   r   r   rh   ri   s
             r0   rj   zAsyncMessages.list|  s    V 'QM<ORQ!!	{), /(+'%%!&"(!&!&	 (99  % " 
 	
r1   )r.   r!   rk   rl   rm   rt   ru   )rK   rn   r^   rv   r_   rv   r`   rw   ra   rx   r5   rp   r6   rq   r7   rr   r8   rs   rk   z=AsyncPaginator[ThreadMessage, AsyncCursorPage[ThreadMessage]]ry   r   s   @r0   r#   r#      s   33D *309 )-$("&;D:
:
 	:

 :
 ':
 .:
 &:
 ":
  :
 9:
 
:
F )-$("&;D

 	
 &
 "
  
 9
 

L 1: )-$("&;D&
&
 	&

 .&
 &&
 "&
  &
 9&
 
&
X !*!* )3< )-$("&;D?
?
 	?

 ?
 ?
 1?
 &?
 "?
  ?
 9?
 
G?
r1   c                      e Zd ZddZy)r&   c                   t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r)   )r   r%   r   rL   rU   r\   rj   r-   messagess     r0   r+   z MessagesWithRawResponse.__init__  sf    )(..9
-OO
 0
 .OO
 ,MM
	r1   N)r   r"   rk   rl   rz   r{   r|   r+    r1   r0   r&   r&         
r1   r&   c                      e Zd ZddZy)r   c                   t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r)   )r   r%   r   rL   rU   r\   rj   r   s     r0   r+   z%AsyncMessagesWithRawResponse.__init__  sf    .x~~>
3OO
 6
 4OO
 2MM
	r1   N)r   r#   rk   rl   r   r   r1   r0   r   r     r   r1   r   )/
__future__r   typingr   r   r   typing_extensionsr   httpxr%   r	   r
   r   r   _typesr   r   r   r   r   _utilsr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.beta.threadsr   r   r   r   _clientr    r!   __all__r"   r#   r&   r   r   r1   r0   <module>r      s    # 0 0 %  U U A A ' < Q ; B  0
'M
 M
`M
$ M
`
 
$
 
r1   