o
    i                      @  s(  d dl mZ d dl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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mZ ddlmZmZ ddl m!Z! ddl"m#Z# ddgZ$G dd deZ%G dd deZ&G dd dZ'G dd dZ(G dd dZ)G dd dZ*dS )    )annotations)LiteralN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)path_templatemaybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)message_list_params)ChatCompletionStoreMessageMessagesAsyncMessagesc                   @  H   e Zd ZdZedddZedddZeeed	d	d	ed
d ddZ	d	S )!r   _
    Given a list of messages comprising a conversation, the model will return a response.
    returnMessagesWithRawResponsec                 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
        )r   self r$   d/home/kim/smarthome/.venv/lib/python3.10/site-packages/openai/resources/chat/completions/messages.pywith_raw_response      zMessages.with_raw_responseMessagesWithStreamingResponsec                 C  r    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
        )r(   r"   r$   r$   r%   with_streaming_response&      z Messages.with_streaming_responseNafterlimitorderextra_headersextra_query
extra_bodytimeoutcompletion_idstrr-   
str | Omitr.   
int | Omitr/   Literal['asc', 'desc'] | Omitr0   Headers | Noner1   Query | Noner2   Body | Noner3   'float | httpx.Timeout | None | NotGiven*SyncCursorPage[ChatCompletionStoreMessage]c          	      C  N   |s	t d|| jtd|dtt t||||t|||dtjdtdS a  Get the messages in a stored chat completion.

        Only Chat Completions that have
        been created with the `store` parameter set to `true` will be returned.

        Args:
          after: Identifier for the last message from the previous pagination request.

          limit: Number of messages to retrieve.

          order: Sort order for messages by timestamp. Use `asc` for ascending order or `desc`
              for descending order. Defaults to `asc`.

          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
        z<Expected a non-empty value for `completion_id` but received z*/chat/completions/{completion_id}/messages)r4   )r-   r.   r/   )r0   r1   r2   r3   query)pageoptionsmodel)	
ValueError_get_api_listr   r   r   r   r   r   MessageListParams	r#   r4   r-   r.   r/   r0   r1   r2   r3   r$   r$   r%   list/   (   #
zMessages.list)r   r   )r   r(   )r4   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r3   r<   r   r=   
__name__
__module____qualname____doc__r   r&   r*   r   r   rH   r$   r$   r$   r%   r          	c                   @  r   )!r   r   r   AsyncMessagesWithRawResponsec                 C  r    r!   )rP   r"   r$   r$   r%   r&   n   r'   zAsyncMessages.with_raw_response"AsyncMessagesWithStreamingResponsec                 C  r    r)   )rQ   r"   r$   r$   r%   r*   x   r+   z%AsyncMessages.with_streaming_responseNr,   r4   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r3   r<   WAsyncPaginator[ChatCompletionStoreMessage, AsyncCursorPage[ChatCompletionStoreMessage]]c          	      C  r>   r?   )	rD   rE   r   r   r   r   r   r   rF   rG   r$   r$   r%   rH      rI   zAsyncMessages.list)r   rP   )r   rQ   )r4   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r3   r<   r   rR   rJ   r$   r$   r$   r%   r   i   rO   c                   @     e Zd ZdddZdS )	r   messagesr   r   Nonec                 C     || _ t|j| _d S N)	_messagesr   Zto_raw_response_wrapperrH   r#   rT   r$   r$   r%   __init__      
z MessagesWithRawResponse.__init__NrT   r   r   rU   rK   rL   rM   rZ   r$   r$   r$   r%   r          r   c                   @  rS   )	rP   rT   r   r   rU   c                 C  rV   rW   )rX   r   Zasync_to_raw_response_wrapperrH   rY   r$   r$   r%   rZ      r[   z%AsyncMessagesWithRawResponse.__init__NrT   r   r   rU   r]   r$   r$   r$   r%   rP      r^   rP   c                   @  rS   )	r(   rT   r   r   rU   c                 C     || _ t|j| _d S rW   )rX   r   rH   rY   r$   r$   r%   rZ         
z&MessagesWithStreamingResponse.__init__Nr\   r]   r$   r$   r$   r%   r(      r^   r(   c                   @  rS   )	rQ   rT   r   r   rU   c                 C  r`   rW   )rX   r   rH   rY   r$   r$   r%   rZ      ra   z+AsyncMessagesWithStreamingResponse.__init__Nr_   r]   r$   r$   r$   r%   rQ      r^   rQ   )+
__future__r   Ztyping_extensionsr   Zhttpx r   _typesr   r   r   r	   r
   r   r   Z_utilsr   r   Z_compatr   Z	_resourcer   r   	_responser   r   Z
paginationr   r   Z_base_clientr   r   Ztypes.chat.completionsr   Z(types.chat.chat_completion_store_messager   __all__r   r   r   rP   r(   rQ   r$   r$   r$   r%   <module>   s(   $RR			