o
    hJ                     @  s`  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 deZ0G dd deZ1G dd dZ2G dd dZ3G dd dZ4G d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ed'ddZed(ddZed)d	d
Zeedddedd*ddZ	dddedd+dd Z
dddedd,d"d#Zdddedd-d%d&ZdS ).r#   returnr   c                 C  
   t | jS N)r   _clientself r,   m/var/www/html/openai_agents/venv/lib/python3.10/site-packages/openai/resources/conversations/conversations.pyitems"      
zConversations.itemsConversationsWithRawResponsec                 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
        )r0   r*   r,   r,   r-   with_raw_response&      zConversations.with_raw_response"ConversationsWithStreamingResponsec                 C  r1   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*   r,   r,   r-   with_streaming_response0      z%Conversations.with_streaming_responseN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             	   C  s,   | j dt||dtjt||||dtd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>   r,   r,   r-   create9   s   "zConversations.createrH   conversation_idstrc                C  4   |s	t d|| jd| t||||dtd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/rH   rK   rL   
ValueError_getr   r    r+   rQ   r;   r<   r=   r>   r,   r,   r-   retrievej   s   zConversations.retrieveOptional[Metadata]c             	   C  sB   |s	t d|| jd| td|itjt||||dtd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
        rU   rV   r:   rH   rI   )rY   rM   r   r   ConversationUpdateParamsr   r    r+   rQ   r:   r;   r<   r=   r>   r,   r,   r-   update   s   zConversations.updater"   c                C  rS   )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
        rU   rV   rH   rW   rY   _deleter   r"   r[   r,   r,   r-   delete   s   zConversations.delete)r&   r   )r&   r0   )r&   r5   r.   r?   r:   r@   r;   rA   r<   rB   r=   rC   r>   rD   r&   r    rQ   rR   r;   rA   r<   rB   r=   rC   r>   rD   r&   r    rQ   rR   r:   r]   r;   rA   r<   rB   r=   rC   r>   rD   r&   r    rQ   rR   r;   rA   r<   rB   r=   rC   r>   rD   r&   r"   __name__
__module____qualname__r   r.   r3   r7   r   r   rP   r\   ra   re   r,   r,   r,   r-   r#   !   s:    	7(0c                   @  r%   ).r$   r&   r	   c                 C  r'   r(   )r	   r)   r*   r,   r,   r-   r.      r/   zAsyncConversations.items!AsyncConversationsWithRawResponsec                 C  r1   r2   )rn   r*   r,   r,   r-   r3      r4   z$AsyncConversations.with_raw_response'AsyncConversationsWithStreamingResponsec                 C  r1   r6   )ro   r*   r,   r,   r-   r7      r8   z*AsyncConversations.with_streaming_responseNr9   r.   r?   r:   r@   r;   rA   r<   rB   r=   rC   r>   rD   r    c             	     s:   | j dt||dtjI dH t||||dtdI dH S )rE   rF   rG   NrH   rI   )rM   r   r   rN   r   r    rO   r,   r,   r-   rP      s   "zAsyncConversations.createrH   rQ   rR   c                  <   |s
t d|| jd| t||||dtdI dH S )rT   rU   rV   rH   rW   NrX   r[   r,   r,   r-   r\   !  s   zAsyncConversations.retriever]   c             	     sP   |s
t d|| jd| td|itjI dH t||||dtdI dH S )r^   rU   rV   r:   NrH   rI   )rY   rM   r   r   r_   r   r    r`   r,   r,   r-   ra   B  s   
zAsyncConversations.updater"   c                  rp   )rb   rU   rV   rH   rW   Nrc   r[   r,   r,   r-   re   n  s   zAsyncConversations.delete)r&   r	   )r&   rn   )r&   ro   rf   rg   rh   ri   rj   r,   r,   r,   r-   r$      s:    	7(2c                   @  $   e Zd ZdddZeddd	Zd
S )r0   conversationsr#   r&   Nonec                 C  B   || _ t|j| _t|j| _t|j| _t|j| _d S r(   )_conversationsr   to_raw_response_wrapperrP   r\   ra   re   r+   rr   r,   r,   r-   __init__     
z%ConversationsWithRawResponse.__init__r
   c                 C     t | jjS r(   )r
   ru   r.   r*   r,   r,   r-   r.        z"ConversationsWithRawResponse.itemsNrr   r#   r&   rs   )r&   r
   rk   rl   rm   rx   r   r.   r,   r,   r,   r-   r0         
r0   c                   @  rq   )rn   rr   r$   r&   rs   c                 C  rt   r(   )ru   r   async_to_raw_response_wrapperrP   r\   ra   re   rw   r,   r,   r-   rx     ry   z*AsyncConversationsWithRawResponse.__init__r   c                 C  rz   r(   )r   ru   r.   r*   r,   r,   r-   r.     r{   z'AsyncConversationsWithRawResponse.itemsNrr   r$   r&   rs   )r&   r   r}   r,   r,   r,   r-   rn     r~   rn   c                   @  rq   )r5   rr   r#   r&   rs   c                 C  :   || _ t|j| _t|j| _t|j| _t|j| _d S r(   )ru   r   rP   r\   ra   re   rw   r,   r,   r-   rx        
z+ConversationsWithStreamingResponse.__init__r   c                 C  rz   r(   )r   ru   r.   r*   r,   r,   r-   r.     r{   z(ConversationsWithStreamingResponse.itemsNr|   )r&   r   r}   r,   r,   r,   r-   r5     r~   r5   c                   @  rq   )ro   rr   r$   r&   rs   c                 C  r   r(   )ru   r   rP   r\   ra   re   rw   r,   r,   r-   rx     r   z0AsyncConversationsWithStreamingResponse.__init__r   c                 C  rz   r(   )r   ru   r.   r*   r,   r,   r-   r.     r{   z-AsyncConversationsWithStreamingResponse.itemsNr   )r&   r   r}   r,   r,   r,   r-   ro     r~   ro   )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$   r0   rn   r5   ro   r,   r,   r,   r-   <module>   s2    $ 8 :