
    iA/                    Z   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e          Z  G d de          Z! G d d          Z" G d d          Z# G d d          Z$ G 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                  ~    e Zd ZdZedd            Zedd            ZdddedddZdddedddZ	dddedddZ
dS )r   :List and describe the various models available in the API.returnModelsWithRawResponsec                     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   selfs    ^/home/piyush/.hermes/hermes-agent/venv/lib/python3.11/site-packages/openai/resources/models.pywith_raw_responsezModels.with_raw_response   s     %T***    ModelsWithStreamingResponsec                     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   s    r!   with_streaming_responsezModels.with_streaming_response%   s     +4000r#   Nextra_headersextra_query
extra_bodytimeoutmodelstrr)   Headers | Noner*   Query | Noner+   Body | Noner,   'float | httpx.Timeout | None | NotGivenr   c                   |st          d|          |                     t          d|          t          ||||ddi          t                    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,   s         r!   retrievezModels.retrieve.   s|    0  	_]TY]]^^^yy+5999(+'%'.     

 

 
	
r#   SyncPage[Model]c                   |                      dt          t                   t          ||||ddi          t                    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,   s        r!   listzModels.listT   sV     !!%(+'%'.    " 
 
 	
r#   r   c                   |st          d|          |                     t          d|          t          ||||ddi          t                    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
        r5   r6   r7   r8   Tr9   r;   r?   _deleter   r   r   rA   s         r!   deletezModels.deleteo   s|    2  	_]TY]]^^^||+5999(+'%'.   !  

 

 
	
r#   )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      s        DD+ + + _+ 1 1 1 _1 )-$("&;D$
 $
 $
 $
 $
 $
V )-$("&;D
 
 
 
 
 
B )-$("&;D%
 %
 %
 %
 %
 %
 %
 %
r#   c                  ~    e Zd ZdZedd            Zedd            ZdddedddZdddedddZ	dddedddZ
dS )r   r   r   AsyncModelsWithRawResponsec                     t          |           S r   )rX   r   s    r!   r"   zAsyncModels.with_raw_response   s     *$///r#    AsyncModelsWithStreamingResponsec                     t          |           S r&   )rZ   r   s    r!   r'   z#AsyncModels.with_streaming_response   s     0555r#   Nr(   r-   r.   r)   r/   r*   r0   r+   r1   r,   r2   r   c                  K   |st          d|          |                     t          d|          t          ||||ddi          t                     d{V S )	r4   r5   r6   r7   r8   Tr9   r;   Nr>   rA   s         r!   rB   zAsyncModels.retrieve   s      0  	_]TY]]^^^YY+5999(+'%'.     

 

 

 

 

 

 

 

 
	
r#   'AsyncPaginator[Model, AsyncPage[Model]]c                   |                      dt          t                   t          ||||ddi          t                    S rE   )rG   r   r   r   rH   s        r!   rI   zAsyncModels.list   sW     !!5!(+'%'.    " 
 
 	
r#   r   c                  K   |st          d|          |                     t          d|          t          ||||ddi          t                     d{V S )	rK   r5   r6   r7   r8   Tr9   r;   NrL   rA   s         r!   rN   zAsyncModels.delete   s      2  	_]TY]]^^^\\+5999(+'%'.   ! " 

 

 

 

 

 

 

 

 
	
r#   )r   rX   )r   rZ   rO   )
r)   r/   r*   r0   r+   r1   r,   r2   r   r]   rP   rQ   rV   r#   r!   r   r      s        DD0 0 0 _0 6 6 6 _6 )-$("&;D$
 $
 $
 $
 $
 $
V )-$("&;D
 
 
 
 
 
B )-$("&;D%
 %
 %
 %
 %
 %
 %
 %
r#   c                      e Zd ZddZdS )r   modelsr   r   Nonec                    || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S N)_modelsr   to_raw_response_wrapperrB   rI   rN   r    ra   s     r!   __init__zModelsWithRawResponse.__init__  s\    (@O
 
 %<K
 
	 '>M
 
r#   Nra   r   r   rb   rR   rS   rT   rh   rV   r#   r!   r   r     (        
 
 
 
 
 
r#   r   c                      e Zd ZddZdS )rX   ra   r   r   rb   c                    || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S rd   )re   r   async_to_raw_response_wrapperrB   rI   rN   rg   s     r!   rh   z#AsyncModelsWithRawResponse.__init__&  s\    (FO
 
 %BK
 
	 'DM
 
r#   Nra   r   r   rb   rj   rV   r#   r!   rX   rX   %  rk   r#   rX   c                      e Zd ZddZdS )r$   ra   r   r   rb   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        d S rd   )re   r   rB   rI   rN   rg   s     r!   rh   z$ModelsWithStreamingResponse.__init__5  sS    4O
 
 1K
 
	 3M
 
r#   Nri   rj   rV   r#   r!   r$   r$   4  rk   r#   r$   c                      e Zd ZddZdS )rZ   ra   r   r   rb   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        d S rd   )re   r   rB   rI   rN   rg   s     r!   rh   z)AsyncModelsWithStreamingResponse.__init__D  sS    :O
 
 7K
 
	 9M
 
r#   Nro   rj   rV   r#   r!   rZ   rZ   C  rk   r#   rZ   )&
__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   rX   r$   rZ   rV   r#   r!   <module>r      s3   # " " " " "        > > > > > > > > > > > > > > " " " " " " % % % % % % 9 9 9 9 9 9 9 9 X X X X X X X X , , , , , , , ,              / . . . . .]
#|
 |
 |
 |
 |
_ |
 |
 |
~|
 |
 |
 |
 |
" |
 |
 |
~
 
 
 
 
 
 
 

 
 
 
 
 
 
 

 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
r#   