
    i,                    4   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%y)    )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
y)r   :List and describe the various models available in the API.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
        )ModelsWithRawResponseselfs    h/Users/manta/Documents/Projects/TheRoad-I1/.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          	         |st        d|      | j                  t        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/{model}modelr'   optionscast_to
ValueError_getr   r   r   r   r1   r(   r)   r*   r+   s         r    retrievezModels.retrieve.   sU    0 STYS\]^^yy+59(+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'   )pager3   r1   )_get_api_listr   r   r   r   r(   r)   r*   r+   s        r    listzModels.listP   s>     !!%(+Q[el  " 
 	
r"   c          	         |st        d|      | j                  t        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/   r0   r'   r2   r6   _deleter   r   r   r8   s         r    deletezModels.deleteg   sU    2 STYS\]^^||+59(+Q[el !  
 	
r"   )returnr   )rE   r%   r1   strr(   Headers | Noner)   Query | Noner*   Body | Noner+   'float | httpx.Timeout | None | NotGivenrE   r   )
r(   rH   r)   rI   r*   rJ   r+   rK   rE   zSyncPage[Model]r1   rG   r(   rH   r)   rI   r*   rJ   r+   rK   rE   r   __name__
__module____qualname____doc__r   r!   r&   r
   r9   r?   rD    r"   r    r   r      s   D+ + 1 1 )-$("&;D 
 
 & 
 " 
   
 9 
 
 
N )-$("&;D

 &
 "
  
 9
 

: )-$("&;D!
!
 &!
 "!
  !
 9!
 
!
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
y)r   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                  t        d|      t        ||||      t               d{   S 7 w)r-   r.   r/   r0   r'   r2   Nr5   r8   s         r    r9   zAsyncModels.retrieve   sc     0 STYS\]^^YY+59(+Q[el   
 
 	
 
   AAAAc          
     d    | j                  dt        t           t        ||||      t              S r;   )r=   r   r   r   r>   s        r    r?   zAsyncModels.list   s?     !!5!(+Q[el  " 
 	
r"   c          	        K   |st        d|      | j                  t        d|      t        ||||      t               d{   S 7 w)rA   r.   r/   r0   r'   r2   NrB   r8   s         r    rD   zAsyncModels.delete   sc     2 STYS\]^^\\+59(+Q[el ! " 
 
 	
 
rY   )rE   rU   )rE   rW   rF   )
r(   rH   r)   rI   r*   rJ   r+   rK   rE   z'AsyncPaginator[Model, AsyncPage[Model]]rL   rM   rR   r"   r    r   r      s   D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_wrapperr9   r?   rD   r   modelss     r    __init__zModelsWithRawResponse.__init__   sX    (@@OO
 %<<KK
	 '>>MM
r"   Nrb   r   rE   NonerN   rO   rP   rc   rR   r"   r    r   r          
r"   r   c                      e Zd ZddZy)rU   c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        y r^   )r_   r   async_to_raw_response_wrapperr9   r?   rD   ra   s     r    rc   z#AsyncModelsWithRawResponse.__init__  sX    (FFOO
 %BBKK
	 'DDMM
r"   Nrb   r   rE   re   rf   rR   r"   r    rU   rU     rg   r"   rU   c                      e Zd ZddZy)r%   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        y r^   )r_   r   r9   r?   rD   ra   s     r    rc   z$ModelsWithStreamingResponse.__init__  sF    4OO
 1KK
	 3MM
r"   Nrd   rf   rR   r"   r    r%   r%     rg   r"   r%   c                      e Zd ZddZy)rW   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        y r^   )r_   r   r9   r?   rD   ra   s     r    rc   z)AsyncModelsWithStreamingResponse.__init__,  sF    :OO
 7KK
	 9MM
r"   Nrk   rf   rR   r"   r    rW   rW   +  rg   r"   rW   )&
__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   rU   r%   rW   rR   r"   r    <module>r}      s    #   > > " % 9 X ,  /]
#p
_ p
fp
" p
f
 

 

 

 
r"   