o
    ͩZh+                     @  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 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   N/var/www/html/lang_env/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 | 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&   optionsZ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&   )pager6   r+   )_get_api_listr   r   r   r   r'   r(   r)   r*   r   r   r   listM      zModels.listr   c                C  r1   )  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
        r3   r4   r&   r5   r8   _deleter   r   r:   r   r   r   deleted   s   zModels.delete)r   r   )r   r"   r+   r,   r'   r-   r(   r.   r)   r/   r*   r0   r   r   )
r'   r-   r(   r.   r)   r/   r*   r0   r   r<   r+   r,   r'   r-   r(   r.   r)   r/   r*   r0   r   r   
__name__
__module____qualname__r
   r    r$   r   r;   rB   rG   r   r   r   r   r      (    	'c                   @  r   )"r   r   AsyncModelsWithRawResponsec                 C  r   r   )rO   r   r   r   r   r       r!   zAsyncModels.with_raw_response AsyncModelsWithStreamingResponsec                 C  r   r#   )rP   r   r   r   r   r$      r%   z#AsyncModels.with_streaming_responseNr&   r+   r,   r'   r-   r(   r.   r)   r/   r*   r0   r   c                  <   |s
t d|| jd| t||||dtdI dH S )r2   r3   r4   r&   r5   Nr7   r:   r   r   r   r;      s   zAsyncModels.retrieve'AsyncPaginator[Model, AsyncPage[Model]]c             	   C  r=   r>   )r@   r   r   r   rA   r   r   r   rB      rC   zAsyncModels.listr   c                  rQ   )rD   r3   r4   r&   r5   NrE   r:   r   r   r   rG      s   zAsyncModels.delete)r   rO   )r   rP   rH   )
r'   r-   r(   r.   r)   r/   r*   r0   r   rR   rI   rJ   r   r   r   r   r      rN   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_wrapperr;   rB   rG   r   rT   r   r   r   __init__      
zModelsWithRawResponse.__init__NrT   r   r   rU   rK   rL   rM   rZ   r   r   r   r   r          r   c                   @  rS   )	rO   rT   r   r   rU   c                 C  rV   rW   )rX   r   Zasync_to_raw_response_wrapperr;   rB   rG   rY   r   r   r   rZ   	  r[   z#AsyncModelsWithRawResponse.__init__NrT   r   r   rU   r]   r   r   r   r   rO     r^   rO   c                   @  rS   )	r"   rT   r   r   rU   c                 C  .   || _ t|j| _t|j| _t|j| _d S rW   )rX   r   r;   rB   rG   rY   r   r   r   rZ        
z$ModelsWithStreamingResponse.__init__Nr\   r]   r   r   r   r   r"     r^   r"   c                   @  rS   )	rP   rT   r   r   rU   c                 C  r`   rW   )rX   r   r;   rB   rG   rY   r   r   r   rZ   '  ra   z)AsyncModelsWithStreamingResponse.__init__Nr_   r]   r   r   r   r   rP   &  r^   rP   )$
__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   rO   r"   rP   r   r   r   r   <module>   s$   qq