Skip to content

Commit 24564e1

Browse files
Proposal for graph JSON (#16)
1 parent f55f374 commit 24564e1

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"nodes": [
3+
{
4+
"id": "a",
5+
"messages": [
6+
{
7+
"role": "user",
8+
"content": "get my todos"
9+
},
10+
{
11+
"role": "assistent",
12+
"content": "..."
13+
}
14+
],
15+
"definition": {
16+
"name": "todos",
17+
"contentType": "text/javascript",
18+
"signature": {
19+
"inputs": {},
20+
"output": {
21+
"$id": "https://common.tools/stream.schema.json",
22+
"type": {
23+
"$id": "https://common.tools/todos.json"
24+
}
25+
}
26+
},
27+
"body": "return system.get('todos')"
28+
}
29+
},
30+
{
31+
"id": "b",
32+
"messages": [
33+
{
34+
"role": "user",
35+
"content": "render todo"
36+
},
37+
{
38+
"role": "assistent",
39+
"content": "..."
40+
}
41+
],
42+
"definition": {
43+
"name": "ui",
44+
"contentType": "application/json+vnd.common.ui",
45+
"signature": {
46+
"inputs": {
47+
"todos": {
48+
"$id": "https://common.tools/stream.schema.json",
49+
"type": {
50+
"$id": "https://common.tools/todos.json"
51+
}
52+
}
53+
},
54+
"output": {
55+
"$id": "https://common.tools/ui.schema.json"
56+
}
57+
},
58+
"body": {
59+
"tag": "todos",
60+
"props": {
61+
"className": "todo"
62+
},
63+
"children": {
64+
"type": "repeat",
65+
"binding": "todos",
66+
"template": [
67+
{
68+
"tag": "todo",
69+
"props": {
70+
"todo": {
71+
"$id": "https://common.tools/cell.json",
72+
"type": "todo"
73+
}
74+
},
75+
"children": []
76+
}
77+
]
78+
}
79+
}
80+
}
81+
}
82+
],
83+
"edges": [
84+
{"todos": ["ui", "todos"]}
85+
],
86+
"order": [
87+
"a",
88+
"b"
89+
]
90+
}

0 commit comments

Comments
 (0)