o
    +if'                     @  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                   @  j   e 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   returnModelsWithRawResponsec                 C     t | S N)r   self r   P/var/www/html/corbot_env/lib/python3.10/site-packages/openai/resources/models.pywith_raw_response      zModels.with_raw_responseModelsWithStreamingResponsec                 C  r   r   )r"   r   r   r   r   with_streaming_response   r!   zModels.with_streaming_responseNextra_headersextra_query
extra_bodytimeoutmodelstrr%   Headers | Noner&   Query | Noner'   Body | Noner(   'float | httpx.Timeout | None | NotGivenr   c                C  4   |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.retrieveSyncPage[Model]c             	   C  "   | 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$   )pager4   r)   )_get_api_listr   r   r   r   r%   r&   r'   r(   r   r   r   listB      zModels.listr   c                C  r/   )  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
        r1   r2   r$   r3   r7   _deleter   r   r9   r   r   r   deleteY   s   zModels.delete)r   r   )r   r"   r)   r*   r%   r+   r&   r,   r'   r-   r(   r.   r   r   )
r%   r+   r&   r,   r'   r-   r(   r.   r   r;   r)   r*   r%   r+   r&   r,   r'   r-   r(   r.   r   r   
__name__
__module____qualname__r
   r    r#   r   r:   rA   rF   r   r   r   r   r      (    	'c                   @  r   )"r   r   AsyncModelsWithRawResponsec                 C  r   r   )rN   r   r   r   r   r    ~   r!   zAsyncModels.with_raw_response AsyncModelsWithStreamingResponsec                 C  r   r   )rO   r   r   r   r   r#      r!   z#AsyncModels.with_streaming_responseNr$   r)   r*   r%   r+   r&   r,   r'   r-   r(   r.   r   c                  <   |s
t d|| jd| t||||dtdI dH S )r0   r1   r2   r$   r3   Nr6   r9   r   r   r   r:      s   zAsyncModels.retrieve'AsyncPaginator[Model, AsyncPage[Model]]c             	   C  r<   r=   )r?   r   r   r   r@   r   r   r   rA      rB   zAsyncModels.listr   c                  rP   )rC   r1   r2   r$   r3   NrD   r9   r   r   r   rF      s   zAsyncModels.delete)r   rN   )r   rO   rG   )
r%   r+   r&   r,   r'   r-   r(   r.   r   rQ   rH   rI   r   r   r   r   r   }   rM   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 r   )_modelsr   to_raw_response_wrapperr:   rA   rF   r   rS   r   r   r   __init__      
zModelsWithRawResponse.__init__NrS   r   r   rT   rJ   rK   rL   rY   r   r   r   r   r          r   c                   @  rR   )	rN   rS   r   r   rT   c                 C  rU   r   )rV   r   async_to_raw_response_wrapperr:   rA   rF   rX   r   r   r   rY      rZ   z#AsyncModelsWithRawResponse.__init__NrS   r   r   rT   r\   r   r   r   r   rN      r]   rN   c                   @  rR   )	r"   rS   r   r   rT   c                 C  .   || _ t|j| _t|j| _t|j| _d S r   )rV   r   r:   rA   rF   rX   r   r   r   rY        
z$ModelsWithStreamingResponse.__init__Nr[   r\   r   r   r   r   r"     r]   r"   c                   @  rR   )	rO   rS   r   r   rT   c                 C  r`   r   )rV   r   r:   rA   rF   rX   r   r   r   rY     ra   z)AsyncModelsWithStreamingResponse.__init__Nr_   r\   r   r   r   r   rO     r]   rO   )$
__future__r   httpx r   _typesr   r   r   r   r	   _compatr
   	_resourcer   r   	_responser   r   
paginationr   r   types.modelr   _base_clientr   r   types.model_deletedr   __all__r   r   r   rN   r"   rO   r   r   r   r   <module>   s$   ff