o
    r)iL                     @  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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#   ,Manage conversations and conversation items.returnr   c                 C  
   t | jS r&   )r   _clientself r-   p/var/www/html/voicebot/backend/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
        )r1   r+   r-   r-   r.   with_raw_response)      zConversations.with_raw_response"ConversationsWithStreamingResponsec                 C  r2   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
        )r6   r+   r-   r-   r.   with_streaming_response3      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.   create<   s   "zConversations.createrI   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/rI   rL   rM   
ValueError_getr   r    r,   rR   r<   r=   r>   r?   r-   r-   r.   retrievem   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
        rV   rW   r;   rI   rJ   )rZ   rN   r   r   ConversationUpdateParamsr   r    r,   rR   r;   r<   r=   r>   r?   r-   r-   r.   update   s   zConversations.updater"   c                C  rT   )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\   r-   r-   r.   delete   s   zConversations.delete)r'   r   )r'   r1   )r'   r6   r/   r@   r;   rA   r<   rB   r=   rC   r>   rD   r?   rE   r'   r    rR   rS   r<   rB   r=   rC   r>   rD   r?   rE   r'   r    rR   rS   r;   r^   r<   rB   r=   rC   r>   rD   r?   rE   r'   r    rR   rS   r<   rB   r=   rC   r>   rD   r?   rE   r'   r"   __name__
__module____qualname____doc__r   r/   r4   r8   r   r   rQ   r]   rb   rf   r-   r-   r-   r.   r#   !   s<    	7(0c                   @  r%   )/r$   r&   r'   r	   c                 C  r(   r)   )r	   r*   r+   r-   r-   r.   r/      r0   zAsyncConversations.items!AsyncConversationsWithRawResponsec                 C  r2   r3   )rp   r+   r-   r-   r.   r4      r5   z$AsyncConversations.with_raw_response'AsyncConversationsWithStreamingResponsec                 C  r2   r7   )rq   r+   r-   r-   r.   r8      r9   z*AsyncConversations.with_streaming_responseNr:   r/   r@   r;   rA   r<   rB   r=   rC   r>   rD   r?   rE   r    c             	     s:   | j dt||dtjI dH t||||dtdI dH S )rF   rG   rH   NrI   rJ   )rN   r   r   rO   r   r    rP   r-   r-   r.   rQ      s   "zAsyncConversations.createrI   rR   rS   c                  <   |s
t d|| jd| t||||dtdI dH S )rU   rV   rW   rI   rX   NrY   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_   rV   rW   r;   NrI   rJ   )rZ   rN   r   r   r`   r   r    ra   r-   r-   r.   rb   H  s   
zAsyncConversations.updater"   c                  rr   )rc   rV   rW   rI   rX   Nrd   r\   r-   r-   r.   rf   t  s   zAsyncConversations.delete)r'   r	   )r'   rp   )r'   rq   rg   rh   ri   rj   rk   r-   r-   r-   r.   r$      s<    	7(2c                   @  $   e Zd ZdddZeddd	Zd
S )r1   conversationsr#   r'   Nonec                 C  B   || _ t|j| _t|j| _t|j| _t|j| _d S N)_conversationsr   to_raw_response_wrapperrQ   r]   rb   rf   r,   rt   r-   r-   r.   __init__     
z%ConversationsWithRawResponse.__init__r
   c                 C     t | jjS r)   )r
   rx   r/   r+   r-   r-   r.   r/        z"ConversationsWithRawResponse.itemsNrt   r#   r'   ru   )r'   r
   rl   rm   rn   r{   r   r/   r-   r-   r-   r.   r1         
r1   c                   @  rs   )rp   rt   r$   r'   ru   c                 C  rv   rw   )rx   r   async_to_raw_response_wrapperrQ   r]   rb   rf   rz   r-   r-   r.   r{     r|   z*AsyncConversationsWithRawResponse.__init__r   c                 C  r}   r)   )r   rx   r/   r+   r-   r-   r.   r/     r~   z'AsyncConversationsWithRawResponse.itemsNrt   r$   r'   ru   )r'   r   r   r-   r-   r-   r.   rp     r   rp   c                   @  rs   )r6   rt   r#   r'   ru   c                 C  :   || _ t|j| _t|j| _t|j| _t|j| _d S rw   )rx   r   rQ   r]   rb   rf   rz   r-   r-   r.   r{        
z+ConversationsWithStreamingResponse.__init__r   c                 C  r}   r)   )r   rx   r/   r+   r-   r-   r.   r/     r~   z(ConversationsWithStreamingResponse.itemsNr   )r'   r   r   r-   r-   r-   r.   r6     r   r6   c                   @  rs   )rq   rt   r$   r'   ru   c                 C  r   rw   )rx   r   rQ   r]   rb   rf   rz   r-   r-   r.   r{     r   z0AsyncConversationsWithStreamingResponse.__init__r   c                 C  r}   r)   )r   rx   r/   r+   r-   r-   r.   r/     r~   z-AsyncConversationsWithStreamingResponse.itemsNr   )r'   r   r   r-   r-   r-   r.   rq     r   rq   )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   rp   r6   rq   r-   r-   r-   r.   <module>   s2    $ ; =