AS AgentScopeAPI 手册 / API Reference

FallbackModel

public class FallbackModel implements Model
源码Source io/agentscope/harness/coding/model/FallbackModel.java:37–80

回退模型,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.harness.coding.model 包,实现 Model。核心成员包括 stream、getModelName、FallbackModel。

Model decorator that falls back to a secondary model on retryable errors.

The call is transparently retried using the secondary model.

Retryable error signals: RateLimitException, OverloadedException, or any exception whose message contains "overloaded", "rate_limit", or "529".

构造器摘要Constructor Summary

构造器Constructor说明Description
public FallbackModel(Model primary, Model secondary)
初始化 `FallbackModel` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public Flux<ChatResponse> stream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options)
执行流相关操作。
Performs the stream operation.
public String getModelName()
获取模型名称。
Returns the model name.

构造器详情Constructor Detail

FallbackModel

public FallbackModel(Model primary, Model secondary)

初始化 FallbackModel 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
primaryModelprimary(类型 `Model`)。The primary.
secondaryModelsecondary(类型 `Model`)。The secondary.
源码Source io/agentscope/harness/coding/model/FallbackModel.java:44–47

方法详情Method Detail

stream

public Flux<ChatResponse> stream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options)

执行流相关操作。

Performs the stream operation.

参数Parameters
名称Name类型Type说明Description
messagesList<Msg>消息列表(类型 `List`)。The messages.
toolsList<ToolSchema>工具列表(类型 `List`)。The tools.
optionsGenerateOptions选项(类型 `GenerateOptions`)。The options.
返回Returns Flux<ChatResponse>
返回Flux。Returns flux.
源码Source io/agentscope/harness/coding/model/FallbackModel.java:49–64

getModelName

public String getModelName()

获取模型名称。

Returns the model name.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/model/FallbackModel.java:66–69

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