a
    ~g+                     @  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   \/var/www/html/emsaiapi.evdpl.com/venv/lib/python3.9/site-packages/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#   options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   r6   _deleter   r   r8   r   r   r   deleted   s    zModels.delete
__name__
__module____qualname__r
   r   r"   r   r9   r?   rC   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   )rH   r   r   r   r   r      s    zAsyncModels.with_raw_response AsyncModelsWithStreamingResponsec                 C  s   t | S r!   )rI   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   Nr5   r8   r   r   r   r9      s    zAsyncModels.retrievez'AsyncPaginator[Model, AsyncPage[Model]]r:   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   NrA   r8   r   r   r   rC      s    zAsyncModels.deleterD   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   to_raw_response_wrapperr9   r?   rC   r   rL   r   r   r   __init__   s    zModelsWithRawResponse.__init__NrE   rF   rG   rQ   r   r   r   r   r      s   r   c                   @  s   e Zd ZdddddZdS )rH   r   rJ   rK   c                 C  s4   || _ t|j| _t|j| _t|j| _d S rM   )rN   r   async_to_raw_response_wrapperr9   r?   rC   rP   r   r   r   rQ   	  s    z#AsyncModelsWithRawResponse.__init__NrR   r   r   r   r   rH     s   rH   c                   @  s   e Zd ZdddddZdS )r    r   rJ   rK   c                 C  s.   || _ t|j| _t|j| _t|j| _d S rM   )rN   r   r9   r?   rC   rP   r   r   r   rQ     s    z$ModelsWithStreamingResponse.__init__NrR   r   r   r   r   r      s   r    c                   @  s   e Zd ZdddddZdS )rI   r   rJ   rK   c                 C  s.   || _ t|j| _t|j| _t|j| _d S rM   )rN   r   r9   r?   rC   rP   r   r   r   rQ   '  s    z)AsyncModelsWithStreamingResponse.__init__NrR   r   r   r   r   rI   &  s   rI   )$
__future__r   httpx r   _typesr   r   r   r   r	   _compatr
   	_resourcer   r   	_responser   r   
paginationr   r   Ztypes.modelr   _base_clientr   r   Ztypes.model_deletedr   __all__r   r   r   rH   r    rI   r   r   r   r   <module>   s"   qq