o
    î6Wj51  ã                   @  s<  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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„ deƒZ)G dd„ deƒZ*G dd„ dƒZ+G dd„ dƒZ,G dd„ dƒZ-G dd„ dƒZ.dS )é    )Úannotations)ÚListNé   )Ú_legacy_response)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚomitÚ	not_given)Úis_givenÚpath_templateÚ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d„ƒZed#dd„ƒZeddded	œd$dd„Zeeeedddedœd%d d!„Z	dS )&r   ÚreturnÚModelsWithRawResponsec                 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
        )r!   ©Úself© r&   ún/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/anthropic/resources/beta/models.pyÚwith_raw_response   ó   zModels.with_raw_responseÚModelsWithStreamingResponsec                 C  r"   ©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
        )r*   r$   r&   r&   r'   Úwith_streaming_response#   ó   zModels.with_streaming_responseN©ÚbetasÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚmodel_idÚstrr/   úList[AnthropicBetaParam] | Omitr0   úHeaders | Noner1   úQuery | Noner2   úBody | Noner3   ú'float | httpx.Timeout | None | NotGivenr   c                C  sj   |s	t d|›�ƒ‚i tdt|ƒrd dd„ |D ƒ¡ntiƒ¥|p!i ¥}| jtd|d�t||||d�td	�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                 s  ó   � | ]}t |ƒV  qd S ©N©r5   ©Ú.0Úer&   r&   r'   Ú	<genexpr>N   ó   € z"Models.retrieve.<locals>.<genexpr>ú/v1/models/{model_id}?beta=true©r4   ©r0   r1   r2   r3   ©ÚoptionsÚcast_to©	Ú
ValueErrorr   r   Újoinr   Ú_getr   r   r   ©r%   r4   r/   r0   r1   r2   r3   r&   r&   r'   Úretrieve,   s   &ÿþ
ÿûzModels.retrieve©Úafter_idÚ	before_idÚlimitr/   r0   r1   r2   r3   rT   ú
str | OmitrU   rV   ú
int | OmitúSyncPage[BetaModelInfo]c          	      C  óh   i t dt|ƒrd dd„ |D ƒ¡ntiƒ¥|pi ¥}| jdtt t||||t|||dœt	j
ƒd�td�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
        r=   r>   c                 s  r?   r@   rA   rB   r&   r&   r'   rE   ƒ   rF   zModels.list.<locals>.<genexpr>ú/v1/models?beta=true©rT   rU   rV   ©r0   r1   r2   r3   Úquery©ÚpagerK   Úmodel)r   r   rO   r   Ú_get_api_listr   r   r   r   r   ÚModelListParams©	r%   rT   rU   rV   r/   r0   r1   r2   r3   r&   r&   r'   ÚlistY   ó.   )&ÿþýúûïzModels.list)r    r!   )r    r*   ©r4   r5   r/   r6   r0   r7   r1   r8   r2   r9   r3   r:   r    r   )rT   rW   rU   rW   rV   rX   r/   r6   r0   r7   r1   r8   r2   r9   r3   r:   r    rY   ©
Ú__name__Ú
__module__Ú__qualname__r   r(   r,   r   r   rR   rf   r&   r&   r&   r'   r      ó(    	ö0ôc                	   @  r   )&r   r    ÚAsyncModelsWithRawResponsec                 C  r"   r#   )rn   r$   r&   r&   r'   r(   œ   r)   zAsyncModels.with_raw_responseÚ AsyncModelsWithStreamingResponsec                 C  r"   r+   )ro   r$   r&   r&   r'   r,   ¦   r-   z#AsyncModels.with_streaming_responseNr.   r4   r5   r/   r6   r0   r7   r1   r8   r2   r9   r3   r:   r   c                Ã  sr   �|s
t d|›�ƒ‚i tdt|ƒrd dd„ |D ƒ¡ntiƒ¥|p"i ¥}| jtd|d�t||||d�td	�I d
H S )r;   r<   r=   r>   c                 s  r?   r@   rA   rB   r&   r&   r'   rE   Ñ   rF   z'AsyncModels.retrieve.<locals>.<genexpr>rG   rH   rI   rJ   NrM   rQ   r&   r&   r'   rR   ¯   s   €&ÿþ
ÿûzAsyncModels.retrieverS   rT   rW   rU   rV   rX   ú7AsyncPaginator[BetaModelInfo, AsyncPage[BetaModelInfo]]c          	      C  rZ   )	r[   r=   r>   c                 s  r?   r@   rA   rB   r&   r&   r'   rE     rF   z#AsyncModels.list.<locals>.<genexpr>r\   r]   r^   r`   )r   r   rO   r   rc   r   r   r   r   r   rd   re   r&   r&   r'   rf   Ü   rg   zAsyncModels.list)r    rn   )r    ro   rh   )rT   rW   rU   rW   rV   rX   r/   r6   r0   r7   r1   r8   r2   r9   r3   r:   r    rp   ri   r&   r&   r&   r'   r   ›   rm   c                   @  ó   e Zd Zddd„ZdS )	r!   Úmodelsr   r    ÚNonec                 C  ó&   || _ t |j¡| _t |j¡| _d S r@   )Ú_modelsr   Úto_raw_response_wrapperrR   rf   ©r%   rr   r&   r&   r'   Ú__init__  ó   ÿ
ÿzModelsWithRawResponse.__init__N©rr   r   r    rs   ©rj   rk   rl   rx   r&   r&   r&   r'   r!     ó    r!   c                   @  rq   )	rn   rr   r   r    rs   c                 C  rt   r@   )ru   r   Úasync_to_raw_response_wrapperrR   rf   rw   r&   r&   r'   rx   +  ry   z#AsyncModelsWithRawResponse.__init__N©rr   r   r    rs   r{   r&   r&   r&   r'   rn   *  r|   rn   c                   @  rq   )	r*   rr   r   r    rs   c                 C  ó"   || _ t|jƒ| _t|jƒ| _d S r@   )ru   r   rR   rf   rw   r&   r&   r'   rx   7  ó   ÿ
ÿz$ModelsWithStreamingResponse.__init__Nrz   r{   r&   r&   r&   r'   r*   6  r|   r*   c                   @  rq   )	ro   rr   r   r    rs   c                 C  r   r@   )ru   r   rR   rf   rw   r&   r&   r'   rx   C  r€   z)AsyncModelsWithStreamingResponse.__init__Nr~   r{   r&   r&   r&   r'   ro   B  r|   ro   )/Ú
__future__r   Útypingr   ÚhttpxÚ r   Ú_typesr   r   r   r	   r
   r   r   Ú_utilsr   r   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!   rn   r*   ro   r&   r&   r&   r'   Ú<module>   s.   $  