AS AgentScopeAPI 手册 / API Reference

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.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/examples/copilotkit/a2ui/A2uiModelClient.java:29

isAvailable

public boolean isAvailable()

判断是否可用。

Whether the required credentials are configured.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/examples/copilotkit/a2ui/A2uiModelClient.java:32

generate

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
systemPromptString系统提示词(类型 `String`)。The system prompt.
userPromptString用户提示词(类型 `String`)。The user prompt.
返回Returns String
返回字符串结果。Returns a string.
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/examples/copilotkit/a2ui/A2uiModelClient.java:39
基于官方固定版本源码静态生成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.