Skip to content

Commit a693e20

Browse files
committed
Change CallId to allow for more data.
The agent identifier and name of the function called are now optional; the callId itself is still required. This enables support for stateless backends, especially where there are multiple instances sharing a backing session store.
1 parent 77e631a commit a693e20

4 files changed

Lines changed: 37 additions & 22 deletions

File tree

specification/v0_10/json/common_types.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,23 @@
99
"description": "The unique identifier for a component, used for both definitions and references within the same surface."
1010
},
1111
"CallId": {
12-
"type": "string",
13-
"description": "The unique identifier for a server initiated function call."
12+
"type": "object",
13+
"description": "The unique identifier for a server initiated function call.",
14+
"properties": {
15+
"agentId": {
16+
"type": "string",
17+
"description": "Identifies the agent initiating the function call."
18+
},
19+
"call": {
20+
"type": "string",
21+
"description": "Name of the function call."
22+
},
23+
"callId": {
24+
"type": "string",
25+
"description": "Uniquely identifies this instance of the function call."
26+
}
27+
},
28+
"required": ["callId"]
1429
},
1530
"AccessibilityAttributes": {
1631
"type": "object",

specification/v0_10/test/cases/call_function_message.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"returnType": "void",
1616
"callableFrom": "clientOrRemote"
1717
},
18-
"functionCallId": "unique-call-id-123",
18+
"functionCallId": { "callId": "unique-call-id-123" },
1919
"wantResponse": true
2020
}
2121
},
@@ -29,7 +29,7 @@
2929
"returnType": "void",
3030
"callableFrom": "remoteOnly"
3131
},
32-
"functionCallId": "unique-call-id-123a",
32+
"functionCallId": { "callId": "unique-call-id-123a" },
3333
"wantResponse": false
3434
}
3535
},
@@ -46,7 +46,7 @@
4646
"returnType": "void",
4747
"callableFrom": "clientOrRemote"
4848
},
49-
"functionCallId": "unique-call-id-124"
49+
"functionCallId": { "callId": "unique-call-id-124" }
5050
}
5151
},
5252
{
@@ -67,7 +67,7 @@
6767
"valid": false,
6868
"data": {
6969
"version": "v0.10",
70-
"functionCallId": "unique-call-id-125"
70+
"functionCallId": { "callId": "unique-call-id-125" }
7171
}
7272
},
7373
{
@@ -81,7 +81,7 @@
8181
"returnType": "boolean",
8282
"callableFrom": "clientOnly"
8383
},
84-
"functionCallId": "unique-call-id-126"
84+
"functionCallId": { "callId": "unique-call-id-126" }
8585
}
8686
},
8787
{
@@ -94,7 +94,7 @@
9494
"args": { "value": "bar" },
9595
"returnType": "boolean"
9696
},
97-
"functionCallId": "unique-call-id-126b"
97+
"functionCallId": { "callId": "unique-call-id-126b" }
9898
}
9999
},
100100
{
@@ -110,7 +110,7 @@
110110
"returnType": "boolean",
111111
"callableFrom": "clientOrRemote"
112112
},
113-
"functionCallId": "unique-call-id-127"
113+
"functionCallId": { "callId": "unique-call-id-127" }
114114
}
115115
},
116116
{
@@ -126,7 +126,7 @@
126126
"returnType": "boolean",
127127
"callableFrom": "clientOrRemote"
128128
},
129-
"functionCallId": "unique-call-id-128"
129+
"functionCallId": { "callId": "unique-call-id-128" }
130130
}
131131
},
132132
{
@@ -140,7 +140,7 @@
140140
"returnType": "object",
141141
"callableFrom": "clientOrRemote"
142142
},
143-
"functionCallId": "unique-call-id-129"
143+
"functionCallId": { "callId": "unique-call-id-129" }
144144
}
145145
},
146146
{
@@ -156,7 +156,7 @@
156156
"returnType": "boolean",
157157
"callableFrom": "clientOrRemote"
158158
},
159-
"functionCallId": "id-3"
159+
"functionCallId": { "callId": "id-3" }
160160
}
161161
}
162162
]

specification/v0_10/test/cases/client_messages.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"version": "v0.10",
5151
"error": {
5252
"code": "FUNCTION_FAILED",
53-
"functionCallId": "unique-call-id-132",
53+
"functionCallId": { "callId": "unique-call-id-132" },
5454
"message": "Something went wrong"
5555
}
5656
}
@@ -62,7 +62,7 @@
6262
"version": "v0.10",
6363
"error": {
6464
"code": "FUNCTION_FAILED",
65-
"functionCallId": "unique-call-id-133",
65+
"functionCallId": { "callId": "unique-call-id-133" },
6666
"surfaceId": "main",
6767
"message": "Something went wrong"
6868
}

specification/v0_10/test/cases/function_response.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"data": {
88
"version": "v0.10",
99
"functionResponse": {
10-
"functionCallId": "unique-call-id-130",
10+
"functionCallId": { "callId": "unique-call-id-130" },
1111
"value": {
1212
"result": "success",
1313
"count": 42
@@ -33,7 +33,7 @@
3333
"data": {
3434
"version": "v0.10",
3535
"functionResponse": {
36-
"functionCallId": "unique-call-id-131a",
36+
"functionCallId": { "callId": "unique-call-id-131a" },
3737
"value": "success"
3838
}
3939
}
@@ -44,7 +44,7 @@
4444
"data": {
4545
"version": "v0.10",
4646
"functionResponse": {
47-
"functionCallId": "unique-call-id-131b",
47+
"functionCallId": { "callId": "unique-call-id-131b" },
4848
"value": 42
4949
}
5050
}
@@ -55,7 +55,7 @@
5555
"data": {
5656
"version": "v0.10",
5757
"functionResponse": {
58-
"functionCallId": "unique-call-id-131c",
58+
"functionCallId": { "callId": "unique-call-id-131c" },
5959
"value": true
6060
}
6161
}
@@ -66,7 +66,7 @@
6666
"data": {
6767
"version": "v0.10",
6868
"functionResponse": {
69-
"functionCallId": "unique-call-id-131d",
69+
"functionCallId": { "callId": "unique-call-id-131d" },
7070
"value": null
7171
}
7272
}
@@ -77,7 +77,7 @@
7777
"data": {
7878
"version": "v0.10",
7979
"functionResponse": {
80-
"functionCallId": "unique-call-id-131e",
80+
"functionCallId": { "callId": "unique-call-id-131e" },
8181
"value": [
8282
"one",
8383
2,
@@ -93,7 +93,7 @@
9393
"data": {
9494
"version": "v0.10",
9595
"functionResponse": {
96-
"functionCallId": "unique-call-id-131",
96+
"functionCallId": { "callId": "unique-call-id-131" },
9797
"value": {
9898
"result": { "nested": "object" }
9999
}
@@ -106,7 +106,7 @@
106106
"data": {
107107
"version": "v0.10",
108108
"functionResponse": {
109-
"functionCallId": "unique-call-id-131f",
109+
"functionCallId": { "callId": "unique-call-id-131f" },
110110
"value": [
111111
"one",
112112
{

0 commit comments

Comments
 (0)