类class
agentscope.credentialXAICredential
class XAICredential(CredentialBase)
源码Source
agentscope/credential/_xai.py:14–53xAI 凭证模型。位于 agentscope.credential 包,继承自 CredentialBase。核心成员包括 get_chat_model_class、get_realtime_model_classes。
The xAI credential model. Declared in agentscope.credential. Extends CredentialBase.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
model_config | — | 模型配置字段。 | ConfigDict(title='xAI API') |
type | Literal['xai_credential'] | 类型字段。 | 'xai_credential' |
api_key | SecretStr | xAI API 密钥。 | Field(description='The xAI API key.') |
api_host | str | `api_host` 字段。 | Field(default='api.x.ai', title='API Host', description='The xAI API host (without scheme). Override to point at a compatible/self-hosted endpoint.') |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
def get_chat_model_class() -> Type['ChatModelBase'] | 返回XAIChatModel 类。 Return the XAIChatModel class. |
def get_realtime_model_classes() -> list[Type['RealtimeModelBase']] | 获取 `get_realtime_model_classes`。 Return the xAI realtime model classes. |
属性详情Attribute Detail
model_config
= ConfigDict(title='xAI API')模型配置字段。
xAI API
源码Source
agentscope/credential/_xai.py:17type
Literal['xai_credential'] = 'xai_credential'类型字段。声明为 Literal['xai_credential']。
The type field.
源码Source
agentscope/credential/_xai.py:21api_key
SecretStr = Field(description='The xAI API key.')xAI API 密钥。
The xAI API key.
源码Source
agentscope/credential/_xai.py:24api_host
str = Field(default='api.x.ai', title='API Host', description='The xAI API host (without scheme). Override to point at a compatible/self-hosted endpoint.')api_host 字段。声明为 str。
The xAI API host (without scheme).
源码Source
agentscope/credential/_xai.py:29方法详情Method Detail
get_chat_model_class
def get_chat_model_class() -> Type['ChatModelBase']
返回XAIChatModel 类。
Return the XAIChatModel class.
Type['ChatModelBase']
返回类型['ChatModelBase']。Returns type chat model base.
源码Source
agentscope/credential/_xai.py:40–44get_realtime_model_classes
def get_realtime_model_classes() -> list[Type['RealtimeModelBase']]
获取 get_realtime_model_classes。
Return the xAI realtime model classes.
list[Type['RealtimeModelBase']]
返回类型['RealtimeModelBase']列表。Returns a list of type realtime model base.
源码Source
agentscope/credential/_xai.py:47–53