
    i                     r   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e          Z% G d de          Z& G d d          Z' G d d          Z( G d d          Z) G 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                  \    e Zd ZdZedd            Zedd            ZeeedddedddZ	dS )r   _
    Given a list of messages comprising a conversation, the model will return a response.
    returnMessagesWithRawResponsec                     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    selfs    q/home/piyush/.hermes/hermes-agent/venv/lib/python3.11/site-packages/openai/resources/chat/completions/messages.pywith_raw_responsezMessages.with_raw_response   s     't,,,    MessagesWithStreamingResponsec                     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#   s    r%   with_streaming_responsez Messages.with_streaming_response&   s     -T222r'   N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                  |st          d|          |                     t          d|          t          t                   t          ||||t          |||dt          j                  ddi          t                    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/   bearer_authT)r0   r1   r2   r3   querysecurity)pageoptionsmodel)	
ValueError_get_api_listr   r   r   r   r   r   MessageListParams	r$   r4   r-   r.   r/   r0   r1   r2   r3   s	            r%   listzMessages.list/   s    F  	om\immnnn!!FVcddd :;(+'%%!&!&!& 
 (9  (.   -% " 
 
 	
r'   )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   rJ    r'   r%   r   r      s          - - - _- 3 3 3 _3 ! /3 )-$("&;D8
 8
 8
 8
 8
 8
 8
 8
r'   c                  \    e Zd ZdZedd            Zedd            ZeeedddedddZ	dS )r   r   r   AsyncMessagesWithRawResponsec                     t          |           S r"   )rR   r#   s    r%   r&   zAsyncMessages.with_raw_responseo   s     ,D111r'   "AsyncMessagesWithStreamingResponsec                     t          |           S r*   )rT   r#   s    r%   r+   z%AsyncMessages.with_streaming_responsey   s     2$777r'   Nr,   r4   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r3   r<   WAsyncPaginator[ChatCompletionStoreMessage, AsyncCursorPage[ChatCompletionStoreMessage]]c                  |st          d|          |                     t          d|          t          t                   t          ||||t          |||dt          j                  ddi          t                    S r?   )	rF   rG   r   r   r   r   r   r   rH   rI   s	            r%   rJ   zAsyncMessages.list   s    F  	om\immnnn!!FVcddd !;<(+'%%!&!&!& 
 (9  (.   -% " 
 
 	
r'   )r   rR   )r   rT   )r4   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r3   r<   r   rV   rK   rP   r'   r%   r   r   j   s          2 2 2 _2 8 8 8 _8 ! /3 )-$("&;D8
 8
 8
 8
 8
 8
 8
 8
r'   c                      e Zd ZddZdS )r    messagesr   r   Nonec                P    || _         t          j        |j                  | _        d S N)	_messagesr   to_raw_response_wrapperrJ   r$   rY   s     r%   __init__z MessagesWithRawResponse.__init__   s&    !$<M
 
			r'   NrY   r   r   rZ   rL   rM   rN   r`   rP   r'   r%   r    r       (        
 
 
 
 
 
r'   r    c                      e Zd ZddZdS )rR   rY   r   r   rZ   c                P    || _         t          j        |j                  | _        d S r\   )r]   r   async_to_raw_response_wrapperrJ   r_   s     r%   r`   z%AsyncMessagesWithRawResponse.__init__   s&    !$BM
 
			r'   NrY   r   r   rZ   rb   rP   r'   r%   rR   rR      rc   r'   rR   c                      e Zd ZddZdS )r(   rY   r   r   rZ   c                F    || _         t          |j                  | _        d S r\   )r]   r   rJ   r_   s     r%   r`   z&MessagesWithStreamingResponse.__init__   s#    !0M
 
			r'   Nra   rb   rP   r'   r%   r(   r(      rc   r'   r(   c                      e Zd ZddZdS )rT   rY   r   r   rZ   c                F    || _         t          |j                  | _        d S r\   )r]   r   rJ   r_   s     r%   r`   z+AsyncMessagesWithStreamingResponse.__init__   s#    !6M
 
			r'   Nrg   rb   rP   r'   r%   rT   rT      rc   r'   rT   )+
__future__r   typing_extensionsr   httpx r   _typesr   r   r	   r
   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.chat.completionsr   (types.chat.chat_completion_store_messager   __all__r   r   r    rR   r(   rT   rP   r'   r%   <module>rz      sE   # " " " " " % % % % % %  ! ! ! ! ! ! L L L L L L L L L L L L L L L L L L 5 5 5 5 5 5 5 5 ' ' ' ' ' ' ; ; ; ; ; ; ; ; Z Z Z Z Z Z Z Z : : : : : : : : A A A A A A A A : : : : : : S S S S S S
'P
 P
 P
 P
 P
 P
 P
 P
fP
 P
 P
 P
 P
$ P
 P
 P
f
 
 
 
 
 
 
 

 
 
 
 
 
 
 

 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
r'   