o
    ¨Ýj:/  ã                   @  s  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 ddlmZ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 )é    )ÚannotationsNé   )Ú_legacy_response)ÚBodyÚQueryÚHeadersÚNotGivenÚ	not_given)Úpath_template)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncPageÚ	AsyncPage)ÚModel)ÚAsyncPaginatorÚmake_request_options)ÚModelDeletedÚModelsÚAsyncModelsc                   @  ón   e Zd ZdZeddd„ƒZeddd„ƒZd	d	d	ed
œd dd„Zd	d	d	ed
œd!dd„Z	d	d	d	ed
œd"dd„Z
d	S )#r   ú:List and describe the various models available in the API.ÚreturnÚModelsWithRawResponsec                 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    úR/var/www/html/chatgpt/venv/lib/python3.10/site-packages/openai/resources/models.pyÚwith_raw_response   ó   zModels.with_raw_responseÚModelsWithStreamingResponsec                 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Models.with_streaming_responseN©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚmodelÚstrr)   úHeaders | Noner*   úQuery | Noner+   úBody | Noner,   ú(float | httpx2.Timeout | None | NotGivenr   c             	   C  ó<   |s	t d|›�ƒ‚| jtd|d�t||||ddid�td�S )á¨  
        Retrieves a model instance, providing basic information about the model such as
        the owner and permissioning.

        Args:
          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
        ú4Expected a non-empty value for `model` but received ú/models/{model}©r-   Úbearer_authT©r)   r*   r+   r,   Úsecurity©ÚoptionsZcast_to©Ú
ValueErrorÚ_getr
   r   r   ©r   r-   r)   r*   r+   r,   r    r    r!   Úretrieve+   s   
û÷zModels.retrieveúSyncPage[Model]c             
   C  ó(   | j dtt t||||ddid�td�S ©z‘
        Lists the currently available models, and provides basic information about each
        one such as the owner and availability.
        z/modelsr8   Tr9   )Úpager<   r-   )Ú_get_api_listr   r   r   ©r   r)   r*   r+   r,   r    r    r!   ÚlistQ   ó   ûözModels.listr   c             	   C  r3   )á›  Delete a fine-tuned model.

        You must have the Owner role in your organization to
        delete a model.

        Args:
          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
        r5   r6   r7   r8   Tr9   r;   ©r>   Ú_deleter
   r   r   r@   r    r    r!   Údeletel   s   
û÷zModels.delete)r   r   )r   r$   ©r-   r.   r)   r/   r*   r0   r+   r1   r,   r2   r   r   )
r)   r/   r*   r0   r+   r1   r,   r2   r   rB   ©r-   r.   r)   r/   r*   r0   r+   r1   r,   r2   r   r   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r"   r&   r	   rA   rH   rM   r    r    r    r!   r      ó*    	÷+ø!÷c                   @  r   )#r   r   r   ÚAsyncModelsWithRawResponsec                 C  r   r   )rV   r   r    r    r!   r"   —   r#   zAsyncModels.with_raw_responseÚ AsyncModelsWithStreamingResponsec                 C  r   r%   )rW   r   r    r    r!   r&   ¡   r'   z#AsyncModels.with_streaming_responseNr(   r-   r.   r)   r/   r*   r0   r+   r1   r,   r2   r   c             	   Ã  óD   �|s
t d|›�ƒ‚| jtd|d�t||||ddid�td�I dH S )	r4   r5   r6   r7   r8   Tr9   r;   Nr=   r@   r    r    r!   rA   ª   s   €
û÷zAsyncModels.retrieveú'AsyncPaginator[Model, AsyncPage[Model]]c             
   C  rC   rD   )rF   r   r   r   rG   r    r    r!   rH   Ð   rI   zAsyncModels.listr   c             	   Ã  rX   )	rJ   r5   r6   r7   r8   Tr9   r;   NrK   r@   r    r    r!   rM   ë   s   €
û÷zAsyncModels.delete)r   rV   )r   rW   rN   )
r)   r/   r*   r0   r+   r1   r,   r2   r   rY   rO   rP   r    r    r    r!   r   ”   rU   c                   @  ó   e Zd Zddd„ZdS )	r   Úmodelsr   r   ÚNonec                 C  ó4   || _ t |j¡| _t |j¡| _t |j¡| _d S ©N)Ú_modelsr   Zto_raw_response_wrapperrA   rH   rM   ©r   r[   r    r    r!   Ú__init__  ó   ÿÿ
ÿzModelsWithRawResponse.__init__N©r[   r   r   r\   ©rQ   rR   rS   ra   r    r    r    r!   r     ó    r   c                   @  rZ   )	rV   r[   r   r   r\   c                 C  r]   r^   )r_   r   Zasync_to_raw_response_wrapperrA   rH   rM   r`   r    r    r!   ra   #  rb   z#AsyncModelsWithRawResponse.__init__N©r[   r   r   r\   rd   r    r    r    r!   rV   "  re   rV   c                   @  rZ   )	r$   r[   r   r   r\   c                 C  ó.   || _ t|jƒ| _t|jƒ| _t|jƒ| _d S r^   )r_   r   rA   rH   rM   r`   r    r    r!   ra   2  ó   ÿÿ
ÿz$ModelsWithStreamingResponse.__init__Nrc   rd   r    r    r    r!   r$   1  re   r$   c                   @  rZ   )	rW   r[   r   r   r\   c                 C  rg   r^   )r_   r   rA   rH   rM   r`   r    r    r!   ra   A  rh   z)AsyncModelsWithStreamingResponse.__init__Nrf   rd   r    r    r    r!   rW   @  re   rW   )&Ú
__future__r   Zhttpx2Ú r   Ú_typesr   r   r   r   r	   Z_utilsr
   Z_compatr   Z	_resourcer   r   Ú	_responser   r   Z
paginationr   r   Ztypes.modelr   Z_base_clientr   r   Ztypes.model_deletedr   Ú__all__r   r   r   rV   r$   rW   r    r    r    r!   Ú<module>   s&   