类class
agentscope.credentialTypeSafeCredential
class TypeSafeCredential(CredentialBase)
源码Source
agentscope/credential/_typesafe.py:13–33类型安全凭证,与模型服务通信并返回生成或向量化结果。位于 agentscope.credential 包,继承自 CredentialBase。核心成员包括 get_chat_model_class。
The credential used by TypeSafe System One models. Declared in agentscope.credential. Extends CredentialBase.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
model_config | — | 模型配置字段。 | ConfigDict(title='TypeSafe AI API') |
type | Literal['typesafe_credential'] | 类型字段。 | 'typesafe_credential' |
api_key | SecretStr | TypeSafe API 密钥。 | Field(description='The TypeSafe API key.') |
base_url | str | None | 一种可选自定义 TypeSafe API 基类 URL。 | Field(default=None, description='An optional custom TypeSafe API base URL.') |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
def get_chat_model_class() -> Type['ChatModelBase'] | 获取聊天模型类。 TypeSafe credentials serve classifier models only. |
属性详情Attribute Detail
model_config
= ConfigDict(title='TypeSafe AI API')模型配置字段。
TypeSafe AI API
源码Source
agentscope/credential/_typesafe.py:16type
Literal['typesafe_credential'] = 'typesafe_credential'类型字段。声明为 Literal['typesafe_credential']。
The type field.
源码Source
agentscope/credential/_typesafe.py:18api_key
SecretStr = Field(description='The TypeSafe API key.')TypeSafe API 密钥。
The TypeSafe API key.
源码Source
agentscope/credential/_typesafe.py:21base_url
str | None = Field(default=None, description='An optional custom TypeSafe API base URL.')一种可选自定义 TypeSafe API 基类 URL。
An optional custom TypeSafe API base URL.
源码Source
agentscope/credential/_typesafe.py:24方法详情Method Detail
get_chat_model_class
def get_chat_model_class() -> Type['ChatModelBase']
获取聊天模型类。
TypeSafe credentials serve classifier models only.
Type['ChatModelBase']
返回类型['ChatModelBase']。Returns type chat model base.
源码Source
agentscope/credential/_typesafe.py:31–33