
    2RjP                       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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Z0 G d de      Z1 G d de      Z2 G d d      Z3 G d d      Z4 G d d      Z5 G d d      Z6y)    )annotations)IterableOptionalN   )_legacy_response   )Items
AsyncItemsItemsWithRawResponseAsyncItemsWithRawResponseItemsWithStreamingResponseAsyncItemsWithStreamingResponse)BodyOmitQueryHeadersNotGivenomit	not_given)path_template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y)r%   ,Manage conversations and conversation items.c                ,    t        | j                        S r(   )r	   _clientselfs    t/var/www/html/meridian/meridian-ai/venv/lib/python3.12/site-packages/openai/resources/conversations/conversations.pyitemszConversations.items$   s     T\\""    c                    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
        )ConversationsWithRawResponser,   s    r.   with_raw_responsezConversations.with_raw_response)   s     ,D11r0   c                    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
        )"ConversationsWithStreamingResponser,   s    r.   with_streaming_responsez%Conversations.with_streaming_response3   s     2$77r0   Nr/   metadataextra_headersextra_query
extra_bodytimeoutc                   | j                  dt        ||dt        j                        t	        ||||ddi      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:   bearer_authTr;   r<   r=   r>   securitybodyoptionscast_to)_postr   r   ConversationCreateParamsr   r"   r-   r/   r:   r;   r<   r=   r>   s          r.   createzConversations.create<   s_    D zz " ( +CC )+'%'. !!  
 	
r0   r;   r<   r=   r>   c                   |st        d|      | j                  t        d|      t        ||||ddi      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/{conversation_id}conversation_idrC   TrD   rH   rI   
ValueError_getr   r   r"   r-   rT   r;   r<   r=   r>   s         r.   retrievezConversations.retrieveq   s^    . ]^m]pqrryy<o^(+'%'. !  

 
	
r0   c                   |st        d|      | j                  t        d|      t        d|it        j
                        t        ||||ddi      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
        rQ   rR   rS   r:   rC   TrD   rF   )rW   rJ   r   r   r    ConversationUpdateParamsr   r"   r-   rT   r:   r;   r<   r=   r>   s          r.   updatezConversations.update   st    > ]^m]pqrrzz<o^ *h!79S9l9lm(+'%'. !  
 	
r0   c                   |st        d|      | j                  t        d|      t        ||||ddi      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
        rQ   rR   rS   rC   TrD   rU   rW   _deleter   r   r$   rY   s         r.   deletezConversations.delete   s^    0 ]^m]pqrr||<o^(+'%'. 0  

 
	
r0   )returnr	   )re   r3   )re   r7   r/   z1Optional[Iterable[ResponseInputItemParam]] | Omitr:   zOptional[Metadata] | Omitr;   Headers | Noner<   Query | Noner=   Body | Noner>   'float | httpx.Timeout | None | NotGivenre   r"   rT   strr;   rg   r<   rh   r=   ri   r>   rj   re   r"   rT   rl   r:   zOptional[Metadata]r;   rg   r<   rh   r=   ri   r>   rj   re   r"   rT   rl   r;   rg   r<   rh   r=   ri   r>   rj   re   r$   __name__
__module____qualname____doc__r   r/   r4   r8   r   r   rM   rZ   r_   rd    r0   r.   r%   r%   !   s   6# # 2 2 8 8 DH.2 )-$("&;D3
 A3
 ,	3
 &3
 "3
  3
 93
 
