
    OYhff                    x   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 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% ddl&m'Z' ddl(m)Z) ddl*m+Z+ ddgZ, G d de      Z- G d de      Z. G d d      Z/ G d d      Z0 G d d      Z1 G d d      Z2y)    )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   e Z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	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z	eeeeeddded
		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
ddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r    c                    t        |       S N)MessagesWithRawResponseselfs    e/var/www/feuerwehr-webapp/venv/lib/python3.12/site-packages/openai/resources/beta/threads/messages.pywith_raw_responsezMessages.with_raw_response!   s    &t,,    c                    t        |       S r$   )MessagesWithStreamingResponser&   s    r(   with_streaming_responsez Messages.with_streaming_response%   s    ,T22r*   Nattachmentsmetadataextra_headersextra_query
extra_bodytimeoutc          
         |st        d|      ddi|xs i }| j                  d| dt        ||||dt        j                        t        ||||	      t              S )	  
        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 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=v2	/threads/	/messagescontentroler/   r0   r1   r2   r3   r4   bodyoptionscast_to)
ValueError_postr   r   MessageCreateParamsr   r   
r'   	thread_idr=   r>   r/   r0   r1   r2   r3   r4   s
             r(   createzMessages.create)   s    X WXaWdeff&QM<ORQzz	{), & #. (	 &99 )+Q[el   
 	
r*   r?   c          	         |st        d|      |st        d|      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
        r7   9Expected a non-empty value for `message_id` but received r8   r9   r:   
