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

XAICredential

class XAICredential(CredentialBase)
源码Source agentscope/credential/_xai.py:14–53

xAI 凭证模型。位于 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')
typeLiteral['xai_credential']
类型字段。
'xai_credential'
api_keySecretStr
xAI API 密钥。
Field(description='The xAI API key.')
api_hoststr
`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:17

type

Literal['xai_credential'] = 'xai_credential'

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

The type field.

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

api_key

SecretStr = Field(description='The xAI API key.')

xAI API 密钥。

The xAI API key.

源码Source agentscope/credential/_xai.py:24

api_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.

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

get_realtime_model_classes

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

获取 get_realtime_model_classes。

Return the xAI realtime model classes.

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

继承成员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.