§
    ÙŽ’jË  ã                   óŠ   — d Z ddlmZmZ ddlmZmZ ddlmZ erddl	m
Z
 ddlmZmZ ddlmZ dd	lmZ  G d
„ de¦  «        ZdS )úThe credential base class.é    )ÚTYPE_CHECKINGÚType)Ú	BaseModelÚFieldé   )Ú_generate_id)ÚEmbeddingModelBase)ÚChatModelBaseÚ	ModelCard)ÚTTSModelBase)ÚTTSModelCardc                   ó6  — e Zd ZU dZ eed¬¦  «        Zeed<    edd¬¦  «        Z	eed<   e
d	ed
         fd„¦   «         Ze
d	eed                  fd„¦   «         Ze
d	ed         fd„¦   «         Ze
d	ed         fd„¦   «         Ze
d	ed         dz  fd„¦   «         ZdS )ÚCredentialBaser   zThe credential id)Údefault_factoryÚdescriptionÚidÚ z-User-facing display name for this credential.)Údefaultr   ÚnameÚreturnr   c                 ó0   — t          | j        › d�¦  «        ‚)a*  Return the :class:`ChatModelBase` subclass that consumes this
        credential. Subclasses must override this method to return the
        corresponding chat model class.

        Returns:
            `Type[ChatModelBase]`:
                The chat model class that uses this credential.
        z) must implement ``get_chat_model_class``.)ÚNotImplementedErrorÚ__name__©Úclss    úIC:\Projects\DSCons\.venv\Lib\site-packages\agentscope\credential\_base.pyÚget_chat_model_classz#CredentialBase.get_chat_model_class   s$   € õ "ØŒ|ÐFÐFÐFñ
ô 
ð 	
ó    r   c                 ó   — g S )a{  Return the TTS model classes supported by this credential.

        Subclasses that support TTS should override this to return one or
        more :class:`TTSModelBase` subclasses. The default returns an empty
        list (provider does not support TTS).

        Returns:
            `list[Type[TTSModelBase]]`:
                The TTS model classes, or an empty list.
        © r   s    r   Úget_tts_model_classesz$CredentialBase.get_tts_model_classes+   s	   € ð ˆ	r   r   c                 ó†   — g }|                       ¦   «         D ])}|                     |                     ¦   «         ¦  «         Œ*|S )zÈList the candidate TTS models available under this credential.

        Returns:
            `list[TTSModelCard]`:
                A list of TTS model cards, or empty if TTS is not supported.
        )r"   ÚextendÚlist_models)r   ÚcardsÚtts_clss      r   Úlist_tts_modelszCredentialBase.list_tts_models9   sJ   € ð ')ˆØ×0Ò0Ñ2Ô2ð 	0ð 	0ˆGØ�LŠL˜×,Ò,Ñ.Ô.Ñ/Ô/Ð/Ð/Øˆr   r   c                 óN   — |                       ¦   «                              ¦   «         S )aj  List the candidate chat models that are available under this
        credential. The default implementation delegates to the
        :meth:`ChatModelBase.list_models` of the class returned by
        :meth:`get_chat_model_class`.

        Returns:
            `list[ModelCard]`:
                A list of candidate models described by their model cards.
        )r   r%   r   s    r   r%   zCredentialBase.list_modelsF   s"   € ð ×'Ò'Ñ)Ô)×5Ò5Ñ7Ô7Ð7r   r
   Nc                 ó   — dS )a¥  Return the :class:`EmbeddingModelBase` subclass that consumes
        this credential, or ``None`` if this provider does not support
        embedding models.

        Subclasses that have a matching embedding implementation should
        override this method. The default returns ``None``.

        Returns:
            `Type[EmbeddingModelBase] | None`:
                The embedding model class, or ``None``.
        Nr!   r   s    r   Úget_embedding_model_classz(CredentialBase.get_embedding_model_classS   s	   € ð ˆtr   )r   Ú
__module__Ú__qualname__Ú__doc__r   r	   r   ÚstrÚ__annotations__r   Úclassmethodr   r   Úlistr"   r(   r%   r+   r!   r   r   r   r      s_  € € € € € € Ø$Ð$àˆeØ$Ø'ðñ ô €Bˆð ð ñ ð
 �ØØCðñ ô €Dˆ#ð ð ñ ð
 ð
 T¨/Ô%:ð 
ð 
ð 
ñ „[ð
ð ð d¨4°Ô+?Ô&@ð ð ð ñ „[ðð ð
  ^Ô 4ð 
ð 
ð 
ñ „[ð
ð ð
8˜D Ô-ð 
8ð 
8ð 
8ñ „[ð
8ð ð¨$Ð/CÔ*DÀtÑ*Kð ð ð ñ „[ðð ð r   r   N)r.   Útypingr   r   Úpydanticr   r   Ú_utils._commonr	   Ú	embeddingr
   Úmodelr   r   Úttsr   Útts._tts_model_cardr   r   r!   r   r   ú<module>r:      sá   ðà  Ð  Ø &Ð &Ð &Ð &Ð &Ð &Ð &Ð &à %Ð %Ð %Ð %Ð %Ð %Ð %Ð %à )Ð )Ð )Ð )Ð )Ð )àð 3Ø.Ð.Ð.Ð.Ð.Ð.Ø0Ð0Ð0Ð0Ð0Ð0Ð0Ð0Ø"Ð"Ð"Ð"Ð"Ð"Ø2Ð2Ð2Ð2Ð2Ð2ðPð Pð Pð Pð P�Yñ Pô Pð Pð Pð Pr   