
    pi0                    \   d dl m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mZmZ ddl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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)    )annotations)ListN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)is_givenmaybe_transformstrip_not_given)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPage	AsyncPage)model_list_params)AsyncPaginatormake_request_options)AnthropicBetaParam)BetaModelInfoModelsAsyncModelsc            	          e Zd Zedd       Zed	d       Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 d
dZe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 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    a/opt/services/ai/voice_agent/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betasextra_headersextra_query
extra_bodytimeoutc          	         |st        d|      i t        dt        |      rdj                  d |D              nt        i      |xs i }| j                  d| dt        ||||      t              S )	X  
        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.

          betas: Optional header to specify the beta version(s) you want to use.

          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 anthropic-beta,c              3  2   K   | ]  }t        |        y wNstr.0es     r%   	<genexpr>z"Models.retrieve.<locals>.<genexpr>N        9PQ#a&9P   /v1/models/
?beta=truer.   r/   r0   r1   optionscast_to
ValueErrorr   r   joinr   _getr   r   r$   model_idr-   r.   r/   r0   r1   s          r%   retrievezModels.retrieve,   s    > VW_Vbcdd
/T\]bTc9P%9P1Pirst
"
 yy(:.(+Q[el "  
 	
r'   after_id	before_idlimitr-   r.   r/   r0   r1   c                  i t        dt        |      rdj                  d |D              nt        i      |xs i }| j	                  dt
        t           t        ||||t        |||dt        j                              t              S )  
        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`.

          betas: Optional header to specify the beta version(s) you want to use.

          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   c              3  2   K   | ]  }t        |        y wr8   r9   r;   s     r%   r>   zModels.list.<locals>.<genexpr>   r?   r@   /v1/models?beta=truerO   rP   rQ   r.   r/   r0   r1   querypagerE   model)r   r   rI   r   _get_api_listr   r   r   r   r   ModelListParams	r$   rO   rP   rQ   r-   r.   r/   r0   r1   s	            r%   listzModels.listY   s    R
/T\]bTc9P%9P1Pirst
"
 !!"-((+'%%$,%.!&
 &55  # " 
 	
r'   )returnr"   )r`   r*   rL   r:   r-   List[AnthropicBetaParam] | Omitr.   Headers | Noner/   Query | Noner0   Body | Noner1   'float | httpx.Timeout | None | NotGivenr`   r   )rO   
str | OmitrP   rg   rQ   
int | Omitr-   rb   r.   rc   r/   rd   r0   re   r1   rf   r`   zSyncPage[BetaModelInfo]
__name__
__module____qualname__r   r&   r+   r   r   rM   r_    r'   r%   r   r      s    + + 1 1 26 )-$("&;D+
+
 /	+
 &+
 "+
  +
 9+
 
+
`  $ $ 15 )-$("&;D?
 ?
 	?

 ?
 /?
 &?
 "?
  ?
 9?
 
!?
r'   c            	          e Zd Zedd       Zed	d       Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 d
dZe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|      i t        dt        |      rdj                  d |D              nt        i      |xs i }| j                  d| dt        ||||      t               d	{   S 7 w)
r3   r4   r5   r6   c              3  2   K   | ]  }t        |        y wr8   r9   r;   s     r%   r>   z'AsyncModels.retrieve.<locals>.<genexpr>   r?   r@   rA   rB   rC   rD   NrG   rK   s          r%   rM   zAsyncModels.retrieve   s     > VW_Vbcdd
/T\]bTc9P%9P1Pirst
"
 YY(:.(+Q[el "  
 
 	
 
s   A9B;B <BrN   c                  i t        dt        |      rdj                  d |D              nt        i      |xs i }| j	                  dt
        t           t        ||||t        |||dt        j                              t              S )rS   r5   r6   c              3  2   K   | ]  }t        |        y wr8   r9   r;   s     r%   r>   z#AsyncModels.list.<locals>.<genexpr>  r?   r@   rU   rV   rW   rY   )r   r   rI   r   r\   r   r   r   r   r   r]   r^   s	            r%   r_   zAsyncModels.list   s    R
/T\]bTc9P%9P1Pirst
"
 !!"=)(+'%%$,%.!&
 &55  # " 
 	
r'   )r`   rp   )r`   rr   ra   )rO   rg   rP   rg   rQ   rh   r-   rb   r.   rc   r/   rd   r0   re   r1   rf   r`   z7AsyncPaginator[BetaModelInfo, AsyncPage[BetaModelInfo]]ri   rm   r'   r%   r   r      s   0 0 6 6 26 )-$("&;D+
+
 /	+
 &+
 "+
  +
 9+
 
+
`  $ $ 15 )-$("&;D?
 ?
 	?

 ?
 /?
 &?
 "?
  ?
 9?
 
A?
r'   c                      e Zd ZddZy)r"   c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        y r8   )_modelsr   to_raw_response_wrapperrM   r_   r$   modelss     r%   __init__zModelsWithRawResponse.__init__  s=    (@@OO
 %<<KK
	r'   Nr|   r   r`   Nonerj   rk   rl   r}   rm   r'   r%   r"   r"         
r'   r"   c                      e Zd ZddZy)rp   c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        y r8   )ry   r   async_to_raw_response_wrapperrM   r_   r{   s     r%   r}   z#AsyncModelsWithRawResponse.__init__+  s=    (FFOO
 %BBKK
	r'   Nr|   r   r`   r   r   rm   r'   r%   rp   rp   *  r   r'   rp   c                      e Zd ZddZy)r*   c                z    || _         t        |j                        | _        t        |j                        | _        y r8   )ry   r   rM   r_   r{   s     r%   r}   z$ModelsWithStreamingResponse.__init__7  s1    4OO
 1KK
	r'   Nr~   r   rm   r'   r%   r*   r*   6  r   r'   r*   c                      e Zd ZddZy)rr   c                z    || _         t        |j                        | _        t        |j                        | _        y r8   )ry   r   rM   r_   r{   s     r%   r}   z)AsyncModelsWithStreamingResponse.__init__C  s1    :OO
 7KK
	r'   Nr   r   rm   r'   r%   rr   rr   B  r   r'   rr   ).
__future__r   typingr   httpx r   _typesr   r   r	   r
   r   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   
types.betar   _base_clientr   r   types.anthropic_beta_paramr   types.beta.beta_model_infor   __all__r   r   r"   rp   r*   rr   rm   r'   r%   <module>r      s    #     K K K @ @ & : Y - + @ < 7]
#@
_ @
F@
" @
F	
 	
	
 	
	
 	
	
 	
r'   