o
    iM                     @  sd  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Z0G dd deZ1G dd deZ2G dd dZ3G dd dZ4G dd dZ5G dd dZ6dS )    )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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.   f/home/kim/smarthome/.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
        )r2   r,   r.   r.   r/   with_raw_response)      zConversations.with_raw_response"ConversationsWithStreamingResponsec                 C  r3   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
        )r7   r,   r.   r.   r/   with_streaming_response3      z%Conversations.with_streaming_responseNr0   metadataextra_headersextra_query
extra_bodytimeoutr0   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r0   r<   r=   r>   r?   r@   bodyoptionscast_to)_postr   r   ConversationCreateParamsr   r!   r-   r0   r<   r=   r>   r?   r@   r.   r.   r/   create<   s   "zConversations.createrJ   conversation_idstrc                C  6   |s	t d|| jtd|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/{conversation_id}rS   rJ   rM   rN   
ValueError_getr   r   r!   r-   rS   r=   r>   r?   r@   r.   r.   r/   retrievem   s   
zConversations.retrieveOptional[Metadata]c             	   C  sD   |s	t d|| jtd|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
        rW   rX   rY   r<   rJ   rK   )r\   rO   r   r   r   ConversationUpdateParamsr   r!   r-   rS   r<   r=   r>   r?   r@   r.   r.   r/   update   s   
zConversations.updater#   c                C  rU   )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
        rW   rX   rY   rJ   rZ   r\   _deleter   r   r#   r^   r.   r.   r/   delete   s   
zConversations.delete)r(   r   )r(   r2   )r(   r7   r0   rA   r<   rB   r=   rC   r>   rD   r?   rE   r@   rF   r(   r!   rS   rT   r=   rC   r>   rD   r?   rE   r@   rF   r(   r!   rS   rT   r<   r`   r=   rC   r>   rD   r?   rE   r@   rF   r(   r!   rS   rT   r=   rC   r>   rD   r?   rE   r@   rF   r(   r#   __name__
__module____qualname____doc__r   r0   r5   r9   r   r   rR   r_   rd   rh   r.   r.   r.   r/   r$   !   s<    	7(0c                   @  r&   )/r%   r'   r(   r	   c                 C  r)   r*   )r	   r+   r,   r.   r.   r/   r0      r1   zAsyncConversations.items!AsyncConversationsWithRawResponsec                 C  r3   r4   )rr   r,   r.   r.   r/   r5      r6   z$AsyncConversations.with_raw_response'AsyncConversationsWithStreamingResponsec                 C  r3   r8   )rs   r,   r.   r.   r/   r9      r:   z*AsyncConversations.with_streaming_responseNr;   r0   rA   r<   rB   r=   rC   r>   rD   r?   rE   r@   rF   r!   c             	     s:   | j dt||dtjI dH t||||dtdI dH S )rG   rH   rI   NrJ   rK   )rO   r   r   rP   r   r!   rQ   r.   r.   r/   rR      s   "zAsyncConversations.createrJ   rS   rT   c                  >   |s
t d|| jtd|dt||||dtdI dH S )rV   rW   rX   rY   rJ   rZ   Nr[   r^   r.   r.   r/   r_   '  s   
zAsyncConversations.retriever`   c             	     sR   |s
t d|| jtd|dtd|itjI dH t||||dtdI dH S )ra   rW   rX   rY   r<   NrJ   rK   )r\   rO   r   r   r   rb   r   r!   rc   r.   r.   r/   rd   H  s   

zAsyncConversations.updater#   c                  rt   )re   rW   rX   rY   rJ   rZ   Nrf   r^   r.   r.   r/   rh   t  s   
zAsyncConversations.delete)r(   r	   )r(   rr   )r(   rs   ri   rj   rk   rl   rm   r.   r.   r.   r/   r%      s<    	7(2c                   @  $   e Zd ZdddZeddd	Zd
S )r2   conversationsr$   r(   Nonec                 C  B   || _ t|j| _t|j| _t|j| _t|j| _d S N)_conversationsr   Zto_raw_response_wrapperrR   r_   rd   rh   r-   rv   r.   r.   r/   __init__     
z%ConversationsWithRawResponse.__init__r
   c                 C     t | jjS r*   )r
   rz   r0   r,   r.   r.   r/   r0        z"ConversationsWithRawResponse.itemsNrv   r$   r(   rw   )r(   r
   rn   ro   rp   r|   r   r0   r.   r.   r.   r/   r2         
r2   c                   @  ru   )rr   rv   r%   r(   rw   c                 C  rx   ry   )rz   r   Zasync_to_raw_response_wrapperrR   r_   rd   rh   r{   r.   r.   r/   r|     r}   z*AsyncConversationsWithRawResponse.__init__r   c                 C  r~   r*   )r   rz   r0   r,   r.   r.   r/   r0     r   z'AsyncConversationsWithRawResponse.itemsNrv   r%   r(   rw   )r(   r   r   r.   r.   r.   r/   rr     r   rr   c                   @  ru   )r7   rv   r$   r(   rw   c                 C  :   || _ t|j| _t|j| _t|j| _t|j| _d S ry   )rz   r   rR   r_   rd   rh   r{   r.   r.   r/   r|        
z+ConversationsWithStreamingResponse.__init__r   c                 C  r~   r*   )r   rz   r0   r,   r.   r.   r/   r0     r   z(ConversationsWithStreamingResponse.itemsNr   )r(   r   r   r.   r.   r.   r/   r7     r   r7   c                   @  ru   )rs   rv   r%   r(   rw   c                 C  r   ry   )rz   r   rR   r_   rd   rh   r{   r.   r.   r/   r|     r   z0AsyncConversationsWithStreamingResponse.__init__r   c                 C  r~   r*   )r   rz   r0   r,   r.   r.   r/   r0     r   z-AsyncConversationsWithStreamingResponse.itemsNr   )r(   r   r   r.   r.   r.   r/   rs     r   rs   )7
__future__r   typingr   r   Zhttpx r   r0   r   r	   r
   r   r   r   _typesr   r   r   r   r   r   r   Z_utilsr   r   r   Z_compatr   Z	_resourcer   r   	_responser   r   Z_base_clientr   Ztypes.conversationsr   r   Ztypes.shared_params.metadatar    Z types.conversations.conversationr!   Z)types.responses.response_input_item_paramr"   Z1types.conversations.conversation_deleted_resourcer#   __all__r$   r%   r2   rr   r7   rs   r.   r.   r.   r/   <module>   s2    $ ; =