
    qil,                    (   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)BodyQueryHeadersNotGiven	not_given)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    I/opt/pipecat/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&   )pager0   r6   )_get_api_listr   r   r   r   r'   r(   r)   r*   s        r   listzModels.listO   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/   r3   _deleter   r   r5   s         r   deletezModels.deletef   sT    2 STYS\]^^||ug(+Q[el !  
 	
r!   )returnr   )rC   r$   r6   strr'   Headers | Noner(   Query | Noner)   Body | Noner*   'float | httpx.Timeout | None | NotGivenrC   r   )
r'   rF   r(   rG   r)   rH   r*   rI   rC   zSyncPage[Model]r6   rE   r'   rF   r(   rG   r)   rH   r*   rI   rC   r   __name__
__module____qualname____doc__r   r    r%   r
   r7   r=   rB    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                  d| t        ||||      t               d{   S 7 w)r,   r-   r.   r&   r/   Nr2   r5   s         r   r7   zAsyncModels.retrieve   sb     0 STYS\]^^YYug(+Q[el   
 
 	
 
   <AAAc          
     d    | j                  dt        t           t        ||||      t              S r9   )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@   r5   s         r   rB   zAsyncModels.delete   sb     2 STYS\]^^\\ug(+Q[el ! " 
 
 	
 
rW   )rC   rS   )rC   rU   rD   )
r'   rF   r(   rG   r)   rH   r*   rI   rC   z'AsyncPaginator[Model, AsyncPage[Model]]rJ   rK   rP   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_wrapperr7   r=   rB   r   modelss     r   __init__zModelsWithRawResponse.__init__   sX    (@@OO
 %<<KK
	 '>>MM
r!   Nr`   r   rC   NonerL   rM   rN   ra   rP   r!   r   r   r          
r!   r   c                      e Zd ZddZy)rS   c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        y r\   )r]   r   async_to_raw_response_wrapperr7   r=   rB   r_   s     r   ra   z#AsyncModelsWithRawResponse.__init__  sX    (FFOO
 %BBKK
	 'DDMM
r!   Nr`   r   rC   rc   rd   rP   r!   r   rS   rS     re   r!   rS   c                      e Zd ZddZy)r$   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        y r\   )r]   r   r7   r=   rB   r_   s     r   ra   z$ModelsWithStreamingResponse.__init__  sF    4OO
 1KK
	 3MM
r!   Nrb   rd   rP   r!   r   r$   r$     re   r!   r$   c                      e Zd ZddZy)rU   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        y r\   )r]   r   r7   r=   rB   r_   s     r   ra   z)AsyncModelsWithStreamingResponse.__init__+  sF    :OO
 7KK
	 9MM
r!   Nri   rd   rP   r!   r   rU   rU   *  re   r!   rU   )$
__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   rS   r$   rU   rP   r!   r   <module>rz      s    #   > > % 9 X ,  /]
#p
_ p
fp
" p
f
 

 

 

 
r!   