o
    r)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 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)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#   n/var/www/html/voicebot/backend/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'] | Omitr/   Headers | Noner0   Query | Noner1   Body | Noner2   'float | httpx.Timeout | None | NotGiven*SyncCursorPage[ChatCompletionStoreMessage]c          	      C  N   |s	t d|| j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/z	/messages)r,   r-   r.   )r/   r0   r1   r2   query)pageoptionsmodel)
ValueError_get_api_listr   r   r   r   r   MessageListParams	r"   r3   r,   r-   r.   r/   r0   r1   r2   r#   r#   r$   list/   (   #
zMessages.list)r   r   )r   r'   )r3   r4   r,   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r   r<   
__name__
__module____qualname____doc__r   r%   r)   r   r   rG   r#   r#   r#   r$   r          	c                   @  r   )!r   r   r   AsyncMessagesWithRawResponsec                 C  r   r    )rO   r!   r#   r#   r$   r%   n   r&   zAsyncMessages.with_raw_response"AsyncMessagesWithStreamingResponsec                 C  r   r(   )rP   r!   r#   r#   r$   r)   x   r*   z%AsyncMessages.with_streaming_responseNr+   r3   r4   r,   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   WAsyncPaginator[ChatCompletionStoreMessage, AsyncCursorPage[ChatCompletionStoreMessage]]c          	      C  r=   r>   )rC   rD   r   r   r   r   r   rE   rF   r#   r#   r$   rG      rH   zAsyncMessages.list)r   rO   )r   rP   )r3   r4   r,   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r   rQ   rI   r#   r#   r#   r$   r   i   rN   c                   @     e Zd ZdddZdS )	r   messagesr   r   Nonec                 C     || _ t|j| _d S N)	_messagesr   to_raw_response_wrapperrG   r"   rS   r#   r#   r$   __init__      
z MessagesWithRawResponse.__init__NrS   r   r   rT   rJ   rK   rL   rZ   r#   r#   r#   r$   r          r   c                   @  rR   )	rO   rS   r   r   rT   c                 C  rU   rV   )rW   r   async_to_raw_response_wrapperrG   rY   r#   r#   r$   rZ      r[   z%AsyncMessagesWithRawResponse.__init__NrS   r   r   rT   r]   r#   r#   r#   r$   rO      r^   rO   c                   @  rR   )	r'   rS   r   r   rT   c                 C     || _ t|j| _d S rV   )rW   r   rG   rY   r#   r#   r$   rZ         
z&MessagesWithStreamingResponse.__init__Nr\   r]   r#   r#   r#   r$   r'      r^   r'   c                   @  rR   )	rP   rS   r   r   rT   c                 C  ra   rV   )rW   r   rG   rY   r#   r#   r$   rZ      rb   z+AsyncMessagesWithStreamingResponse.__init__Nr`   r]   r#   r#   r#   r$   rP      r^   rP   )*
__future__r   typing_extensionsr   httpx r   _typesr   r   r   r	   r
   r   r   _utilsr   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.chat.completionsr   (types.chat.chat_completion_store_messager   __all__r   r   r   rO   r'   rP   r#   r#   r#   r$   <module>   s(   $RR			