/messages/r?   rB   rC   rD   _getr   r   r'   
message_idrH   r1   r2   r3   r4   s          r(   retrievezMessages.retrievei   s    0 WXaWdeffXYcXfghh&QM<ORQyy	{*ZL9(+Q[el   
 	
r*   r0   r1   r2   r3   r4   c          
         |st        d|      |st        d|      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
        r7   rL   r8   r9   r:   rM   r0   r?   r@   )rD   rE   r   r   MessageUpdateParamsr   r   r'   rR   rH   r0   r1   r2   r3   r4   s           r(   updatezMessages.update   s    < WXaWdeffXYcXfghh&QM<ORQzz	{*ZL9 *h!79N9b9bc(+Q[el   
 	
r*   	afterbeforelimitorderrun_idr1   r2   r3   r4   c       	            |st        d|      ddi|xs i }| j                  d| dt        t           t	        |||	|
t        |||||dt        j                              t              S 	af  
        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.

          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
        r7   r8   r9   r:   r;   )r[   r\   r]   r^   r_   )r1   r2   r3   r4   query)pagerB   model)rD   _get_api_listr   r   r   r   r   MessageListParamsr'   rH   r[   r\   r]   r^   r_   r1   r2   r3   r4   s              r(   listzMessages.list   s    \ WXaWdeff&QM<ORQ!!	{),((+'%%!&"(!&!&"( (99	  ' " 
 	
r*   c          	         |st        d|      |st        d|      ddi|xs i }| j                  d| d| t        ||||      t              S )	F  
        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
        r7   rL   r8   r9   r:   rM   r?   rN   rD   _deleter   r   rQ   s          r(   deletezMessages.delete  s    0 WXaWdeffXYcXfghh&QM<ORQ||	{*ZL9(+Q[el #  
 	
r*   )returnr%   )rn   r,   rH   strr=   z-Union[str, Iterable[MessageContentPartParam]]r>   zLiteral['user', 'assistant']r/   z?Optional[Iterable[message_create_params.Attachment]] | NotGivenr0   Optional[object] | NotGivenr1   Headers | Noner2   Query | Noner3   Body | Noner4   'float | httpx.Timeout | None | NotGivenrn   r   rR   rp   rH   rp   r1   rr   r2   rs   r3   rt   r4   ru   rn   r   rR   rp   rH   rp   r0   rq   r1   rr   r2   rs   r3   rt   r4   ru   rn   r   )rH   rp   r[   str | NotGivenr\   rx   r]   int | NotGivenr^   !Literal['asc', 'desc'] | NotGivenr_   rx   r1   rr   r2   rs   r3   rt   r4   ru   rn   zSyncCursorPage[Message]rR   rp   rH   rp   r1   rr   r2   rs   r3   rt   r4   ru   rn   r   __name__
__module____qualname__r   r)   r-   r
   rI   rS   rY   rh   rm    r*   r(   r    r        s\   - - 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   e Z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	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z	eeeeeddded
		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
ddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r!   c                    t        |       S r$   )AsyncMessagesWithRawResponser&   s    r(   r)   zAsyncMessages.with_raw_response(  s    +D11r*   c                    t        |       S r$   )"AsyncMessagesWithStreamingResponser&   s    r(   r-   z%AsyncMessages.with_streaming_response,  s    1$77r*   Nr.   c          
        K   |st        d|      ddi|xs i }| j                  d| dt        ||||dt        j                         d{   t        ||||	      t        	       d{   S 7 $7 w)
r6   r7   r8   r9   r:   r;   r<   Nr?   r@   )rD   rE   r   r   rF   r   r   rG   s
             r(   rI   zAsyncMessages.create0  s     X WXaWdeff&QM<ORQZZ	{),,& #. (	 &99  )+Q[el    
 
 	

s$   AA8A4
A8/A60A86A8r?   c          	        K   |st        d|      |st        d|      ddi|xs i }| j                  d| d| t        ||||      t               d	{   S 7 w)
rK   r7   rL   r8   r9   r:   rM   r?   rN   NrO   rQ   s          r(   rS   zAsyncMessages.retrievep  s     0 WXaWdeffXYcXfghh&QM<ORQYY	{*ZL9(+Q[el   
 
 	
 
   AA"A A"rT   c          
       K   |st        d|      |st        d|      ddi|xs i }| j                  d| d| t        d|it        j                         d{   t        ||||	      t        
       d{   S 7 $7 w)rV   r7   rL   r8   r9   r:   rM   r0   Nr?   r@   )rD   rE   r   r   rW   r   r   rX   s           r(   rY   zAsyncMessages.update  s     < WXaWdeffXYcXfghh&QM<ORQZZ	{*ZL9,j(-CEZEnEnoo(+Q[el    
 
 	
o
s$   ABB
B>B?BBrZ   c       	            |st        d|      ddi|xs i }| j                  d| dt        t           t	        |||	|
t        |||||dt        j                              t              S ra   )rD   re   r   r   r   r   r   rf   rg   s              r(   rh   zAsyncMessages.list  s    \ WXaWdeff&QM<ORQ!!	{), )(+'%%!&"(!&!&"( (99	  ' " 
 	
r*   c          	        K   |st        d|      |st        d|      ddi|xs i }| j                  d| d| t        ||||      t               d	{   S 7 w)
rj   r7   rL   r8   r9   r:   rM   r?   rN   Nrk   rQ   s          r(   rm   zAsyncMessages.delete  s     0 WXaWdeffXYcXfghh&QM<ORQ\\	{*ZL9(+Q[el # " 
 
 	
 
r   )rn   r   )rn   r   ro   rv   rw   )rH   rp   r[   rx   r\   rx   r]   ry   r^   rz   r_   rx   r1   rr   r2   rs   r3   rt   r4   ru   rn   z1AsyncPaginator[Message, AsyncCursorPage[Message]]r{   r|   r   r*   r(   r!   r!   '  s\   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                      e Zd ZddZy)r%   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y r$   )	_messagesr	   to_raw_response_wrapperrI   rS   rY   rh   rm   r'   messagess     r(   __init__z MessagesWithRawResponse.__init__/  s    !&>>OO
 )@@
 '>>OO
 %<<MM
	 '>>OO
r*   Nr   r    rn   Noner}   r~   r   r   r   r*   r(   r%   r%   .      
r*   r%   c                      e Zd ZddZy)r   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y r$   )r   r	   async_to_raw_response_wrapperrI   rS   rY   rh   rm   r   s     r(   r   z%AsyncMessagesWithRawResponse.__init__D  s    !&DDOO
 )FF
 'DDOO
 %BBMM
	 'DDOO
r*   Nr   r!   rn   r   r   r   r*   r(   r   r   C  r   r*   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   rI   rS   rY   rh   rm   r   s     r(   r   z&MessagesWithStreamingResponse.__init__Y  sr    !2OO
 5
 3OO
 1MM
	 3OO
r*   Nr   r   r   r*   r(   r,   r,   X  r   r*   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   rI   rS   rY   rh   rm   r   s     r(   r   z+AsyncMessagesWithStreamingResponse.__init__n  sr    !8OO
 ;
 9OO
 7MM
	 9OO
r*   Nr   r   r   r*   r(   r   r   m  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   r   r*   r(   <module>r      s    # , , %  ! @ @ ( ; Z : e d 2 A U
'D
 D
ND
$ D
N
 
*
 
*
 
*
 
r*   