
    g+                    (   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e      Z G d de      Z G d d      Z  G d d      Z! G d d      Z" G d d      Z#y)    )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                      e 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	y)r   c                    t        |       S a  
        This property can be used as a prefix for any HTTP method call to return the
        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
        )ModelsWithRawResponseselfs    L/var/www/openai/venv/lib/python3.12/site-packages/openai/resources/models.pywith_raw_responsezModels.with_raw_response   s     %T**    c                    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
        )ModelsWithStreamingResponser   s    r   with_streaming_responsezModels.with_streaming_response"   s     +400r    Nextra_headersextra_query
extra_bodytimeoutc          	     r    |st        d|      | j                  d| t        ||||      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/r%   optionscast_to
ValueError_getr   r   r   modelr&   r'   r(   r)   s         r   retrievezModels.retrieve+   sT    0 STYS\]^^yyug(+Q[el   
 	
r    c          
     d    | j                  dt        t           t        ||||      t              S z
        Lists the currently available models, and provides basic information about each
        one such as the owner and availability.
        z/modelsr%   )pager/   r5   )_get_api_listr   r   r   r   r&   r'   r(   r)   s        r   listzModels.listM   s>     !!%(+Q[el  " 
 	
r    c          	     r    |st        d|      | j                  d| t        ||||      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
        r,   r-   r%   r.   r2   _deleter   r   r4   s         r   deletezModels.deleted   sT    2 STYS\]^^||ug(+Q[el !  
 	
r    )returnr   )rB   r#   r5   strr&   Headers | Noner'   Query | Noner(   Body | Noner)   'float | httpx.Timeout | None | NotGivenrB   r   )
r&   rE   r'   rF   r(   rG   r)   rH   rB   zSyncPage[Model]r5   rD   r&   rE   r'   rF   r(   rG   r)   rH   rB   r   
__name__
__module____qualname__r   r   r$   r   r6   r<   rA    r    r   r   r      s   + + 1 1 )-$("&;D 
 
 & 
 " 
   
 9 
 
 
N )-$("&;D

 &
 "
  
 9
 

: )-$("&;D!
!
 &!
 "!
  !
 9!
 
!
r    c                      e 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	y)r   c                    t        |       S r   )AsyncModelsWithRawResponser   s    r   r   zAsyncModels.with_raw_response   s     *$//r    c                    t        |       S r"   ) AsyncModelsWithStreamingResponser   s    r   r$   z#AsyncModels.with_streaming_response   s     055r    Nr%   c          	        K   |st        d|      | j                  d| t        ||||      t               d{   S 7 w)r+   r,   r-   r%   r.   Nr1   r4   s         r   r6   zAsyncModels.retrieve   sb     0 STYS\]^^YYug(+Q[el   
 
 	
 
   <AAAc          
     d    | j                  dt        t           t        ||||      t              S r8   )r:   r   r   r   r;   s        r   r<   zAsyncModels.list   s?     !!5!(+Q[el  " 
 	
r    c          	        K   |st        d|      | j                  d| t        ||||      t               d{   S 7 w)r>   r,   r-   r%   r.   Nr?   r4   s         r   rA   zAsyncModels.delete   sb     2 STYS\]^^\\ug(+Q[el ! " 
 
 	
 
rU   )rB   rQ   )rB   rS   rC   )
r&   rE   r'   rF   r(   rG   r)   rH   rB   z'AsyncPaginator[Model, AsyncPage[Model]]rI   rJ   rN   r    r   r   r      s   0 0 6 6 )-$("&;D 
 
 & 
 " 
   
 9 
 
 
N )-$("&;D

 &
 "
  
 9
 
1
: )-$("&;D!
!
 &!
 "!
  !
 9!
 
!
r    c                      e Zd ZddZy)r   c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        y N)_modelsr   to_raw_response_wrapperr6   r<   rA   r   modelss     r   __init__zModelsWithRawResponse.__init__   sX    (@@OO
 %<<KK
	 '>>MM
r    Nr^   r   rB   NonerK   rL   rM   r_   rN   r    r   r   r          
r    r   c                      e Zd ZddZy)rQ   c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        y rZ   )r[   r   async_to_raw_response_wrapperr6   r<   rA   r]   s     r   r_   z#AsyncModelsWithRawResponse.__init__	  sX    (FFOO
 %BBKK
	 'DDMM
r    Nr^   r   rB   ra   rb   rN   r    r   rQ   rQ     rc   r    rQ   c                      e Zd ZddZy)r#   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        y rZ   )r[   r   r6   r<   rA   r]   s     r   r_   z$ModelsWithStreamingResponse.__init__  sF    4OO
 1KK
	 3MM
r    Nr`   rb   rN   r    r   r#   r#     rc   r    r#   c                      e Zd ZddZy)rS   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        y rZ   )r[   r   r6   r<   rA   r]   s     r   r_   z)AsyncModelsWithStreamingResponse.__init__'  sF    :OO
 7KK
	 9MM
r    Nrg   rb   rN   r    r   rS   rS   &  rc   r    rS   )$
__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   rQ   r#   rS   rN   r    r   <module>rx      s    #   > > % 9 X ,  /]
#n
_ n
bn
" n
b
 

 

 

 
r    