A2uiModelClient
public interface A2uiModelClient extends Ordered
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiModelClient.java:26–40定义 A 2 ui 模型客户端契约的接口。位于 io.agentscope.examples.copilotkit.a2ui 包,实现 Ordered。核心成员包括 name、isAvailable、generate。
One model backend able to turn an intent into A2UI JSON.
A2uiComposer walks the available clients in Ordered order, so Gemini is tried
before the DashScope fallback.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String name() | 返回名称。 Identifier recorded in the shared state as `a2ui.generatedBy`. |
public boolean isAvailable() | 判断是否可用。 Whether the required credentials are configured. |
public String generate(String systemPrompt, String userPrompt) throws Exception | 执行 `generate` 方法。 Generates raw model output; the composer extracts the `<a2ui-json>` block from it. |
方法详情Method Detail
name
public String name()
返回名称。
Identifier recorded in the shared state as a2ui.generatedBy.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiModelClient.java:29isAvailable
public boolean isAvailable()
判断是否可用。
Whether the required credentials are configured.
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiModelClient.java:32generate
public String generate(String systemPrompt, String userPrompt) throws Exception
执行 generate 方法。
Generates raw model output; the composer extracts the block from it.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
systemPrompt | String | 系统提示词(类型 `String`)。The system prompt. |
userPrompt | String | 用户提示词(类型 `String`)。The user prompt. |
String返回字符串结果。Returns a string.
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiModelClient.java:39