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

ModelConfig

class ModelConfig(BaseModel)
源码Source agentscope/agent/_config.py:415–442

模型相关配置。位于 agentscope.agent 包。

The model related configuration. Declared in agentscope.agent.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
model_config—
模型配置字段。
{'arbitrary_types_allowed': True}
max_retriesint
最大重试字段。
Field(default=0, ge=0, description="Number of retries on top of the initial call before falling over to the fallback model. ``0`` means call the model exactly once and immediately move to the fallback on failure. Same semantics as ``ChatModelBase.max_retries``. Defaults to 0 to avoid compounding with the model's own inner retry loop.")
fallback_modelChatModelBase | None
回退模型字段。
Field(default=None, description='The fallback model used when the main model fails.')

属性详情Attribute Detail

model_config

 = {'arbitrary_types_allowed': True}

模型配置字段。

The model config field.

源码Source agentscope/agent/_config.py:420

max_retries

int = Field(default=0, ge=0, description="Number of retries on top of the initial call before falling over to the fallback model. ``0`` means call the model exactly once and immediately move to the fallback on failure. Same semantics as ``ChatModelBase.max_retries``. Defaults to 0 to avoid compounding with the model's own inner retry loop.")

最大重试字段。声明为 int。

Number of retries on top of the initial call before falling over to the fallback model.

源码Source agentscope/agent/_config.py:422

fallback_model

ChatModelBase | None = Field(default=None, description='The fallback model used when the main model fails.')

回退模型字段。声明为 ChatModelBase | None。

The fallback model used when the main model fails.

源码Source agentscope/agent/_config.py:437
基于官方固定版本源码静态生成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.