DashScopeA2uiModelClient
@Component public class DashScopeA2uiModelClient implements A2uiModelClient
源码Source
io/agentscope/examples/copilotkit/a2ui/DashScopeA2uiModelClient.java:34–80DashScope A 2 ui 模型客户端,封装与远端服务的连接和调用。位于 io.agentscope.examples.copilotkit.a2ui 包,实现 A2uiModelClient。核心成员包括 name、isAvailable、getOrder、generate、DashScopeA2uiModelClient。
Fallback A2UI composer running on DashScope, so the demo still produces surfaces without a Gemini key.
A fresh single-iteration ReActAgent is built per request: the composer is stateless and
must never inherit conversation memory from a previous surface.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public DashScopeA2uiModelClient(String modelName) | 初始化 `DashScopeA2uiModelClient` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String name() | 返回名称。 Returns the name. |
public boolean isAvailable() | 判断是否可用。 Returns whether the available. |
public int getOrder() | 获取顺序。 Returns the order. |
public String generate(String systemPrompt, String userPrompt) | 执行 `generate` 方法。 Performs the generate operation. |
构造器详情Constructor Detail
DashScopeA2uiModelClient
public DashScopeA2uiModelClient(String modelName)
初始化 DashScopeA2uiModelClient 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
modelName | String | 模型名称(类型 `String`)。The model name. |
源码Source
io/agentscope/examples/copilotkit/a2ui/DashScopeA2uiModelClient.java:41–44方法详情Method Detail
name
public String name()
返回名称。
Returns the name.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/examples/copilotkit/a2ui/DashScopeA2uiModelClient.java:46–49isAvailable
public boolean isAvailable()
判断是否可用。
Returns whether the available.
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/examples/copilotkit/a2ui/DashScopeA2uiModelClient.java:51–55getOrder
public int getOrder()
获取顺序。
Returns the order.
int返回数值结果。Returns a numeric result.
源码Source
io/agentscope/examples/copilotkit/a2ui/DashScopeA2uiModelClient.java:57–60generate
public String generate(String systemPrompt, String userPrompt)
执行 generate 方法。
Performs the generate operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
systemPrompt | String | 系统提示词(类型 `String`)。The system prompt. |
userPrompt | String | 用户提示词(类型 `String`)。The user prompt. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/examples/copilotkit/a2ui/DashScopeA2uiModelClient.java:62–79