o
    ¨Ýjç   ã                   @  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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)Ú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                   @  óH   e Zd 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   ú_
    Given a list of messages comprising a conversation, the model will return a response.
    Ú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$   úe/var/www/html/chatgpt/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'] | Omitr0   úHeaders | Noner1   úQuery | Noner2   úBody | Noner3   ú(float | httpx2.Timeout | None | NotGivenú*SyncCursorPage[ChatCompletionStoreMessage]c          	      C  óT   |s	t d|›�ƒ‚| jtd|d�tt t||||t|||dœtjƒddi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/{completion_id}/messages)r4   )r-   r.   r/   Z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   r$   r$   r%   Úlist/   ó*   #
ýúóîzMessages.list)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   rI   r$   r$   r$   r%   r      ó    	ôc                   @  r   )!r   r   r   ÚAsyncMessagesWithRawResponsec                 C  r    r!   )rQ   r"   r$   r$   r%   r&   o   r'   zAsyncMessages.with_raw_responseÚ"AsyncMessagesWithStreamingResponsec                 C  r    r)   )rR   r"   r$   r$   r%   r*   y   r+   z%AsyncMessages.with_streaming_responseNr,   r4   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r3   r<   úWAsyncPaginator[ChatCompletionStoreMessage, AsyncCursorPage[ChatCompletionStoreMessage]]c          	      C  r>   r?   )	rE   rF   r   r   r   r   r   r   rG   rH   r$   r$   r%   rI   ‚   rJ   zAsyncMessages.list)r   rQ   )r   rR   )r4   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r3   r<   r   rS   rK   r$   r$   r$   r%   r   j   rP   c                   @  ó   e Zd Zddd„ZdS )	r   Úmessagesr   r   ÚNonec                 C  ó   || _ t |j¡| _d S ©N)Ú	_messagesr   Zto_raw_response_wrapperrI   ©r#   rU   r$   r$   r%   Ú__init__¾   ó   
ÿz MessagesWithRawResponse.__init__N©rU   r   r   rV   ©rL   rM   rN   r[   r$   r$   r$   r%   r   ½   ó    r   c                   @  rT   )	rQ   rU   r   r   rV   c                 C  rW   rX   )rY   r   Zasync_to_raw_response_wrapperrI   rZ   r$   r$   r%   r[   Ç   r\   z%AsyncMessagesWithRawResponse.__init__N©rU   r   r   rV   r^   r$   r$   r$   r%   rQ   Æ   r_   rQ   c                   @  rT   )	r(   rU   r   r   rV   c                 C  ó   || _ t|jƒ| _d S rX   )rY   r   rI   rZ   r$   r$   r%   r[   Ð   ó   
ÿz&MessagesWithStreamingResponse.__init__Nr]   r^   r$   r$   r$   r%   r(   Ï   r_   r(   c                   @  rT   )	rR   rU   r   r   rV   c                 C  ra   rX   )rY   r   rI   rZ   r$   r$   r%   r[   Ù   rb   z+AsyncMessagesWithStreamingResponse.__init__Nr`   r^   r$   r$   r$   r%   rR   Ø   r_   rR   )+Ú
__future__r   Ztyping_extensionsr   Zhttpx2Ú r   Ú_typesr   r   r   r	   r
   r   r   Z_utilsr   r   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   rQ   r(   rR   r$   r$   r$   r%   Ú<module>   s(   $SS			