
    хij                    x   S SK Jr  S SKJrJrJr  S SKJr  S SKrSSK	J
r
  SSKJrJrJrJrJr  SSKJrJr  SS	KJr  SS
KJrJr  SSKJrJr  SSKJrJr  SSKJ r J!r!  SSK"J#r#J$r$J%r%  SSK&J'r'  SSK(J)r)  SSK*J+r+  SS/r, " S S\5      r- " S S\5      r. " S S5      r/ " S S5      r0 " S S5      r1 " S S5      r2g)    )annotations)UnionIterableOptional)LiteralN   )_legacy_response)	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_list_paramsmessage_create_paramsmessage_update_params)Message)MessageDeleted)MessageContentPartParamMessagesAsyncMessagesc            
      f   \ rS rSr\SS j5       r\SS j5       r\\SSS\S.                   SS jjrSSS\S.             SS jjr	\SSS\S	.               SS
 jjr
\\\\\SSS\S.	                     SS jjrSSS\S.             SS jjrSrg)r        c                    [        U 5      $ z
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.

For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
)MessagesWithRawResponseselfs    `/home/james-whalen/.local/lib/python3.13/site-packages/openai/resources/beta/threads/messages.pywith_raw_responseMessages.with_raw_response!   s     't,,    c                    [        U 5      $ z
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/openai/openai-python#with_streaming_response
)MessagesWithStreamingResponser'   s    r)   with_streaming_response Messages.with_streaming_response+   s     -T22r,   Nattachmentsmetadataextra_headersextra_query
extra_bodytimeoutc                   U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU S3[        UUUUS.[        R                  5      [        XgXS9[        S9$ )	@  
Create a message.

Args:
  content: The text contents of the message.

  role:
      The role of the entity that is creating the message. Allowed values include:

      - `user`: Indicates the message is sent by an actual user and should be used in
        most cases to represent user-generated messages.
      - `assistant`: Indicates the message is generated by the assistant. Use this
        value to insert messages from the assistant into the conversation.

  attachments: A list of files attached to the message, and the tools they should be added to.

  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 maximum 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=v2	/threads/	/messagescontentroler3   r4   r5   r6   r7   r8   bodyoptionscast_to)
ValueError_postr   r   MessageCreateParamsr   r   
r(   	thread_idrA   rB   r3   r4   r5   r6   r7   r8   s
             r)   createMessages.create4   s    X WXaWdeff&QM<ORQzz	{), & #. (	 &99 )+Q[   
 	
r,   rC   c          
         U(       d  [        SU< 35      eU(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU SU 3[        X4XVS9[        S9$ )	  
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;   9Expected a non-empty value for `message_id` but received r<   r=   r>   
/messages/rC   rF   rG   rH   _getr   r   r(   
message_idrL   r5   r6   r7   r8   s          r)   retrieveMessages.retrievet   s    0 WXaWdeffXYcXfghh&QM<ORQyy	{*ZL9(+Q[   
 	
r,   r4   r5   r6   r7   r8   c                   U(       d  [        SU< 35      eU(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU SU 3[        SU0[        R                  5      [        XEXgS9[        S	9$ )
*  
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 maximum 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;   rQ   r<   r=   r>   rR   r4   rC   rD   )rH   rI   r   r   MessageUpdateParamsr   r   r(   rW   rL   r4   r5   r6   r7   r8   s           r)   updateMessages.update   s    < WXaWdeffXYcXfghh&QM<ORQzz	{*ZL9 *h!79N9b9bc(+Q[   
 	
r,   	afterbeforelimitorderrun_idr5   r6   r7   r8   c       	            U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU S3[        [           [	        UUU	U
[        UUUUUS.[        R                  5      S9[        S9$ 	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,
      starting 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.

  run_id: Filter messages by the run ID that generated them.

  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?   )rb   rc   rd   re   rf   )r5   r6   r7   r8   query)pagerF   model)rH   _get_api_listr   r   r   r   r   MessageListParamsr(   rL   rb   rc   rd   re   rf   r5   r6   r7   r8   s              r)   listMessages.list   s    \ WXaWdeff&QM<ORQ!!	{),((+'%%!&"(!&!&"( (99	  ' " 
 	
r,   c          
         U(       d  [        SU< 35      eU(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU SU 3[        X4XVS9[        S9$ )	  
Deletes 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;   rQ   r<   r=   r>   rR   rC   rS   rH   _deleter   r   rV   s          r)   deleteMessages.delete  s    0 WXaWdeffXYcXfghh&QM<ORQ||	{*ZL9(+Q[ #  
 	
r,    )returnr&   )rx   r/   rL   strrA   z-Union[str, Iterable[MessageContentPartParam]]rB   zLiteral['user', 'assistant']r3   z?Optional[Iterable[message_create_params.Attachment]] | NotGivenr4   Optional[object] | NotGivenr5   Headers | Noner6   Query | Noner7   Body | Noner8   'float | httpx.Timeout | None | NotGivenrx   r   rW   rz   rL   rz   r5   r|   r6   r}   r7   r~   r8   r   rx   r   rW   rz   rL   rz   r4   r{   r5   r|   r6   r}   r7   r~   r8   r   rx   r   )rL   rz   rb   str | NotGivenrc   r   rd   int | NotGivenre   !Literal['asc', 'desc'] | NotGivenrf   r   r5   r|   r6   r}   r7   r~   r8   r   rx   zSyncCursorPage[Message]rW   rz   rL   rz   r5   r|   r6   r}   r7   r~   r8   r   rx   r   __name__
__module____qualname____firstlineno__r   r*   r0   r
   rM   rX   r_   ro   ru   __static_attributes__rw   r,   r)   r    r        sa   - - 3 3 Xa09 )-$("&;D>
>
 ?	>

 +>
 U>
 .>
 &>
 ">
  >
 9>
 
>
N )-$("&;D#
#
 	#
 &#
 "#
  #
 9#
 
#
T 1: )-$("&;D*
*
 	*

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

 E
 E
 1E
 E
 &E
 "E
  E
 9E
 
!E
\ )-$("&;D#
#
 	#
 &#
 "#
  #
 9#
 
#
 #
r,   c            
      f   \ rS rSr\SS j5       r\SS j5       r\\SSS\S.                   SS jjrSSS\S.             SS jjr	\SSS\S	.               SS
 jjr
\\\\\SSS\S.	                     SS jjrSSS\S.             SS jjrSrg)r!   i2  c                    [        U 5      $ r%   )AsyncMessagesWithRawResponser'   s    r)   r*   AsyncMessages.with_raw_response3  s     ,D11r,   c                    [        U 5      $ r.   )"AsyncMessagesWithStreamingResponser'   s    r)   r0   %AsyncMessages.with_streaming_response=  s     2$77r,   Nr2   c                  #    U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU S3[        UUUUS.[        R                  5      I Sh  vN [        XgXS9[        S	9I Sh  vN $  N N7f)
r:   r;   r<   r=   r>   r?   r@   NrC   rD   )rH   rI   r   r   rJ   r   r   rK   s
             r)   rM   AsyncMessages.createF  s     X WXaWdeff&QM<ORQZZ	{),,& #. (	 &99  )+Q[    
 
 	

s$   AA;A7
A;2A93A;9A;rC   c          
        #    U(       d  [        SU< 35      eU(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU SU 3[        X4XVS9[        S9I S	h  vN $  N7f)
rP   r;   rQ   r<   r=   r>   rR   rC   rS   NrT   rV   s          r)   rX   AsyncMessages.retrieve  s     0 WXaWdeffXYcXfghh&QM<ORQYY	{*ZL9(+Q[   
 
 	
 
   A"A+$A)%A+rZ   c               $  #    U(       d  [        SU< 35      eU(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU SU 3[        SU0[        R                  5      I Sh  vN [        XEXgS	9[        S
9I Sh  vN $  N N7f)r\   r;   rQ   r<   r=   r>   rR   r4   NrC   rD   )rH   rI   r   r   r]   r   r   r^   s           r)   r_   AsyncMessages.update  s     < WXaWdeffXYcXfghh&QM<ORQZZ	{*ZL9,j(-CEZEnEnoo(+Q[    
 
 	
o
s$   A-B/B
0BBBBra   c       	            U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU S3[        [           [	        UUU	U
[        UUUUUS.[        R                  5      S9[        S9$ rh   )rH   rl   r   r   r   r   r   rm   rn   s              r)   ro   AsyncMessages.list  s    \ WXaWdeff&QM<ORQ!!	{), )(+'%%!&"(!&!&"( (99	  ' " 
 	
r,   c          
        #    U(       d  [        SU< 35      eU(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU SU 3[        X4XVS9[        S9I S	h  vN $  N7f)
rr   r;   rQ   r<   r=   r>   rR   rC   rS   Nrs   rV   s          r)   ru   AsyncMessages.delete  s     0 WXaWdeffXYcXfghh&QM<ORQ\\	{*ZL9(+Q[ # " 
 
 	
 
r   rw   )rx   r   )rx   r   ry   r   r   )rL   rz   rb   r   rc   r   rd   r   re   r   rf   r   r5   r|   r6   r}   r7   r~   r8   r   rx   z1AsyncPaginator[Message, AsyncCursorPage[Message]]r   r   rw   r,   r)   r!   r!   2  sa   2 2 8 8 Xa09 )-$("&;D>
>
 ?	>

 +>
 U>
 .>
 &>
 ">
  >
 9>
 
>
N )-$("&;D#
#
 	#
 &#
 "#
  #
 9#
 
#
T 1: )-$("&;D*
*
 	*

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

 E
 E
 1E
 E
 &E
 "E
  E
 9E
 
;E
\ )-$("&;D#
#
 	#
 &#
 "#
  #
 9#
 
#
 #
r,   c                      \ rS rSrSS jrSrg)r&   iD  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g N)	_messagesr	   to_raw_response_wrapperrM   rX   r_   ro   ru   r(   messagess     r)   __init__ MessagesWithRawResponse.__init__E  s    !&>>OO
 )@@
 '>>OO
 %<<MM
	 '>>OO
r,   r   rM   ru   ro   rX   r_   Nr   r    rx   Noner   r   r   r   r   r   rw   r,   r)   r&   r&   D      
r,   r&   c                      \ rS rSrSS jrSrg)r   iY  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g r   )r   r	   async_to_raw_response_wrapperrM   rX   r_   ro   ru   r   s     r)   r   %AsyncMessagesWithRawResponse.__init__Z  s    !&DDOO
 )FF
 'DDOO
 %BBMM
	 'DDOO
r,   r   Nr   r!   rx   r   r   rw   r,   r)   r   r   Y  r   r,   r   c                      \ rS rSrSS jrSrg)r/   in  c                   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        g r   )r   r   rM   rX   r_   ro   ru   r   s     r)   r   &MessagesWithStreamingResponse.__init__o  sp    !2OO
 5
 3OO
 1MM
	 3OO
r,   r   Nr   r   rw   r,   r)   r/   r/   n  r   r,   r/   c                      \ rS rSrSS jrSrg)r   i  c                   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        g r   )r   r   rM   rX   r_   ro   ru   r   s     r)   r   +AsyncMessagesWithStreamingResponse.__init__  sp    !8OO
 ;
 9OO
 7MM
	 9OO
r,   r   Nr   r   rw   r,   r)   r   r     r   r,   r   )3
__future__r   typingr   r   r   typing_extensionsr   httpx r	   _typesr
   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.beta.threadsr   r   r   types.beta.threads.messager   "types.beta.threads.message_deletedr   -types.beta.threads.message_content_part_paramr   __all__r    r!   r&   r   r/   r   rw   r,   r)   <module>r      s    # , , %  ! @ @ ( ; Z : e d 2 A U
'O
 O
dO
$ O
d
 
*
 
*
 
*
 
r,   