
    2iL                       d dl mZ d dlmZ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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# ddl$m%Z%m&Z& ddl'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          Z0 G d de          Z1 G d d          Z2 G d d          Z3 G d d          Z4 G d d          Z5dS )    )annotations)IterableOptionalN   )_legacy_response   )Items
AsyncItemsItemsWithRawResponseAsyncItemsWithRawResponseItemsWithStreamingResponseAsyncItemsWithStreamingResponse)BodyOmitQueryHeadersNotGivenomit	not_given)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)make_request_options)conversation_create_paramsconversation_update_params)Metadata)Conversation)ResponseInputItemParam)ConversationDeletedResourceConversationsAsyncConversationsc                      e Zd 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d%dZd	d	d	e	dd&dZd	d	d	e	dd'd Zd	S )(r$   ,Manage conversations and conversation items.returnr	   c                *    t          | j                  S r'   )r	   _clientselfs    s/root/.openclaw/workspace/.venv-openai/lib/python3.11/site-packages/openai/resources/conversations/conversations.pyitemszConversations.items$   s     T\"""    ConversationsWithRawResponsec                     t          |           S a  
        This property can be used as a prefix for any HTTP method call to return
        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
        )r1   r,   s    r.   with_raw_responsezConversations.with_raw_response)   s     ,D111r0   "ConversationsWithStreamingResponsec                     t          |           S 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
        )r5   r,   s    r.   with_streaming_responsez%Conversations.with_streaming_response3   s     2$777r0   Nr/   metadataextra_headersextra_query
extra_bodytimeoutr/   1Optional[Iterable[ResponseInputItemParam]] | Omitr:   Optional[Metadata] | Omitr;   Headers | Noner<   Query | Noner=   Body | Noner>   'float | httpx.Timeout | None | NotGivenr!   c          
         |                      dt          ||dt          j                  t	          ||||          t
                    S )X  
        Create a conversation.

        Args:
          items: Initial items to include in the conversation context. You may add up to 20 items
              at a time.

          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, and
              querying for objects via API or the dashboard.

              Keys are strings with a maximum length of 64 characters. Values are strings with
              a maximum length of 512 characters.

          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
        /conversationsr/   r:   r;   r<   r=   r>   bodyoptionscast_to)_postr   r   ConversationCreateParamsr   r!   r-   r/   r:   r;   r<   r=   r>   s          r.   createzConversations.create<   sl    D zz " (  +C  )+Q[el   !  
 
 	
r0   rI   conversation_idstrc          	         |st          d|          |                     d| t          ||||          t                    S )F  
        Get a conversation

        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 `conversation_id` but received /conversations/rI   rL   rM   
ValueError_getr   r!   r-   rR   r;   r<   r=   r>   s         r.   retrievezConversations.retrievem   sm    .  	sq^mqqrrryy/o//(+Q[el   !  
 
 	
r0   Optional[Metadata]c          
         |st          d|          |                     d| t          d|it          j                  t          ||||          t                    S )  
        Update a conversation

        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, and
              querying for objects via API or the dashboard.

              Keys are strings with a maximum length of 64 characters. Values are strings with
              a maximum length of 512 characters.

          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
        rV   rW   r:   rI   rJ   )rZ   rN   r   r   ConversationUpdateParamsr   r!   r-   rR   r:   r;   r<   r=   r>   s          r.   updatezConversations.update   s    >  	sq^mqqrrrzz/o// *h!79S9lmm(+Q[el   !  
 
 	
r0   r#   c          	         |st          d|          |                     d| t          ||||          t                    S )y  Delete a conversation.

        Items in the conversation will not be deleted.

        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
        rV   rW   rI   rX   rZ   _deleter   r#   r\   s         r.   deletezConversations.delete   sm    0  	sq^mqqrrr||/o//(+Q[el   0  
 
 	
r0   )r(   r	   )r(   r1   )r(   r5   r/   r?   r:   r@   r;   rA   r<   rB   r=   rC   r>   rD   r(   r!   rR   rS   r;   rA   r<   rB   r=   rC   r>   rD   r(   r!   rR   rS   r:   r^   r;   rA   r<   rB   r=   rC   r>   rD   r(   r!   rR   rS   r;   rA   r<   rB   r=   rC   r>   rD   r(   r#   __name__
__module____qualname____doc__r   r/   r4   r8   r   r   rQ   r]   rc   rh    r0   r.   r$   r$   !   s5       66# # # _# 2 2 2 _2 8 8 8 _8 DH.2 )-$("&;D/
 /
 /
 /
 /
 /
n )-$("&;D
 
 
 
 
 
P )-$("&;D(
 (
 (
 (
 (
 (
` )-$("&;D 
  
  
  
  
  
  
  
r0   c                      e Zd 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d%dZd	d	d	e	dd&dZd	d	d	e	dd'd Zd	S )(r%   r'   r(   r
   c                *    t          | j                  S r*   )r
   r+   r,   s    r.   r/   zAsyncConversations.items   s     $,'''r0   !AsyncConversationsWithRawResponsec                     t          |           S r3   )ru   r,   s    r.   r4   z$AsyncConversations.with_raw_response   s     1666r0   'AsyncConversationsWithStreamingResponsec                     t          |           S r7   )rw   r,   s    r.   r8   z*AsyncConversations.with_streaming_response   s     7t<<<r0   Nr9   r/   r?   r:   r@   r;   rA   r<   rB   r=   rC   r>   rD   r!   c          
        K   |                      dt          ||dt          j                   d{V t	          ||||          t
                     d{V S )rF   rG   rH   NrI   rJ   )rN   r   r   rO   r   r!   rP   s          r.   rQ   zAsyncConversations.create   s      D ZZ," (  +C        )+Q[el   !   
 
 
 
 
 
 
 
 	
r0   rI   rR   rS   c          	        K   |st          d|          |                     d| t          ||||          t                     d{V S )rU   rV   rW   rI   rX   NrY   r\   s         r.   r]   zAsyncConversations.retrieve'  s      .  	sq^mqqrrrYY/o//(+Q[el   !  
 
 
 
 
 
 
 
 	
r0   r^   c          
        K   |st          d|          |                     d| t          d|it          j                   d{V t          ||||          t                     d{V S )r`   rV   rW   r:   NrI   rJ   )rZ   rN   r   r   ra   r   r!   rb   s          r.   rc   zAsyncConversations.updateH  s      >  	sq^mqqrrrZZ/o//,X&(B([        )+Q[el   !   	
 	
 	
 	
 	
 	
 	
 	
 		
r0   r#   c          	        K   |st          d|          |                     d| t          ||||          t                     d{V S )re   rV   rW   rI   rX   Nrf   r\   s         r.   rh   zAsyncConversations.deletet  s      0  	sq^mqqrrr\\/o//(+Q[el   0 " 
 
 
 
 
 
 
 
 	
r0   )r(   r
   )r(   ru   )r(   rw   ri   rj   rk   rl   rm   rr   r0   r.   r%   r%      s5       66( ( ( _( 7 7 7 _7 = = = _= DH.2 )-$("&;D/
 /
 /
 /
 /
 /
n )-$("&;D
 
 
 
 
 
P )-$("&;D*
 *
 *
 *
 *
 *
d )-$("&;D 
  
  
  
  
  
  
  
r0   c                  .    e Zd Zd	dZed
d            ZdS )r1   conversationsr$   r(   Nonec                   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S N)_conversationsr   to_raw_response_wrapperrQ   r]   rc   rh   r-   r~   s     r.   __init__z%ConversationsWithRawResponse.__init__  s|    +&> 
 
 )@"
 
 '> 
 
 '> 
 
r0   r   c                4    t          | j        j                  S r*   )r   r   r/   r,   s    r.   r/   z"ConversationsWithRawResponse.items  s     $D$7$=>>>r0   Nr~   r$   r(   r   )r(   r   rn   ro   rp   r   r   r/   rr   r0   r.   r1   r1     sH        
 
 
 
  ? ? ? _? ? ?r0   r1   c                  .    e Zd Zd	dZed
d            ZdS )ru   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_wrapperrQ   r]   rc   rh   r   s     r.   r   z*AsyncConversationsWithRawResponse.__init__  s|    +&D 
 
 )F"
 
 'D 
 
 'D 
 
r0   r   c                4    t          | j        j                  S r*   )r   r   r/   r,   s    r.   r/   z'AsyncConversationsWithRawResponse.items  s     ))<)BCCCr0   Nr~   r%   r(   r   )r(   r   r   rr   r0   r.   ru   ru     sN        
 
 
 
  D D D _D D Dr0   ru   c                  .    e Zd Zd	dZed
d            ZdS )r5   r~   r$   r(   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r   )r   r   rQ   r]   rc   rh   r   s     r.   r   z+ConversationsWithStreamingResponse.__init__  sp    +2 
 
 5"
 
 3 
 
 3 
 
r0   r   c                4    t          | j        j                  S r*   )r   r   r/   r,   s    r.   r/   z(ConversationsWithStreamingResponse.items  s     *$*=*CDDDr0   Nr   )r(   r   r   rr   r0   r.   r5   r5     sN        
 
 
 
  E E E _E E Er0   r5   c                  .    e Zd Zd	dZed
d            ZdS )rw   r~   r%   r(   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r   )r   r   rQ   r]   rc   rh   r   s     r.   r   z0AsyncConversationsWithStreamingResponse.__init__  sp    +8 
 
 ;"
 
 9 
 
 9 
 
r0   r   c                4    t          | j        j                  S r*   )r   r   r/   r,   s    r.   r/   z-AsyncConversationsWithStreamingResponse.items  s     /t/B/HIIIr0   Nr   )r(   r   r   rr   r0   r.   rw   rw     sN        
 
 
 
  J J J _J J Jr0   rw   )6
__future__r   typingr   r   httpx r   r/   r	   r
   r   r   r   r   _typesr   r   r   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   _base_clientr   types.conversationsr   r   types.shared_params.metadatar     types.conversations.conversationr!   )types.responses.response_input_item_paramr"   1types.conversations.conversation_deleted_resourcer#   __all__r$   r%   r1   ru   r5   rw   rr   r0   r.   <module>r      s   # " " " " " % % % % % % % %                             L K K K K K K K K K K K K K K K K K < < < < < < < < & & & & & & : : : : : : : : Y Y Y Y Y Y Y Y 0 0 0 0 0 0 Y Y Y Y Y Y Y Y 4 4 4 4 4 4 < < < < < < O O O O O O \ \ \ \ \ \0
1w
 w
 w
 w
 w
O w
 w
 w
ty
 y
 y
 y
 y
) y
 y
 y
x? ? ? ? ? ? ? ?.D D D D D D D D.E E E E E E E E.J J J J J J J J J Jr0   