
    g+                    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)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPage	AsyncPage)model_list_params)AsyncPaginatormake_request_options)BetaModelInfoModelsAsyncModelsc                      e Zd Zedd       Zed	d       Zddded	 	 	 	 	 	 	 	 	 	 	 d
dZeee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/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
        )ModelsWithRawResponseselfs    T/var/www/openai/venv/lib/python3.12/site-packages/anthropic/resources/beta/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/anthropics/anthropic-sdk-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          	     t    |st        d|      | j                  d| dt        ||||      t              S )  
        Get a specific model.

        The Models API response can be used to determine information about a specific
        model or resolve a model alias to a model ID.

        Args:
          model_id: Model identifier or alias.

          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
        7Expected a non-empty value for `model_id` but received /v1/models/
?beta=truer&   optionscast_to
ValueError_getr   r   r   model_idr'   r(   r)   r*   s         r   retrievezModels.retrieve)   sV    8 VW_Vbcddyy(:.(+Q[el "  
 	
r!   after_id	before_idlimitr'   r(   r)   r*   c                   | j                  dt        t           t        ||||t	        |||dt
        j                              t              S a  
        List available models.

        The Models API response can be used to determine which models are available for
        use in the API. More recently released models are listed first.

        Args:
          after_id: ID of the object to use as a cursor for pagination. When provided, returns the
              page of results immediately after this object.

          before_id: ID of the object to use as a cursor for pagination. When provided, returns the
              page of results immediately before this object.

          limit: Number of items to return per page.

              Defaults to `20`. Ranges from `1` to `1000`.

          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
        z/v1/models?beta=true)r:   r;   r<   )r'   r(   r)   r*   query)pager1   model)_get_api_listr   r   r   r   r   ModelListParamsr   r:   r;   r<   r'   r(   r)   r*   s           r   listzModels.listO   sb    L !!"-((+'%%$,%.!&
 &55  # " 
 	
r!   )returnr   )rF   r$   r7   strr'   Headers | Noner(   Query | Noner)   Body | Noner*   'float | httpx.Timeout | None | NotGivenrF   r   )r:   str | NotGivenr;   rM   r<   int | NotGivenr'   rI   r(   rJ   r)   rK   r*   rL   rF   zSyncPage[BetaModelInfo]	__name__
__module____qualname__r   r    r%   r   r8   rE    r!   r   r   r      s    + + 1 1 )-$("&;D$
$
 &$
 "$
  $
 9$
 
$
R $-$- ) )-$("&;D8
 !8
 "	8

 8
 &8
 "8
  8
 98
 
!8
r!   c                      e Zd Zedd       Zed	d       Zddded	 	 	 	 	 	 	 	 	 	 	 d
dZeee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| dt        ||||      t               d{   S 7 w)r,   r-   r.   r/   r&   r0   Nr3   r6   s         r   r8   zAsyncModels.retrieve   sd     8 VW_VbcddYY(:.(+Q[el "  
 
 	
 
s   =AA Ar9   c                   | j                  dt        t           t        ||||t	        |||dt
        j                              t              S r>   )rB   r   r   r   r   r   rC   rD   s           r   rE   zAsyncModels.list   sb    L !!"=)(+'%%$,%.!&
 &55  # " 
 	
r!   )rF   rV   )rF   rX   rG   )r:   rM   r;   rM   r<   rN   r'   rI   r(   rJ   r)   rK   r*   rL   rF   z7AsyncPaginator[BetaModelInfo, AsyncPage[BetaModelInfo]]rO   rS   r!   r   r   r      s    0 0 6 6 )-$("&;D$
$
 &$
 "$
  $
 9$
 
$
R $-$- ) )-$("&;D8
 !8
 "	8

 8
 &8
 "8
  8
 98
 
A8
r!   c                      e Zd ZddZy)r   c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        y N)_modelsr   to_raw_response_wrapperr8   rE   r   modelss     r   __init__zModelsWithRawResponse.__init__   s=    (@@OO
 %<<KK
	r!   Nra   r   rF   NonerP   rQ   rR   rb   rS   r!   r   r   r          
r!   r   c                      e Zd ZddZy)rV   c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        y r]   )r^   r   async_to_raw_response_wrapperr8   rE   r`   s     r   rb   z#AsyncModelsWithRawResponse.__init__  s=    (FFOO
 %BBKK
	r!   Nra   r   rF   rd   re   rS   r!   r   rV   rV     rf   r!   rV   c                      e Zd ZddZy)r$   c                z    || _         t        |j                        | _        t        |j                        | _        y r]   )r^   r   r8   rE   r`   s     r   rb   z$ModelsWithStreamingResponse.__init__  s1    4OO
 1KK
	r!   Nrc   re   rS   r!   r   r$   r$     rf   r!   r$   c                      e Zd ZddZy)rX   c                z    || _         t        |j                        | _        t        |j                        | _        y r]   )r^   r   r8   rE   r`   s     r   rb   z)AsyncModelsWithStreamingResponse.__init__$  s1    :OO
 7KK
	r!   Nrj   re   rS   r!   r   rX   rX   #  rf   r!   rX   )&
__future__r   httpx r   _typesr   r   r   r	   r
   _utilsr   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   
types.betar   _base_clientr   r   types.beta.beta_model_infor   __all__r   r   r   rV   r$   rX   rS   r!   r   <module>r|      s    #    ? ? % & : Y - + @ 7]
#r
_ r
jr
" r
j	
 	
	
 	
	
 	
	
 	
r!   