o
    ni,                     @  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    W/var/www/html/arapca_proje/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 | httpx.Timeout | None | NotGivenr   c                C  6   |s	t d|| jtd|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/{model}r-   r(   options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tdS z
        Lists the currently available models, and provides basic information about each
        one such as the owner and availability.
        z/modelsr(   )pager9   r-   )_get_api_listr   r   r   r   r)   r*   r+   r,   r    r    r!   listP      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   r(   r8   r<   _deleter
   r   r   r>   r    r    r!   deleteg   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   r@   r-   r.   r)   r/   r*   r0   r+   r1   r,   r2   r   r   __name__
__module____qualname____doc__r   r"   r&   r	   r?   rF   rK   r    r    r    r!   r      *    	'c                   @  r   )#r   r   r   AsyncModelsWithRawResponsec                 C  r   r   )rT   r   r    r    r!   r"      r#   zAsyncModels.with_raw_response AsyncModelsWithStreamingResponsec                 C  r   r%   )rU   r   r    r    r!   r&      r'   z#AsyncModels.with_streaming_responseNr(   r-   r.   r)   r/   r*   r0   r+   r1   r,   r2   r   c                  >   |s
t d|| jtd|dt||||dtdI dH S )r4   r5   r6   r7   r(   r8   Nr;   r>   r    r    r!   r?      s   
zAsyncModels.retrieve'AsyncPaginator[Model, AsyncPage[Model]]c             	   C  rA   rB   )rD   r   r   r   rE   r    r    r!   rF      rG   zAsyncModels.listr   c                  rV   )rH   r5   r6   r7   r(   r8   NrI   r>   r    r    r!   rK      s   
zAsyncModels.delete)r   rT   )r   rU   rL   )
r)   r/   r*   r0   r+   r1   r,   r2   r   rW   rM   rN   r    r    r    r!   r      rS   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   to_raw_response_wrapperr?   rF   rK   r   rY   r    r    r!   __init__      
zModelsWithRawResponse.__init__NrY   r   r   rZ   rO   rP   rQ   r`   r    r    r    r!   r          r   c                   @  rX   )	rT   rY   r   r   rZ   c                 C  r[   r\   )r]   r   async_to_raw_response_wrapperr?   rF   rK   r_   r    r    r!   r`     ra   z#AsyncModelsWithRawResponse.__init__NrY   r   r   rZ   rc   r    r    r    r!   rT     rd   rT   c                   @  rX   )	r$   rY   r   r   rZ   c                 C  .   || _ t|j| _t|j| _t|j| _d S r\   )r]   r   r?   rF   rK   r_   r    r    r!   r`        
z$ModelsWithStreamingResponse.__init__Nrb   rc   r    r    r    r!   r$     rd   r$   c                   @  rX   )	rU   rY   r   r   rZ   c                 C  rg   r\   )r]   r   r?   rF   rK   r_   r    r    r!   r`   ,  rh   z)AsyncModelsWithStreamingResponse.__init__Nrf   rc   r    r    r    r!   rU   +  rd   rU   )&
__future__r   httpx r   _typesr   r   r   r   r	   _utilsr
   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   types.modelr   _base_clientr   r   types.model_deletedr   __all__r   r   r   rT   r$   rU   r    r    r    r!   <module>   s&   ss