U
    ·ÜŸ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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)Ú	NOT_GIVENÚBodyÚQueryÚHeadersÚNotGiven)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncPageÚ	AsyncPage)ÚModel)ÚAsyncPaginatorÚmake_request_options)ÚModelDeletedÚModelsÚAsyncModelsc                   @  sš   e Zd Zeddœdd„ƒZeddœdd„ƒZddded	œd
ddddddœdd„Zddded	œddddddœdd„Zddded	œd
ddddddœdd„Z	dS )r   ÚModelsWithRawResponse©Ú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   ú;/tmp/pip-unpacked-wheel-2qj3ofc_/openai/resources/models.pyÚwith_raw_response   s    zModels.with_raw_responseÚModelsWithStreamingResponsec                 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Models.with_streaming_responseN©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚstrúHeaders | NoneúQuery | NoneúBody | Noneú'float | httpx.Timeout | None | NotGivenr   ©Úmodelr$   r%   r&   r'   r   c                C  s4   |st d|›�ƒ‚| jd|› �t||||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/r#   ©ÚoptionsZcast_to©Ú
ValueErrorÚ_getr   r   ©r   r.   r$   r%   r&   r'   r   r   r   Úretrieve+   s       ÿûzModels.retrievezSyncPage[Model]©r$   r%   r&   r'   r   c             	   C  s"   | j dtt t||||d�td�S ©z‘
        Lists the currently available models, and provides basic information about each
        one such as the owner and availability.
        z/modelsr#   )Úpager3   r.   )Ú_get_api_listr   r   r   ©r   r$   r%   r&   r'   r   r   r   ÚlistM   s       ÿúzModels.listr   c                C  s4   |st d|›�ƒ‚| jd|› �t||||d�td�S )á›  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
        r0   r1   r#   r2   ©r5   Ú_deleter   r   r7   r   r   r   Údeleted   s       ÿûzModels.delete©
Ú__name__Ú
__module__Ú__qualname__r
   r   r"   r   r8   r>   rB   r   r   r   r   r      s&   	÷'ø÷c                   @  sš   e Zd Zeddœdd„ƒZeddœdd„ƒZddded	œd
ddddddœdd„Zddded	œddddddœdd„Zddded	œd
ddddddœdd„Z	dS )r   ÚAsyncModelsWithRawResponser   c                 C  s   t | ƒS r   )rG   r   r   r   r   r   ‰   s    zAsyncModels.with_raw_responseÚ AsyncModelsWithStreamingResponsec                 C  s   t | ƒS r!   )rH   r   r   r   r   r"   “   s    z#AsyncModels.with_streaming_responseNr#   r(   r)   r*   r+   r,   r   r-   c                Ã  s:   |st d|›�ƒ‚| jd|› �t||||d�td�I dH S )r/   r0   r1   r#   r2   Nr4   r7   r   r   r   r8   œ   s       ÿûzAsyncModels.retrievez'AsyncPaginator[Model, AsyncPage[Model]]r9   c             	   C  s"   | j dtt t||||d�td�S r:   )r<   r   r   r   r=   r   r   r   r>   ¾   s       ÿúzAsyncModels.listr   c                Ã  s:   |st d|›�ƒ‚| jd|› �t||||d�td�I dH S )r?   r0   r1   r#   r2   Nr@   r7   r   r   r   rB   Õ   s       ÿûzAsyncModels.deleterC   r   r   r   r   r   ˆ   s&   	÷'ø÷c                   @  s   e Zd Zdddœdd„ZdS )r   r   ÚNone©Úmodelsr   c                 C  s4   || _ t |j¡| _t |j¡| _t |j¡| _d S ©N)Ú_modelsr   Zto_raw_response_wrapperr8   r>   rB   ©r   rK   r   r   r   Ú__init__ú   s    ÿÿÿzModelsWithRawResponse.__init__N©rD   rE   rF   rO   r   r   r   r   r   ù   s   r   c                   @  s   e Zd Zdddœdd„ZdS )rG   r   rI   rJ   c                 C  s4   || _ t |j¡| _t |j¡| _t |j¡| _d S rL   )rM   r   Zasync_to_raw_response_wrapperr8   r>   rB   rN   r   r   r   rO   	  s    ÿÿÿz#AsyncModelsWithRawResponse.__init__NrP   r   r   r   r   rG     s   rG   c                   @  s   e Zd Zdddœdd„ZdS )r    r   rI   rJ   c                 C  s.   || _ t|jƒ| _t|jƒ| _t|jƒ| _d S rL   )rM   r   r8   r>   rB   rN   r   r   r   rO     s    ÿÿÿz$ModelsWithStreamingResponse.__init__NrP   r   r   r   r   r      s   r    c                   @  s   e Zd Zdddœdd„ZdS )rH   r   rI   rJ   c                 C  s.   || _ t|jƒ| _t|jƒ| _t|jƒ| _d S rL   )rM   r   r8   r>   rB   rN   r   r   r   rO   '  s    ÿÿÿz)AsyncModelsWithStreamingResponse.__init__NrP   r   r   r   r   rH   &  s   rH   )$Ú
__future__r   ZhttpxÚ r   Ú_typesr   r   r   r   r	   Ú_compatr
   Z	_resourcer   r   Ú	_responser   r   Z
paginationr   r   Ztypes.modelr   Z_base_clientr   r   Ztypes.model_deletedr   Ú__all__r   r   r   rG   r    rH   r   r   r   r   Ú<module>   s"   qq