AS AgentScopeAPI 手册 / API Reference
类class agentscope.credential

DashScopeCredential

class DashScopeCredential(CredentialBase)
源码Source agentscope/credential/_dashscope.py:18–80

凭证用于 DashScope API。位于 agentscope.credential 包,继承自 CredentialBase。核心成员包括 get_chat_model_class、get_tts_model_classes、get_realtime_model_classes、get_embedding_model_class。

The credential for DashScope API. Declared in agentscope.credential. Extends CredentialBase.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
model_config—
模型配置字段。
ConfigDict(title='DashScope API')
typeLiteral['dashscope_credential']
类型字段。
'dashscope_credential'
api_keySecretStr
DashScope API 密钥。
Field(description='The DashScope API key.', title='API Key')
base_urlstr
基类 URL 用于 DashScope OpenAI 兼容的 API 端点。
Field(default=_DASHSCOPE_BASE_URL, title='API Base URL', description='The base URL for the DashScope OpenAI-compatible API endpoint.')

方法摘要Method Summary

方法Method说明Description
def get_chat_model_class() -> Type['ChatModelBase']
返回DashScopeChatModel 类。
Return the DashScopeChatModel class.
def get_tts_model_classes() -> list[Type['TTSModelBase']]
获取 `get_tts_model_classes`。
Return the DashScope TTS model classes.
def get_realtime_model_classes() -> list[Type['RealtimeModelBase']]
获取 `get_realtime_model_classes`。
Return the DashScope realtime model classes.
def get_embedding_model_class() -> Type['EmbeddingModelBase']
返回DashScopeEmbeddingModel 类。
Return the DashScopeEmbeddingModel class.

属性详情Attribute Detail

model_config

 = ConfigDict(title='DashScope API')

模型配置字段。

DashScope API

源码Source agentscope/credential/_dashscope.py:21

type

Literal['dashscope_credential'] = 'dashscope_credential'

类型字段。声明为 Literal['dashscope_credential']。

The type field.

源码Source agentscope/credential/_dashscope.py:25

api_key

SecretStr = Field(description='The DashScope API key.', title='API Key')

DashScope API 密钥。

The DashScope API key.

源码Source agentscope/credential/_dashscope.py:28

base_url

str = Field(default=_DASHSCOPE_BASE_URL, title='API Base URL', description='The base URL for the DashScope OpenAI-compatible API endpoint.')

基类 URL 用于 DashScope OpenAI 兼容的 API 端点。

The base URL for the DashScope OpenAI-compatible API endpoint.

源码Source agentscope/credential/_dashscope.py:33

方法详情Method Detail

get_chat_model_class

def get_chat_model_class() -> Type['ChatModelBase']

返回DashScopeChatModel 类。

Return the DashScopeChatModel class.

返回Returns Type['ChatModelBase']
返回类型['ChatModelBase']。Returns type chat model base.
源码Source agentscope/credential/_dashscope.py:42–46

get_tts_model_classes

def get_tts_model_classes() -> list[Type['TTSModelBase']]

获取 get_tts_model_classes。

Return the DashScope TTS model classes.

返回Returns list[Type['TTSModelBase']]
返回类型['TTSModelBase']列表。Returns a list of type TTS model base.
源码Source agentscope/credential/_dashscope.py:49–61

get_realtime_model_classes

def get_realtime_model_classes() -> list[Type['RealtimeModelBase']]

获取 get_realtime_model_classes。

Return the DashScope realtime model classes.

返回Returns list[Type['RealtimeModelBase']]
返回类型['RealtimeModelBase']列表。Returns a list of type realtime model base.
源码Source agentscope/credential/_dashscope.py:64–73

get_embedding_model_class

def get_embedding_model_class() -> Type['EmbeddingModelBase']

返回DashScopeEmbeddingModel 类。

Return the DashScopeEmbeddingModel class.

返回Returns Type['EmbeddingModelBase']
返回类型['EmbeddingModelBase']。Returns type embedding model base.
源码Source agentscope/credential/_dashscope.py:76–80

继承成员Inherited Members

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.