o
    $iJ                     @  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                   @  D   e 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   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"   j/var/www/html/flask_server/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 | Noner/   Query | Noner0   Body | Noner1   '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.   r/   r0   r1   query)pageoptionsmodel)
ValueError_get_api_listr   r   r   r   r   MessageListParams	r!   r2   r+   r,   r-   r.   r/   r0   r1   r"   r"   r#   list+   (   #
zMessages.list)r   r   )r   r&   )r2   r3   r+   r4   r,   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r   r;   	__name__
__module____qualname__r   r$   r(   r   r   rF   r"   r"   r"   r#   r          	c                   @  r   ) r   r   AsyncMessagesWithRawResponsec                 C  r   r   )rM   r    r"   r"   r#   r$   f   r%   zAsyncMessages.with_raw_response"AsyncMessagesWithStreamingResponsec                 C  r   r'   )rN   r    r"   r"   r#   r(   p   r)   z%AsyncMessages.with_streaming_responseNr*   r2   r3   r+   r4   r,   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   WAsyncPaginator[ChatCompletionStoreMessage, AsyncCursorPage[ChatCompletionStoreMessage]]c          	      C  r<   r=   )rB   rC   r   r   r   r   r   rD   rE   r"   r"   r#   rF   y   rG   zAsyncMessages.list)r   rM   )r   rN   )r2   r3   r+   r4   r,   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r   rO   rH   r"   r"   r"   r#   r   e   rL   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_wrapperrF   r!   rQ   r"   r"   r#   __init__      
z MessagesWithRawResponse.__init__NrQ   r   r   rR   rI   rJ   rK   rX   r"   r"   r"   r#   r          r   c                   @  rP   )	rM   rQ   r   r   rR   c                 C  rS   rT   )rU   r   async_to_raw_response_wrapperrF   rW   r"   r"   r#   rX      rY   z%AsyncMessagesWithRawResponse.__init__NrQ   r   r   rR   r[   r"   r"   r"   r#   rM      r\   rM   c                   @  rP   )	r&   rQ   r   r   rR   c                 C     || _ t|j| _d S rT   )rU   r   rF   rW   r"   r"   r#   rX         
z&MessagesWithStreamingResponse.__init__NrZ   r[   r"   r"   r"   r#   r&      r\   r&   c                   @  rP   )	rN   rQ   r   r   rR   c                 C  r_   rT   )rU   r   rF   rW   r"   r"   r#   rX      r`   z+AsyncMessagesWithStreamingResponse.__init__Nr^   r[   r"   r"   r"   r#   rN      r\   rN   )*
__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   rM   r&   rN   r"   r"   r"   r#   <module>   s(   $NN			