Skip to content

Commit 4b5dabf

Browse files
authored
Worker schemas (1.0) (#5)
* Worker schemas (1.0) * Remove comments and rename to .json
1 parent 7468688 commit 4b5dabf

File tree

3 files changed

+433
-0
lines changed

3 files changed

+433
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"properties": {
5+
"$schema": {
6+
"type": "string",
7+
"format": "uri"
8+
},
9+
"run_id": {
10+
"type": "string",
11+
"description": "The globally-unique run ID provided by the Engine."
12+
},
13+
"execution_id": {
14+
"type": "string",
15+
"description": "The globally-unique ID for this tool execution in the run."
16+
},
17+
"created_at": {
18+
"type": "string",
19+
"format": "date-time"
20+
},
21+
"tool": {
22+
"type": "object",
23+
"properties": {
24+
"name": {
25+
"type": "string",
26+
"description": "Name of the tool to call (invoke)"
27+
},
28+
"toolkit": {
29+
"type": "string",
30+
"description": "Name of the toolkit containing the tool to call"
31+
},
32+
"version": {
33+
"type": "string",
34+
"description": "Version of the toolkit containing the tool to call"
35+
}
36+
},
37+
"required": ["name", "toolkit", "version"],
38+
"additionalProperties": false
39+
},
40+
"inputs": {
41+
"type": "object",
42+
"additionalProperties": true
43+
},
44+
"context": {
45+
"type": "object",
46+
"properties": {
47+
"authorization": {
48+
"type": "object",
49+
"properties": {
50+
"token": {
51+
"type": "string"
52+
},
53+
"additionalProperties": false
54+
}
55+
},
56+
"secrets": {
57+
"type": "object",
58+
"additionalProperties": true
59+
},
60+
"user_id": {
61+
"type": "string",
62+
"description": "A unique ID that identifies the user (if any)"
63+
},
64+
"user_info": {
65+
"type": "object",
66+
"description": "The user information provided by the authorization server (if any)"
67+
}
68+
}
69+
}
70+
},
71+
"required": ["run_id", "execution_id", "created_at", "tool", "inputs", "context"],
72+
"additionalProperties": false
73+
}
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"properties": {
5+
"$schema": {
6+
"type": "string",
7+
"format": "uri"
8+
},
9+
"execution_id": {
10+
"type": "string",
11+
"description": "The globally-unique ID for this tool execution."
12+
},
13+
"duration": {
14+
"type": "number",
15+
"description": "The duration of the tool call, in milliseconds"
16+
},
17+
"finished_at": {
18+
"type": "string",
19+
"format": "date-time",
20+
"description": "The timestamp when the tool execution finished."
21+
},
22+
"success": {
23+
"type": "boolean",
24+
"description": "Whether the tool execution was successful"
25+
},
26+
"output": {
27+
"type": "object",
28+
"oneOf": [
29+
{
30+
"properties": {
31+
"value": {
32+
"description": "The value returned from the function",
33+
"oneOf": [
34+
{ "type": "object", "additionalProperties": true },
35+
{ "type": "number" },
36+
{ "type": "string" },
37+
{ "type": "boolean" }
38+
]
39+
}
40+
},
41+
"required": ["value"],
42+
"additionalProperties": false
43+
},
44+
{
45+
"properties": {
46+
"error": {
47+
"type": "object",
48+
"properties": {
49+
"message": {
50+
"type": "string",
51+
"description": "An error message that can be shown to the user or the AI model"
52+
},
53+
"developer_message": {
54+
"type": "string",
55+
"description": "An internal message that will be logged but will not be shown to the user or the AI model"
56+
},
57+
"can_retry": {
58+
"type": "boolean",
59+
"description": "Whether the tool call can be retried",
60+
"default": false
61+
},
62+
"additional_prompt_content": {
63+
"type": "string",
64+
"description": "Additional content to be included in the retry prompt"
65+
},
66+
"retry_after_ms": {
67+
"type": "integer",
68+
"description": "The number of milliseconds (if any) to wait before retrying the tool call"
69+
}
70+
},
71+
"required": ["message"],
72+
"additionalProperties": false
73+
}
74+
},
75+
"required": ["error"],
76+
"additionalProperties": false
77+
},
78+
{
79+
"properties": {
80+
"requires_authorization": {
81+
"type": "object",
82+
"properties": {
83+
"id": {
84+
"type": "string",
85+
"description": "The ID for checking the status of the authorization"
86+
},
87+
"url": {
88+
"type": "string",
89+
"format": "uri",
90+
"description": "The URL to redirect the user to for authorization"
91+
},
92+
"scopes": {
93+
"type": "array",
94+
"items": {
95+
"type": "string"
96+
},
97+
"description": "The scopes that are required for authorization"
98+
},
99+
"status": {
100+
"type": "string",
101+
"description": "The status of the authorization"
102+
}
103+
},
104+
"required": ["id", "status"],
105+
"additionalProperties": false
106+
}
107+
},
108+
"required": ["requires_authorization"],
109+
"additionalProperties": false
110+
},
111+
{
112+
"properties": {
113+
"artifact": {
114+
"type": "object",
115+
"properties": {
116+
"url": {
117+
"type": "string",
118+
"format": "uri",
119+
"description": "The location of the stored artifact"
120+
},
121+
"content_type": {
122+
"type": "string",
123+
"description": "The MIME Media Type of the data inside the artifact (e.g. text/csv or application/json)"
124+
},
125+
"size": {
126+
"type": "integer",
127+
"description": "The size of the artifact, in bytes"
128+
},
129+
"meta": {
130+
"type": "object",
131+
"properties": {
132+
"description": {
133+
"type": "string",
134+
"description": "A descriptive, human-readable explanation of the data inside the artifact"
135+
}
136+
},
137+
"required": ["description"],
138+
"additionalProperties": false
139+
}
140+
},
141+
"required": ["url", "content_type", "size", "meta"],
142+
"additionalProperties": false
143+
}
144+
},
145+
"required": ["artifact"],
146+
"additionalProperties": false
147+
}
148+
]
149+
}
150+
},
151+
"required": ["invocation_id", "finished_at", "success"],
152+
"additionalProperties": false
153+
}

0 commit comments

Comments
 (0)