AS AgentScopeAPI 手册 / API Reference

A2uiComposer

@Component public class A2uiComposer
源码Source io/agentscope/examples/copilotkit/a2ui/A2uiComposer.java:36–113

A 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
schemaSourceA2uiSchemaSource模式来源(类型 `A2uiSchemaSource`)。The schema source.
modelClientsList<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.

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

compose

public A2uiSurface compose(String intent, Map<String, Object> stateSnapshot, Set<String> clientComponents)

执行 compose 方法。

Composes a surface for intent.

参数Parameters
名称Name类型Type说明Description
intentStringintent(类型 `String`)。what the user asked to see
stateSnapshotMap<String, Object>状态快照(类型 `Map`)。the current workbench state, used both as model input and as the source of truth for the deterministic fallback
clientComponentsSet<String>客户端 Components(类型 `Set`)。custom components the browser declared it can render; empty advertises the whole server-side catalog
返回Returns A2uiSurface
返回A2uiSurface。Returns a 2 ui surface.
源码Source io/agentscope/examples/copilotkit/a2ui/A2uiComposer.java:63–90
基于官方固定版本源码静态生成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.