
    qiL                       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      Z5y)    )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y)r$   ,Manage conversations and conversation items.c                ,    t        | j                        S r'   )r	   _clientselfs    ^/opt/pipecat/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1r/   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7r/   Nr.   metadataextra_headersextra_query
extra_bodytimeoutc          
         | j                  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.   r9   r:   r;   r<   r=   bodyoptionscast_to)_postr   r   ConversationCreateParamsr   r!   r,   r.   r9   r:   r;   r<   r=   s          r-   createzConversations.create<   sV    D zz " ( +CC )+Q[el !  
 	
r/   rB   c          	     r    |st        d|      | j                  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/rB   rE   rF   
ValueError_getr   r!   r,   conversation_idr:   r;   r<   r=   s         r-   retrievezConversations.retrievem   sU    . ]^m]pqrryyo./(+Q[el !  
 	
r/   c          
         |st        d|      | j                  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
        rM   rN   r9   rB   rC   )rQ   rG   r   r   ConversationUpdateParamsr   r!   r,   rT   r9   r:   r;   r<   r=   s          r-   updatezConversations.update   sk    > ]^m]pqrrzzo./ *h!79S9l9lm(+Q[el !  
 	
r/   c          	     r    |st        d|      | j                  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
        rM   rN   rB   rO   rQ   _deleter   r#   rS   s         r-   deletezConversations.delete   sU    0 ]^m]pqrr||o./(+Q[el 0  
 	
r/   )returnr	   )r`   r2   )r`   r6   r.   z1Optional[Iterable[ResponseInputItemParam]] | Omitr9   zOptional[Metadata] | Omitr:   Headers | Noner;   Query | Noner<   Body | Noner=   'float | httpx.Timeout | None | NotGivenr`   r!   rT   strr:   rb   r;   rc   r<   rd   r=   re   r`   r!   rT   rg   r9   zOptional[Metadata]r:   rb   r;   rc   r<   rd   r=   re   r`   r!   rT   rg   r:   rb   r;   rc   r<   rd   r=   re   r`   r#   __name__
__module____qualname____doc__r   r.   r3   r7   r   r   rJ   rU   rZ   r_    r/   r-   r$   r$   !   s   6# # 2 2 8 8 DH.2 )-$("&;D/
 A/
 ,	/
 &/
 "/
  /
 9/
 
/
n )-$("&;D

 &
 "
  
 9
 

P )-$("&;D(
(
 %	(
 &(
 "(
  (
 9(
 
(
` )-$("&;D 
 
 & 
 " 
   
 9 
 
% 
r/   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     $,,''r/   c                    t        |       S r1   )!AsyncConversationsWithRawResponser+   s    r-   r3   z$AsyncConversations.with_raw_response   s     166r/   c                    t        |       S r5   )'AsyncConversationsWithStreamingResponser+   s    r-   r7   z*AsyncConversations.with_streaming_response   s     7t<<r/   Nr8   c          
        K   | j                  dt        ||dt        j                         d{   t	        ||||      t
               d{   S 7 $7 w)r?   r@   rA   NrB   rC   )rG   r   r   rH   r   r!   rI   s          r-   rJ   zAsyncConversations.create   so     D ZZ," ( +CC  )+Q[el !   
 
 	

s!   -AA
AAAArB   c          	        K   |st        d|      | j                  d| t        ||||      t               d{   S 7 w)rL   rM   rN   rB   rO   NrP   rS   s         r-   rU   zAsyncConversations.retrieve'  sc     . ]^m]pqrrYYo./(+Q[el !  
 
 	
 
   <AAAc          
        K   |st        d|      | j                  d| t        d|it        j                         d{   t        ||||      t               d{   S 7 $7 w)rW   rM   rN   r9   NrB   rC   )rQ   rG   r   r   rX   r   r!   rY   s          r-   rZ   zAsyncConversations.updateH  s     > ]^m]pqrrZZo./,X&(B([([  )+Q[el !   	
 	
 		
	
s#   ?A*A&
A*!A("A*(A*c          	        K   |st        d|      | j                  d| t        ||||      t               d{   S 7 w)r\   rM   rN   rB   rO   Nr]   rS   s         r-   r_   zAsyncConversations.deletet  sc     0 ]^m]pqrr\\o./(+Q[el 0 " 
 
 	
 
rx   )r`   r
   )r`   rs   )r`   ru   ra   rf   rh   ri   rj   ro   r/   r-   r%   r%      s   6( ( 7 7 = = DH.2 )-$("&;D/
 A/
 ,	/
 &/
 "/
  /
 9/
 
/
n )-$("&;D

 &
 "
  
 9
 

P )-$("&;D*
*
 %	*
 &*
 "*
  *
 9*
 
*
d )-$("&;D 
 
 & 
 " 
   
 9 
 
% 
r/   c                  &    e Zd ZddZedd       Zy)r2   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y N)_conversationsr   to_raw_response_wrapperrJ   rU   rZ   r_   r,   conversationss     r-   __init__z%ConversationsWithRawResponse.__init__  s|    +&>>  
 )@@""
 '>>  
 '>>  
r/   c                @    t        | j                  j                        S r)   )r   r~   r.   r+   s    r-   r.   z"ConversationsWithRawResponse.items  s     $D$7$7$=$=>>r/   Nr   r$   r`   None)r`   r   rk   rl   rm   r   r   r.   ro   r/   r-   r2   r2     s    
  ? ?r/   r2   c                  &    e Zd ZddZedd       Zy)rs   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r}   )r~   r   async_to_raw_response_wrapperrJ   rU   rZ   r_   r   s     r-   r   z*AsyncConversationsWithRawResponse.__init__  s|    +&DD  
 )FF""
 'DD  
 'DD  
r/   c                @    t        | j                  j                        S r)   )r   r~   r.   r+   s    r-   r.   z'AsyncConversationsWithRawResponse.items  s     ))<)<)B)BCCr/   Nr   r%   r`   r   )r`   r   r   ro   r/   r-   rs   rs     s    
  D Dr/   rs   c                  &    e Zd ZddZedd       Zy)r6   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r}   )r~   r   rJ   rU   rZ   r_   r   s     r-   r   z+ConversationsWithStreamingResponse.__init__  sd    +2  
 5""
 3  
 3  
r/   c                @    t        | j                  j                        S r)   )r   r~   r.   r+   s    r-   r.   z(ConversationsWithStreamingResponse.items  s     *$*=*=*C*CDDr/   Nr   )r`   r   r   ro   r/   r-   r6   r6     s    
  E Er/   r6   c                  &    e Zd ZddZedd       Zy)ru   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r}   )r~   r   rJ   rU   rZ   r_   r   s     r-   r   z0AsyncConversationsWithStreamingResponse.__init__  sd    +8  
 ;""
 9  
 9  
r/   c                @    t        | j                  j                        S r)   )r   r~   r.   r+   s    r-   r.   z-AsyncConversationsWithStreamingResponse.items  s     /t/B/B/H/HIIr/   Nr   )r`   r   r   ro   r/   r-   ru   ru     s    
  J Jr/   ru   )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%   r2   rs   r6   ru   ro   r/   r-   <module>r      s    # %     L K K < & : Y 0 Y 4 < O \0
1w
O w
ty
) y
x? ?.D D.E E.J Jr/   