o
    ØRWjÒP  ã                   @  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.   ú{/home/esfera/Documents/content_generation/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  s2   | j dt||dœtjƒt||||ddi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<   Úbearer_authT©r=   r>   r?   r@   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚConversationCreateParamsr   r!   ©r-   r0   r<   r=   r>   r?   r@   r.   r.   r/   Úcreate<   s"   "þûûðzConversations.create©r=   r>   r?   r@   Úconversation_idÚstrc             	   C  ó<   |s	t d|›�ƒ‚| jtd|d�t||||ddi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}©rV   rJ   TrK   ©rO   rP   ©Ú
ValueErrorÚ_getr   r   r!   ©r-   rV   r=   r>   r?   r@   r.   r.   r/   Úretrieveq   s   
û÷zConversations.retrieveúOptional[Metadata]c             
   C  sJ   |s	t d|›�ƒ‚| jtd|d�td|itjƒt||||ddi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
        rZ   r[   r\   r<   rJ   TrK   rM   )r_   rQ   r   r   r   ÚConversationUpdateParamsr   r!   ©r-   rV   r<   r=   r>   r?   r@   r.   r.   r/   Úupdate–   s   
ûözConversations.updater#   c             	   C  rX   )á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
        rZ   r[   r\   rJ   TrK   r]   ©r_   Ú_deleter   r   r#   ra   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!   ©rV   rW   r=   rC   r>   rD   r?   rE   r@   rF   r(   r!   ©rV   rW   r<   rc   r=   rC   r>   rD   r?   rE   r@   rF   r(   r!   ©rV   rW   r=   rC   r>   rD   r?   rE   r@   rF   r(   r#   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r0   r5   r9   r   r   rT   rb   rg   rk   r.   r.   r.   r/   r$   !   s<    	ö;÷,ö4÷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   )ru   r,   r.   r.   r/   r5   ó   r6   z$AsyncConversations.with_raw_responseÚ'AsyncConversationsWithStreamingResponsec                 C  r3   r8   )rv   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did�td�I dH S )rG   rH   rI   NrJ   TrK   rM   )rQ   r   r   rR   r   r!   rS   r.   r.   r/   rT     s$   €"þûûðzAsyncConversations.createrU   rV   rW   c             	   Ã  óD   �|s
t d|›�ƒ‚| jtd|d�t||||ddid�td�I dH S )	rY   rZ   r[   r\   rJ   TrK   r]   Nr^   ra   r.   r.   r/   rb   ;  s   €
û÷zAsyncConversations.retrieverc   c             
   Ã  sX   �|s
t d|›�ƒ‚| jtd|d�td|itjƒI dH t||||ddid�td	�I dH S )
rd   rZ   r[   r\   r<   NrJ   TrK   rM   )r_   rQ   r   r   r   re   r   r!   rf   r.   r.   r/   rg   `  s"   €

ÿûôzAsyncConversations.updater#   c             	   Ã  rw   )	rh   rZ   r[   r\   rJ   TrK   r]   Nri   ra   r.   r.   r/   rk   �  s   €
û÷zAsyncConversations.delete)r(   r	   )r(   ru   )r(   rv   rl   rm   rn   ro   rp   r.   r.   r.   r/   r%   ë   s<    	ö;÷,ö6÷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   Úto_raw_response_wrapperrT   rb   rg   rk   ©r-   ry   r.   r.   r/   Ú__init__¸  ó   ÿÿÿ
ÿz%ConversationsWithRawResponse.__init__r
   c                 C  ó   t | jjƒS r*   )r
   r}   r0   r,   r.   r.   r/   r0   È  ó   z"ConversationsWithRawResponse.itemsN©ry   r$   r(   rz   )r(   r
   ©rq   rr   rs   r€   r   r0   r.   r.   r.   r/   r2   ·  ó    
r2   c                   @  rx   )ru   ry   r%   r(   rz   c                 C  r{   r|   )r}   r   Úasync_to_raw_response_wrapperrT   rb   rg   rk   r   r.   r.   r/   r€   Ï  r�   z*AsyncConversationsWithRawResponse.__init__r   c                 C  r‚   r*   )r   r}   r0   r,   r.   r.   r/   r0   ß  rƒ   z'AsyncConversationsWithRawResponse.itemsN©ry   r%   r(   rz   )r(   r   r…   r.   r.   r.   r/   ru   Î  r†   ru   c                   @  rx   )r7   ry   r$   r(   rz   c                 C  ó:   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S r|   )r}   r   rT   rb   rg   rk   r   r.   r.   r/   r€   æ  ó   ÿÿÿ
ÿz+ConversationsWithStreamingResponse.__init__r   c                 C  r‚   r*   )r   r}   r0   r,   r.   r.   r/   r0   ö  rƒ   z(ConversationsWithStreamingResponse.itemsNr„   )r(   r   r…   r.   r.   r.   r/   r7   å  r†   r7   c                   @  rx   )rv   ry   r%   r(   rz   c                 C  r‰   r|   )r}   r   rT   rb   rg   rk   r   r.   r.   r/   r€   ý  rŠ   z0AsyncConversationsWithStreamingResponse.__init__r   c                 C  r‚   r*   )r   r}   r0   r,   r.   r.   r/   r0     rƒ   z-AsyncConversationsWithStreamingResponse.itemsNrˆ   )r(   r   r…   r.   r.   r.   r/   rv   ü  r†   rv   )7Ú
__future__r   Útypingr   r   ÚhttpxÚ r   r0   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%   r2   ru   r7   rv   r.   r.   r.   r/   Ú<module>   s2    $ K M