a
    _gt                     @  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                   @  s`   e Zd ZeddddZeddddZeeeddded	d
ddddddddd	ddZdS )r   MessagesWithRawResponsereturnc                 C  s   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   x/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/openai/resources/chat/completions/messages.pywith_raw_response   s    zMessages.with_raw_responseMessagesWithStreamingResponsec                 C  s   t | S 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"   s    z Messages.with_streaming_responseNafterlimitorderextra_headersextra_query
extra_bodytimeoutstrstr | NotGivenint | NotGiven!Literal['asc', 'desc'] | NotGivenHeaders | NoneQuery | NoneBody | None'float | httpx.Timeout | None | NotGivenz*SyncCursorPage[ChatCompletionStoreMessage]	completion_idr&   r'   r(   r)   r*   r+   r,   r   c          	      C  sN   |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   r6   r&   r'   r(   r)   r*   r+   r,   r   r   r    list+   s(    #
zMessages.list__name__
__module____qualname__r   r!   r$   r   r@   r   r   r   r    r      s   	c                   @  s`   e Zd ZeddddZeddddZeeeddded	d
ddddddddd	ddZdS )r   AsyncMessagesWithRawResponser   c                 C  s   t | S r   )rE   r   r   r   r    r!   f   s    zAsyncMessages.with_raw_response"AsyncMessagesWithStreamingResponsec                 C  s   t | S r#   )rF   r   r   r   r    r$   p   s    z%AsyncMessages.with_streaming_responseNr%   r-   r.   r/   r0   r1   r2   r3   r4   zWAsyncPaginator[ChatCompletionStoreMessage, AsyncCursorPage[ChatCompletionStoreMessage]]r5   c          	      C  sN   |st d|| jd| dtt t||||t|||dtjdtdS r7   )r<   r=   r   r   r   r   r   r>   r?   r   r   r    r@   y   s(    #
zAsyncMessages.listrA   r   r   r   r    r   e   s   	c                   @  s   e Zd ZdddddZdS )r   r   Nonemessagesr   c                 C  s   || _ t|j| _d S N)	_messagesr   Zto_raw_response_wrapperr@   r   rI   r   r   r    __init__   s    z MessagesWithRawResponse.__init__NrB   rC   rD   rM   r   r   r   r    r      s   r   c                   @  s   e Zd ZdddddZdS )rE   r   rG   rH   c                 C  s   || _ t|j| _d S rJ   )rK   r   Zasync_to_raw_response_wrapperr@   rL   r   r   r    rM      s    z%AsyncMessagesWithRawResponse.__init__NrN   r   r   r   r    rE      s   rE   c                   @  s   e Zd ZdddddZdS )r"   r   rG   rH   c                 C  s   || _ t|j| _d S rJ   )rK   r   r@   rL   r   r   r    rM      s    z&MessagesWithStreamingResponse.__init__NrN   r   r   r   r    r"      s   r"   c                   @  s   e Zd ZdddddZdS )rF   r   rG   rH   c                 C  s   || _ t|j| _d S rJ   )rK   r   r@   rL   r   r   r    rM      s    z+AsyncMessagesWithStreamingResponse.__init__NrN   r   r   r   r    rF      s   rF   )(
__future__r   Ztyping_extensionsr   Zhttpx r   _typesr   r   r   r	   r
   _utilsr   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   rE   r"   rF   r   r   r   r    <module>   s&   NN			