forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen-ui-declarative.json
More file actions
257 lines (257 loc) · 11.2 KB
/
Copy pathgen-ui-declarative.json
File metadata and controls
257 lines (257 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
{
"_meta": {
"description": "D6 fixtures for langgraph-python / gen-ui-declarative (A2UI Dynamic Schema)",
"_note": "Agent uses a two-stage A2UI pattern (src/agents/a2ui_dynamic.py): (1) outer agent has only one tool, `generate_a2ui` (no args). (2) `generate_a2ui` internally invokes a secondary LLM bound to `_design_a2ui_surface` with `tool_choice` forced; that secondary call has tools=[_design_a2ui_surface] and emits the A2UI components payload. (3) After the tool returns, the outer agent emits a one-sentence narration. Fixtures must therefore cover three LLM calls per pill: (a) outer turn 1 \u2192 emit generate_a2ui toolcall; (b) inner secondary call \u2192 emit _design_a2ui_surface toolcall with the flat catalog components; (c) outer turn 2 (post tool result) \u2192 narration. The inner secondary call is discriminated by `toolName: '_design_a2ui_surface'` because the user prompt is identical across both outer+inner calls in the same pill (the inner secondary LLM is invoked with the same conversation messages minus the last assistant message).",
"created": "2026-05-28"
},
"fixtures": [
{
"_comment": "pill 1 KPI \u2014 inner secondary LLM (tools=[_design_a2ui_surface], tool_choice forced) emits the flat A2UI components. Discriminated by toolName so it wins over the outer generate_a2ui fixture whose userMessage matches the same prompt.",
"match": {
"userMessage": "Show me a quick KPI dashboard",
"toolName": "_design_a2ui_surface"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_kpi_design_001",
"name": "_design_a2ui_surface",
"arguments": "{\"surfaceId\":\"kpi-dashboard\",\"catalogId\":\"declarative-gen-ui-catalog\",\"components\":[{\"id\":\"root\",\"component\":\"Card\",\"title\":\"KPI Dashboard\",\"subtitle\":\"Last 30 days\",\"child\":\"metrics-col\"},{\"id\":\"metrics-col\",\"component\":\"Column\",\"children\":[\"m-rev\",\"m-sign\",\"m-churn\",\"m-mrr\"],\"gap\":12},{\"id\":\"m-rev\",\"component\":\"Metric\",\"label\":\"Revenue\",\"value\":\"$1.2M\",\"trend\":\"up\"},{\"id\":\"m-sign\",\"component\":\"Metric\",\"label\":\"Signups\",\"value\":\"8,420\",\"trend\":\"up\"},{\"id\":\"m-churn\",\"component\":\"Metric\",\"label\":\"Churn\",\"value\":\"2.1%\",\"trend\":\"down\"},{\"id\":\"m-mrr\",\"component\":\"Metric\",\"label\":\"MRR\",\"value\":\"$98K\",\"trend\":\"up\"}]}"
}
]
},
"chunkSize": 9999
},
{
"_comment": "pill 1 KPI \u2014 outer agent narration after generate_a2ui returns.",
"match": {
"context": "langgraph-python",
"toolCallId": "call_d6_decl_kpi_outer_001"
},
"response": {
"content": "KPI dashboard rendered."
},
"chunkSize": 9999
},
{
"_comment": "pill 1 KPI \u2014 outer agent emits generate_a2ui (no args).",
"match": {
"userMessage": "Show me a quick KPI dashboard",
"context": "langgraph-python"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_kpi_outer_001",
"name": "generate_a2ui",
"arguments": "{}"
}
]
},
"chunkSize": 9999
},
{
"_comment": "pill 2 pie chart \u2014 inner secondary LLM emits PieChart catalog component.",
"match": {
"userMessage": "pie chart of sales by region",
"toolName": "_design_a2ui_surface"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_pie_design_001",
"name": "_design_a2ui_surface",
"arguments": "{\"surfaceId\":\"sales-pie\",\"catalogId\":\"declarative-gen-ui-catalog\",\"components\":[{\"id\":\"root\",\"component\":\"PieChart\",\"title\":\"Sales by Region\",\"data\":[{\"label\":\"North America\",\"value\":45},{\"label\":\"Europe\",\"value\":28},{\"label\":\"Asia-Pacific\",\"value\":18},{\"label\":\"Other\",\"value\":9}]}]}"
}
]
},
"chunkSize": 9999
},
{
"_comment": "pill 2 pie chart \u2014 outer agent narration.",
"match": {
"context": "langgraph-python",
"toolCallId": "call_d6_decl_pie_outer_001"
},
"response": {
"content": "Pie chart rendered."
},
"chunkSize": 9999
},
{
"_comment": "pill 2 pie chart \u2014 outer agent emits generate_a2ui.",
"match": {
"userMessage": "pie chart of sales by region",
"context": "langgraph-python"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_pie_outer_001",
"name": "generate_a2ui",
"arguments": "{}"
}
]
},
"chunkSize": 9999
},
{
"_comment": "pill 3 bar chart \u2014 inner secondary LLM emits BarChart catalog component.",
"match": {
"userMessage": "bar chart of quarterly revenue",
"toolName": "_design_a2ui_surface"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_bar_design_001",
"name": "_design_a2ui_surface",
"arguments": "{\"surfaceId\":\"quarterly-rev\",\"catalogId\":\"declarative-gen-ui-catalog\",\"components\":[{\"id\":\"root\",\"component\":\"BarChart\",\"title\":\"Quarterly Revenue\",\"data\":[{\"label\":\"Q1\",\"value\":280000},{\"label\":\"Q2\",\"value\":310000},{\"label\":\"Q3\",\"value\":295000},{\"label\":\"Q4\",\"value\":340000}]}]}"
}
]
},
"chunkSize": 9999
},
{
"_comment": "pill 3 bar chart \u2014 outer agent narration.",
"match": {
"context": "langgraph-python",
"toolCallId": "call_d6_decl_bar_outer_001"
},
"response": {
"content": "Bar chart rendered."
},
"chunkSize": 9999
},
{
"_comment": "pill 3 bar chart \u2014 outer agent emits generate_a2ui.",
"match": {
"userMessage": "bar chart of quarterly revenue",
"context": "langgraph-python"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_bar_outer_001",
"name": "generate_a2ui",
"arguments": "{}"
}
]
},
"chunkSize": 9999
},
{
"_comment": "pill 4 status report \u2014 inner secondary LLM emits StatusBadges grouped in a root Column.",
"match": {
"userMessage": "status report on system health",
"toolName": "_design_a2ui_surface"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_status_design_001",
"name": "_design_a2ui_surface",
"arguments": "{\"surfaceId\":\"sys-status\",\"catalogId\":\"declarative-gen-ui-catalog\",\"components\":[{\"id\":\"root\",\"component\":\"Card\",\"title\":\"System health\",\"subtitle\":\"All services\",\"child\":\"badges-col\"},{\"id\":\"badges-col\",\"component\":\"Column\",\"children\":[\"sb-api\",\"sb-db\",\"sb-bg\"],\"gap\":8},{\"id\":\"sb-api\",\"component\":\"StatusBadge\",\"text\":\"API: healthy (p99 42ms)\",\"variant\":\"success\"},{\"id\":\"sb-db\",\"component\":\"StatusBadge\",\"text\":\"Database: healthy (replication lag 0.2s)\",\"variant\":\"success\"},{\"id\":\"sb-bg\",\"component\":\"StatusBadge\",\"text\":\"Background Workers: degraded (queue depth 1247)\",\"variant\":\"warning\"}]}"
}
]
},
"chunkSize": 9999
},
{
"_comment": "pill 4 status report \u2014 outer agent narration.",
"match": {
"context": "langgraph-python",
"toolCallId": "call_d6_decl_status_outer_001"
},
"response": {
"content": "System health status rendered."
},
"chunkSize": 9999
},
{
"_comment": "pill 4 status report \u2014 outer agent emits generate_a2ui.",
"match": {
"userMessage": "status report on system health",
"context": "langgraph-python"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_status_outer_001",
"name": "generate_a2ui",
"arguments": "{}"
}
]
},
"chunkSize": 9999
},
{
"_comment": "pill 1 KPI \u2014 inner secondary LLM (tools=[_design_a2ui_surface], tool_choice forced) emits the flat A2UI components. Discriminated by toolName so it wins over the outer generate_a2ui fixture whose userMessage matches the same prompt. [render_a2ui mirror]",
"match": {
"userMessage": "Show me a quick KPI dashboard",
"toolName": "render_a2ui"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_kpi_design_001_render",
"name": "render_a2ui",
"arguments": "{\"surfaceId\":\"kpi-dashboard\",\"catalogId\":\"declarative-gen-ui-catalog\",\"components\":[{\"id\":\"root\",\"component\":\"Card\",\"title\":\"KPI Dashboard\",\"subtitle\":\"Last 30 days\",\"child\":\"metrics-col\"},{\"id\":\"metrics-col\",\"component\":\"Column\",\"children\":[\"m-rev\",\"m-sign\",\"m-churn\",\"m-mrr\"],\"gap\":12},{\"id\":\"m-rev\",\"component\":\"Metric\",\"label\":\"Revenue\",\"value\":\"$1.2M\",\"trend\":\"up\"},{\"id\":\"m-sign\",\"component\":\"Metric\",\"label\":\"Signups\",\"value\":\"8,420\",\"trend\":\"up\"},{\"id\":\"m-churn\",\"component\":\"Metric\",\"label\":\"Churn\",\"value\":\"2.1%\",\"trend\":\"down\"},{\"id\":\"m-mrr\",\"component\":\"Metric\",\"label\":\"MRR\",\"value\":\"$98K\",\"trend\":\"up\"}]}"
}
]
},
"chunkSize": 9999
},
{
"_comment": "pill 2 pie chart \u2014 inner secondary LLM emits PieChart catalog component. [render_a2ui mirror]",
"match": {
"userMessage": "pie chart of sales by region",
"toolName": "render_a2ui"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_pie_design_001_render",
"name": "render_a2ui",
"arguments": "{\"surfaceId\":\"sales-pie\",\"catalogId\":\"declarative-gen-ui-catalog\",\"components\":[{\"id\":\"root\",\"component\":\"PieChart\",\"title\":\"Sales by Region\",\"data\":[{\"label\":\"North America\",\"value\":45},{\"label\":\"Europe\",\"value\":28},{\"label\":\"Asia-Pacific\",\"value\":18},{\"label\":\"Other\",\"value\":9}]}]}"
}
]
},
"chunkSize": 9999
},
{
"_comment": "pill 3 bar chart \u2014 inner secondary LLM emits BarChart catalog component. [render_a2ui mirror]",
"match": {
"userMessage": "bar chart of quarterly revenue",
"toolName": "render_a2ui"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_bar_design_001_render",
"name": "render_a2ui",
"arguments": "{\"surfaceId\":\"quarterly-rev\",\"catalogId\":\"declarative-gen-ui-catalog\",\"components\":[{\"id\":\"root\",\"component\":\"BarChart\",\"title\":\"Quarterly Revenue\",\"data\":[{\"label\":\"Q1\",\"value\":280000},{\"label\":\"Q2\",\"value\":310000},{\"label\":\"Q3\",\"value\":295000},{\"label\":\"Q4\",\"value\":340000}]}]}"
}
]
},
"chunkSize": 9999
},
{
"_comment": "pill 4 status report \u2014 inner secondary LLM emits StatusBadges grouped in a root Column. [render_a2ui mirror]",
"match": {
"userMessage": "status report on system health",
"toolName": "render_a2ui"
},
"response": {
"toolCalls": [
{
"id": "call_d6_decl_status_design_001_render",
"name": "render_a2ui",
"arguments": "{\"surfaceId\":\"sys-status\",\"catalogId\":\"declarative-gen-ui-catalog\",\"components\":[{\"id\":\"root\",\"component\":\"Card\",\"title\":\"System health\",\"subtitle\":\"All services\",\"child\":\"badges-col\"},{\"id\":\"badges-col\",\"component\":\"Column\",\"children\":[\"sb-api\",\"sb-db\",\"sb-bg\"],\"gap\":8},{\"id\":\"sb-api\",\"component\":\"StatusBadge\",\"text\":\"API: healthy (p99 42ms)\",\"variant\":\"success\"},{\"id\":\"sb-db\",\"component\":\"StatusBadge\",\"text\":\"Database: healthy (replication lag 0.2s)\",\"variant\":\"success\"},{\"id\":\"sb-bg\",\"component\":\"StatusBadge\",\"text\":\"Background Workers: degraded (queue depth 1247)\",\"variant\":\"warning\"}]}"
}
]
},
"chunkSize": 9999
}
]
}