A2uiComposer
@Component public class A2uiComposer
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiComposer.java:36–113A 2 ui Composer,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.examples.copilotkit.a2ui 包。核心成员包括 schemaSourceName、compose、A2uiComposer。
Turns a natural-language intent into a renderable A2UI surface.
Model clients are tried in order (Gemini first, DashScope second). Every failure — no
credentials, a network error, malformed JSON, a component outside the catalog — falls through to
the next client, and finally to the deterministic A2uiFallbackSurface, so
render_dashboard always returns something the browser can paint.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public A2uiComposer(A2uiSchemaSource schemaSource, List<A2uiModelClient> modelClients) | 初始化 `A2uiComposer` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String schemaSourceName() | 返回模式来源名称。 Returns the schema source name. |
public A2uiSurface compose(String intent, Map<String, Object> stateSnapshot, Set<String> clientComponents) | 执行 `compose` 方法。 Composes a surface for `intent`. |
构造器详情Constructor Detail
A2uiComposer
public A2uiComposer(A2uiSchemaSource schemaSource, List<A2uiModelClient> modelClients)
初始化 A2uiComposer 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
schemaSource | A2uiSchemaSource | 模式来源(类型 `A2uiSchemaSource`)。The schema source. |
modelClients | List<A2uiModelClient> | 模型客户端(类型 `List`)。The model clients. |
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiComposer.java:44–48方法详情Method Detail
schemaSourceName
public String schemaSourceName()
返回模式来源名称。
Returns the schema source name.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiComposer.java:50–52compose
public A2uiSurface compose(String intent, Map<String, Object> stateSnapshot, Set<String> clientComponents)
执行 compose 方法。
Composes a surface for intent.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
intent | String | intent(类型 `String`)。what the user asked to see |
stateSnapshot | Map<String, Object> | 状态快照(类型 `Map`)。the current workbench state, used both as model input and as the source of truth for the deterministic fallback |
clientComponents | Set<String> | 客户端 Components(类型 `Set`)。custom components the browser declared it can render; empty advertises the whole server-side catalog |
A2uiSurface返回A2uiSurface。Returns a 2 ui surface.
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiComposer.java:63–90