o
    "cht                     @  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 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)	NOT_GIVENBodyQueryHeadersNotGiven)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    h/home/air/goalskill/back/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 | NotGivenr*   int | NotGivenr+   !Literal['asc', 'desc'] | NotGivenr,   Headers | Noner-   Query | Noner.   Body | Noner/   '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-   r.   r/   query)pageoptionsmodel)
ValueError_get_api_listr   r   r   r   r   MessageListParams	r   r0   r)   r*   r+   r,   r-   r.   r/   r    r    r!   list+   (   #
zMessages.list)r   r   )r   r$   )r0   r1   r)   r2   r*   r3   r+   r4   r,   r5   r-   r6   r.   r7   r/   r8   r   r9   __name__
__module____qualname__r   r"   r&   r   rD   r    r    r    r!   r          	c                   @  r   ) r   r   AsyncMessagesWithRawResponsec                 C  r   r   )rK   r   r    r    r!   r"   f   r#   zAsyncMessages.with_raw_response"AsyncMessagesWithStreamingResponsec                 C  r   r%   )rL   r   r    r    r!   r&   p   r'   z%AsyncMessages.with_streaming_responseNr(   r0   r1   r)   r2   r*   r3   r+   r4   r,   r5   r-   r6   r.   r7   r/   r8   WAsyncPaginator[ChatCompletionStoreMessage, AsyncCursorPage[ChatCompletionStoreMessage]]c          	      C  r:   r;   )r@   rA   r   r   r   r   r   rB   rC   r    r    r!   rD   y   rE   zAsyncMessages.list)r   rK   )r   rL   )r0   r1   r)   r2   r*   r3   r+   r4   r,   r5   r-   r6   r.   r7   r/   r8   r   rM   rF   r    r    r    r!   r   e   rJ   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_wrapperrD   r   rO   r    r    r!   __init__      
z MessagesWithRawResponse.__init__NrO   r   r   rP   rG   rH   rI   rV   r    r    r    r!   r          r   c                   @  rN   )	rK   rO   r   r   rP   c                 C  rQ   rR   )rS   r   async_to_raw_response_wrapperrD   rU   r    r    r!   rV      rW   z%AsyncMessagesWithRawResponse.__init__NrO   r   r   rP   rY   r    r    r    r!   rK      rZ   rK   c                   @  rN   )	r$   rO   r   r   rP   c                 C     || _ t|j| _d S rR   )rS   r   rD   rU   r    r    r!   rV         
z&MessagesWithStreamingResponse.__init__NrX   rY   r    r    r    r!   r$      rZ   r$   c                   @  rN   )	rL   rO   r   r   rP   c                 C  r]   rR   )rS   r   rD   rU   r    r    r!   rV      r^   z+AsyncMessagesWithStreamingResponse.__init__Nr\   rY   r    r    r    r!   rL      rZ   rL   )(
__future__r   typing_extensionsr   httpx r   _typesr   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   rK   r$   rL   r    r    r    r!   <module>   s(   NN			