A2uiOperations
public final class A2uiOperations
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiOperations.java:31–194A 2 ui Operations,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.examples.copilotkit.a2ui 包。核心成员包括 createSurface、updateDataModel、updateComponents、component、countComponents、surfaceIdOf。
Builders and structural checks for A2UI v0.9 server-to-client messages.
The checks here are intentionally structural (surface consistency, a resolvable root,
known component names).
方法摘要Method Summary
方法详情Method Detail
createSurface
public static Map<String, Object> createSurface(String surfaceId)
static
创建 createSurface。
Creates the surface.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
surfaceId | String | surface 标识(类型 `String`)。The surface id. |
Map<String, Object>返回映射。Returns map.
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiOperations.java:35–40updateDataModel
public static Map<String, Object> updateDataModel(String surfaceId, Map<String, Object> value)
static
更新数据模型。
Updates the data model.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
surfaceId | String | surface 标识(类型 `String`)。The surface id. |
value | Map<String, Object> | 值(类型 `Map`)。The value. |
Map<String, Object>返回映射。Returns map.
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiOperations.java:42–48updateComponents
public static Map<String, Object> updateComponents(String surfaceId, List<Map<String, Object>> components)
static
更新 updateComponents。
Updates the components.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
surfaceId | String | surface 标识(类型 `String`)。The surface id. |
components | List<Map<String, Object>> | components(类型 `List >`)。The components. |
Map<String, Object>返回映射。Returns map.
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiOperations.java:50–56component
public static Map<String, Object> component(String id, String component, Map<String, Object> props)
static
执行 component 方法。
Performs the component operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
component | String | component(类型 `String`)。The component. |
props | Map<String, Object> | props(类型 `Map`)。The props. |
Map<String, Object>返回映射。Returns map.
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiOperations.java:58–70countComponents
public static int countComponents(List<Map<String, Object>> operations)
static
设置该参数。
Counts the components declared across every updateComponents message.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
operations | List<Map<String, Object>> | operations(类型 `List >`)。The operations. |
int返回数值结果。Returns a numeric result.
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiOperations.java:80–90surfaceIdOf
public static String surfaceIdOf(List<Map<String, Object>> operations)
static
设置该参数。
Returns the surface id referenced by the first operation that declares one.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
operations | List<Map<String, Object>> | operations(类型 `List >`)。The operations. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiOperations.java:93–103normalize
public static List<Map<String, Object>> normalize(List<?> rawOperations, String surfaceId)
static
执行 normalize 方法。
Normalises model output into a renderable operation list.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
rawOperations | List<?> | 原始 Operations(类型 `List`)。The raw operations. |
surfaceId | String | surface 标识(类型 `String`)。The surface id. |
List<Map<String, Object>>返回列出>。Returns list.
IllegalArgumentException可能抛出 `IllegalArgumentException`。when the payload cannot be repaired into a valid surface
源码Source
io/agentscope/examples/copilotkit/a2ui/A2uiOperations.java:113–153