3
v )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
X )-$("&;D,
,
 %	,
 &,
 ",
  ,
 9,
 
,
h )-$("&;D$
$
 &$
 "$
  $
 9$
 
%$
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y)r&   r(   c                ,    t        | j                        S r*   )r
   r+   r,   s    r.   r/   zAsyncConversations.items   s     $,,''r0   c                    t        |       S r2   )!AsyncConversationsWithRawResponser,   s    r.   r4   z$AsyncConversations.with_raw_response   s     166r0   c                    t        |       S r6   )'AsyncConversationsWithStreamingResponser,   s    r.   r8   z*AsyncConversations.with_streaming_response   s     7t<<r0   Nr9   c                  K   | j                  dt        ||dt        j                         d{   t	        ||||ddi      t
               d{   S 7 '7 w)r@   rA   rB   NrC   TrD   rF   )rJ   r   r   rK   r   r"   rL   s          r.   rM   zAsyncConversations.create  sx     D ZZ," ( +CC  )+'%'. !!   
 
 	

s!   -AA
"AAAArN   c                  K   |st        d|      | j                  t        d|      t        ||||ddi      t               d{   S 7 w)	rP   rQ   rR   rS   rC   TrD   rU   NrV   rY   s         r.   rZ   zAsyncConversations.retrieve;  sl     . ]^m]pqrrYY<o^(+'%'. !  

 

 
	
 

   AA	A
Ac                  K   |st        d|      | j                  t        d|      t        d|it        j
                         d{   t        ||||ddi      t        	       d{   S 7 '7 w)
r\   rQ   rR   rS   r:   NrC   TrD   rF   )rW   rJ   r   r   r    r]   r   r"   r^   s          r.   r_   zAsyncConversations.update`  s     > ]^m]pqrrZZ<o^,X&(B([([  )+'%'. !   
 
 	

s$   AA5	A1

"A5,A3-A53A5c                  K   |st        d|      | j                  t        d|      t        ||||ddi      t               d{   S 7 w)	ra   rQ   rR   rS   rC   TrD   rU   Nrb   rY   s         r.   rd   zAsyncConversations.delete  sl     0 ]^m]pqrr\\<o^(+'%'. 0 " 

 

 
	
 

r}   )re   r
   )re   rx   )re   rz   rf   rk   rm   rn   ro   rt   r0   r.   r&   r&      s   6( ( 7 7 = = DH.2 )-$("&;D3
 A3
 ,	3
 &3
 "3
  3
 93
 
3
v )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
X )-$("&;D.
.
 %	.
 &.
 ".
  .
 9.
 
.
l )-$("&;D$
$
 &$
 "$
  $
 9$
 
%$
r0   c                  &    e Zd ZddZedd       Zy)r3   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y N)_conversationsr   to_raw_response_wrapperrM   rZ   r_   rd   r-   conversationss     r.   __init__z%ConversationsWithRawResponse.__init__  s|    +&>>  
 )@@""
 '>>  
 '>>  
r0   c                @    t        | j                  j                        S r*   )r   r   r/   r,   s    r.   r/   z"ConversationsWithRawResponse.items  s     $D$7$7$=$=>>r0   Nr   r%   re   None)re   r   rp   rq   rr   r   r   r/   rt   r0   r.   r3   r3     s    
  ? ?r0   r3   c                  &    e Zd ZddZedd       Zy)rx   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r   )r   r   async_to_raw_response_wrapperrM   rZ   r_   rd   r   s     r.   r   z*AsyncConversationsWithRawResponse.__init__  s|    +&DD  
 )FF""
 'DD  
 'DD  
r0   c                @    t        | j                  j                        S r*   )r   r   r/   r,   s    r.   r/   z'AsyncConversationsWithRawResponse.items  s     ))<)<)B)BCCr0   Nr   r&   re   r   )re   r   r   rt   r0   r.   rx   rx     s    
  D Dr0   rx   c                  &    e Zd ZddZedd       Zy)r7   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r   )r   r   rM   rZ   r_   rd   r   s     r.   r   z+ConversationsWithStreamingResponse.__init__  sd    +2  
 5""
 3  
 3  
r0   c                @    t        | j                  j                        S r*   )r   r   r/   r,   s    r.   r/   z(ConversationsWithStreamingResponse.items  s     *$*=*=*C*CDDr0   Nr   )re   r   r   rt   r0   r.   r7   r7     s    
  E Er0   r7   c                  &    e Zd ZddZedd       Zy)rz   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r   )r   r   rM   rZ   r_   rd   r   s     r.   r   z0AsyncConversationsWithStreamingResponse.__init__  sd    +8  
 ;""
 9  
 9  
r0   c                @    t        | j                  j                        S r*   )r   r   r/   r,   s    r.   r/   z-AsyncConversationsWithStreamingResponse.items  s     /t/B/B/H/HIIr0   Nr   )re   r   r   rt   r0   r.   rz   rz     s    
  J Jr0   rz   )7
__future__r   typingr   r   httpx r   r/   r	   r
   r   r   r   r   _typesr   r   r   r   r   r   r   _utilsr   r   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&   r3   rx   r7   rz   rt   r0   r.   <module>r      s    # %     L K K K K & : Y 0 Y 4 < O \0
1G
O G
TI
) I
X? ?.D D.E E.J Jr0   