类class
agentscope.credentialAnthropicCredential
class AnthropicCredential(CredentialBase)
源码Source
agentscope/credential/_anthropic.py:13–39Anthropic 凭证,与模型服务通信并返回生成或向量化结果。位于 agentscope.credential 包,继承自 CredentialBase。核心成员包括 get_chat_model_class。
The Anthropic credential model. Declared in agentscope.credential. Extends CredentialBase.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
model_config | — | 模型配置字段。 | ConfigDict(title='Anthropic API') |
type | Literal['anthropic_credential'] | 类型字段。 | 'anthropic_credential' |
api_key | SecretStr | API 键字段。 | Field(description='The Anthropic API key') |
base_url | str | None | 基类 URL字段。 | Field(description='The base URL for the Anthropic API.', default=None) |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
def get_chat_model_class() -> Type['ChatModelBase'] | 返回AnthropicChatModel 类。 Return the AnthropicChatModel class. |
属性详情Attribute Detail
model_config
= ConfigDict(title='Anthropic API')模型配置字段。
Anthropic API
源码Source
agentscope/credential/_anthropic.py:16type
Literal['anthropic_credential'] = 'anthropic_credential'类型字段。声明为 Literal['anthropic_credential']。
The type field.
源码Source
agentscope/credential/_anthropic.py:20api_key
SecretStr = Field(description='The Anthropic API key')API 键字段。声明为 SecretStr。
The Anthropic API key
源码Source
agentscope/credential/_anthropic.py:23base_url
str | None = Field(description='The base URL for the Anthropic API.', default=None)基类 URL字段。声明为 str | None。
The base URL for the Anthropic API.
源码Source
agentscope/credential/_anthropic.py:28方法详情Method Detail
get_chat_model_class
def get_chat_model_class() -> Type['ChatModelBase']
返回AnthropicChatModel 类。
Return the AnthropicChatModel class.
Type['ChatModelBase']
返回类型['ChatModelBase']。Returns type chat model base.
源码Source
agentscope/credential/_anthropic.py:35–39