
    i                     L   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*y)    )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                  p    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	y)
r   _
    Given a list of messages comprising a conversation, the model will return a response.
    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
        )MessagesWithRawResponseselfs    {/Users/manta/Documents/Projects/TheRoad-I1/.venv/lib/python3.12/site-packages/openai/resources/chat/completions/messages.pywith_raw_responsezMessages.with_raw_response   s     't,,    c                    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
        )MessagesWithStreamingResponser"   s    r$   with_streaming_responsez Messages.with_streaming_response&   s     -T22r&   Nafterlimitorderextra_headersextra_query
extra_bodytimeoutc                   |st        d|      | j                  t        d|      t        t           t        ||||t        |||dt        j                              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)completion_id)r,   r-   r.   )r/   r0   r1   r2   query)pageoptionsmodel)	
ValueError_get_api_listr   r   r   r   r   r   MessageListParams	r#   r5   r,   r-   r.   r/   r0   r1   r2   s	            r$   listzMessages.list/   s    F [\i[lmnn!!FVcd :;(+'%%!&!&!&
 (99 -# " 
 	
r&   )returnr!   )r?   r)   )r5   strr,   
str | Omitr-   
int | Omitr.   Literal['asc', 'desc'] | Omitr/   Headers | Noner0   Query | Noner1   Body | Noner2   'float | httpx.Timeout | None | NotGivenr?   z*SyncCursorPage[ChatCompletionStoreMessage]
__name__
__module____qualname____doc__r   r%   r*   r   r   r>    r&   r$   r   r      s     - - 3 3 ! /3 )-$("&;D7
7
 	7

 7
 -7
 &7
 "7
  7
 97
 
47
r&   c                  p    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	y)
r   r   c                    t        |       S r    )AsyncMessagesWithRawResponser"   s    r$   r%   zAsyncMessages.with_raw_responsen   s     ,D11r&   c                    t        |       S r(   )"AsyncMessagesWithStreamingResponser"   s    r$   r*   z%AsyncMessages.with_streaming_responsex   s     2$77r&   Nr+   c                   |st        d|      | j                  t        d|      t        t           t        ||||t        |||dt        j                              t              S r4   )	r:   r;   r   r   r   r   r   r   r<   r=   s	            r$   r>   zAsyncMessages.list   s    F [\i[lmnn!!FVcd !;<(+'%%!&!&!&
 (99 -# " 
 	
r&   )r?   rP   )r?   rR   )r5   r@   r,   rA   r-   rB   r.   rC   r/   rD   r0   rE   r1   rF   r2   rG   r?   zWAsyncPaginator[ChatCompletionStoreMessage, AsyncCursorPage[ChatCompletionStoreMessage]]rH   rM   r&   r$   r   r   i   s     2 2 8 8 ! /3 )-$("&;D7
7
 	7

 7
 -7
 &7
 "7
  7
 97
 
a7
r&   c                      e Zd ZddZy)r!   c                Z    || _         t        j                  |j                        | _        y N)	_messagesr   to_raw_response_wrapperr>   r#   messagess     r$   __init__z MessagesWithRawResponse.__init__   s"    !$<<MM
	r&   NrZ   r   r?   NonerI   rJ   rK   r[   rM   r&   r$   r!   r!          
r&   r!   c                      e Zd ZddZy)rP   c                Z    || _         t        j                  |j                        | _        y rV   )rW   r   async_to_raw_response_wrapperr>   rY   s     r$   r[   z%AsyncMessagesWithRawResponse.__init__   s"    !$BBMM
	r&   NrZ   r   r?   r]   r^   rM   r&   r$   rP   rP      r_   r&   rP   c                      e Zd ZddZy)r)   c                F    || _         t        |j                        | _        y rV   )rW   r   r>   rY   s     r$   r[   z&MessagesWithStreamingResponse.__init__   s    !0MM
	r&   Nr\   r^   rM   r&   r$   r)   r)      r_   r&   r)   c                      e Zd ZddZy)rR   c                F    || _         t        |j                        | _        y rV   )rW   r   r>   rY   s     r$   r[   z+AsyncMessagesWithStreamingResponse.__init__   s    !6MM
	r&   Nrc   r^   rM   r&   r$   rR   rR      r_   r&   rR   )+
__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!   rP   r)   rR   rM   r&   r$   <module>rv      s    # %  ! L L L 5 ' ; Z : A : S
'O
 O
dO
$ O
d
 

 

 

 
r&   