o
    ØRWjA/  ã                   @  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    úf/home/esfera/Documents/content_generation/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  ó<   |s	t d|›�ƒ‚| jtd|d�t||||ddi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-   Úbearer_authT©r)   r*   r+   r,   Úsecurity©Ú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did�td�S ©z‘
        Lists the currently available models, and provides basic information about each
        one such as the owner and availability.
        z/modelsr8   Tr9   )Úpager<   r-   )Ú_get_api_listr   r   r   ©r   r)   r*   r+   r,   r    r    r!   ÚlistT   ó   ûö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   r8   Tr9   r;   ©r?   Ú_deleter
   r   r   rA   r    r    r!   Údeleteo   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   rC   ©r-   r.   r)   r/   r*   r0   r+   r1   r,   r2   r   r   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r"   r&   r	   rB   rI   rN   r    r    r    r!   r      ó*    	÷+ø!÷c                   @  r   )#r   r   r   ÚAsyncModelsWithRawResponsec                 C  r   r   )rW   r   r    r    r!   r"   š   r#   zAsyncModels.with_raw_responseÚ AsyncModelsWithStreamingResponsec                 C  r   r%   )rX   r   r    r    r!   r&   ¤   r'   z#AsyncModels.with_streaming_responseNr(   r-   r.   r)   r/   r*   r0   r+   r1   r,   r2   r   c             	   Ã  óD   �|s
t d|›�ƒ‚| jtd|d�t||||ddid�td�I dH S )	r4   r5   r6   r7   r8   Tr9   r;   Nr>   rA   r    r    r!   rB   ­   s   €
û÷zAsyncModels.retrieveú'AsyncPaginator[Model, AsyncPage[Model]]c             
   C  rD   rE   )rG   r   r   r   rH   r    r    r!   rI   Ó   rJ   zAsyncModels.listr   c             	   Ã  rY   )	rK   r5   r6   r7   r8   Tr9   r;   NrL   rA   r    r    r!   rN   î   s   €
û÷zAsyncModels.delete)r   rW   )r   rX   rO   )
r)   r/   r*   r0   r+   r1   r,   r2   r   rZ   rP   rQ   r    r    r    r!   r   —   rV   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_wrapperrB   rI   rN   ©r   r\   r    r    r!   Ú__init__  ó   ÿÿ
ÿzModelsWithRawResponse.__init__N©r\   r   r   r]   ©rR   rS   rT   rc   r    r    r    r!   r     ó    r   c                   @  r[   )	rW   r\   r   r   r]   c                 C  r^   r_   )r`   r   Úasync_to_raw_response_wrapperrB   rI   rN   rb   r    r    r!   rc   &  rd   z#AsyncModelsWithRawResponse.__init__N©r\   r   r   r]   rf   r    r    r    r!   rW   %  rg   rW   c                   @  r[   )	r$   r\   r   r   r]   c                 C  ó.   || _ t|jƒ| _t|jƒ| _t|jƒ| _d S r_   )r`   r   rB   rI   rN   rb   r    r    r!   rc   5  ó   ÿÿ
ÿz$ModelsWithStreamingResponse.__init__Nre   rf   r    r    r    r!   r$   4  rg   r$   c                   @  r[   )	rX   r\   r   r   r]   c                 C  rj   r_   )r`   r   rB   rI   rN   rb   r    r    r!   rc   D  rk   z)AsyncModelsWithStreamingResponse.__init__Nri   rf   r    r    r    r!   rX   C  rg   rX   )&Ú
__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   rW   r$   rX   r    r    r    r!   Ú<module>   s&   