Spaces:
Running
Running
Samuele Marro
commited on
Commit
•
19bcd88
1
Parent(s):
c07f594
Added schemas.json.
Browse files- app.py +4 -128
- schemas.json +643 -0
app.py
CHANGED
@@ -6,134 +6,10 @@ from collections import UserList
|
|
6 |
|
7 |
from flow import full_flow
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
"location": {
|
14 |
-
"type": "string",
|
15 |
-
"description": "The name of the location for which the weather forecast is requested."
|
16 |
-
},
|
17 |
-
"date": {
|
18 |
-
"type": "string",
|
19 |
-
"format": "date",
|
20 |
-
"description": "The date for which the weather forecast is requested, in YYYY-MM-DD format."
|
21 |
-
}
|
22 |
-
},
|
23 |
-
"required": [
|
24 |
-
"location",
|
25 |
-
"date"
|
26 |
-
]
|
27 |
-
},
|
28 |
-
"output": {
|
29 |
-
"type": "object",
|
30 |
-
"properties": {
|
31 |
-
"temperature": {
|
32 |
-
"type": "number",
|
33 |
-
"description": "The forecasted temperature in degrees Celsius."
|
34 |
-
},
|
35 |
-
"condition": {
|
36 |
-
"type": "string",
|
37 |
-
"description": "A brief description of the weather condition (e.g., sunny, cloudy, rainy)."
|
38 |
-
},
|
39 |
-
"humidity": {
|
40 |
-
"type": "number",
|
41 |
-
"description": "The forecasted humidity percentage."
|
42 |
-
},
|
43 |
-
"wind_speed": {
|
44 |
-
"type": "number",
|
45 |
-
"description": "The forecasted wind speed in kilometers per hour."
|
46 |
-
}
|
47 |
-
},
|
48 |
-
"required": [
|
49 |
-
"temperature",
|
50 |
-
"condition",
|
51 |
-
"humidity",
|
52 |
-
"wind_speed"
|
53 |
-
]
|
54 |
-
},
|
55 |
-
"description": "Alice requests a weather forecast for a specific location and date from Bob's weather service.",
|
56 |
-
"examples": [
|
57 |
-
{
|
58 |
-
"location": "New York",
|
59 |
-
"date": "2023-10-15"
|
60 |
-
},
|
61 |
-
{
|
62 |
-
"location": "London",
|
63 |
-
"date": "2023-11-01"
|
64 |
-
}
|
65 |
-
],
|
66 |
-
"tools": [
|
67 |
-
{
|
68 |
-
"name": "WeatherForecastAPI",
|
69 |
-
"description": "An API that provides weather forecasts for a given location and date.",
|
70 |
-
"input": {
|
71 |
-
"type": "object",
|
72 |
-
"properties": {
|
73 |
-
"location": {
|
74 |
-
"type": "string",
|
75 |
-
"description": "The name of the location for which the weather forecast is requested."
|
76 |
-
},
|
77 |
-
"date": {
|
78 |
-
"type": "string",
|
79 |
-
"format": "date",
|
80 |
-
"description": "The date for which the weather forecast is requested, in YYYY-MM-DD format."
|
81 |
-
}
|
82 |
-
},
|
83 |
-
"required": [
|
84 |
-
"location",
|
85 |
-
"date"
|
86 |
-
]
|
87 |
-
},
|
88 |
-
"output": {
|
89 |
-
"type": "object",
|
90 |
-
"properties": {
|
91 |
-
"temperature": {
|
92 |
-
"type": "number",
|
93 |
-
"description": "The forecasted temperature in degrees Celsius."
|
94 |
-
},
|
95 |
-
"condition": {
|
96 |
-
"type": "string",
|
97 |
-
"description": "A brief description of the weather condition (e.g., sunny, cloudy, rainy)."
|
98 |
-
},
|
99 |
-
"humidity": {
|
100 |
-
"type": "number",
|
101 |
-
"description": "The forecasted humidity percentage."
|
102 |
-
},
|
103 |
-
"wind_speed": {
|
104 |
-
"type": "number",
|
105 |
-
"description": "The forecasted wind speed in kilometers per hour."
|
106 |
-
}
|
107 |
-
},
|
108 |
-
"required": [
|
109 |
-
"temperature",
|
110 |
-
"condition",
|
111 |
-
"humidity",
|
112 |
-
"wind_speed"
|
113 |
-
]
|
114 |
-
},
|
115 |
-
"dummy_outputs": [
|
116 |
-
{
|
117 |
-
"temperature": 18,
|
118 |
-
"condition": "Sunny",
|
119 |
-
"humidity": 55,
|
120 |
-
"wind_speed": 10
|
121 |
-
},
|
122 |
-
{
|
123 |
-
"temperature": 12,
|
124 |
-
"condition": "Cloudy",
|
125 |
-
"humidity": 80,
|
126 |
-
"wind_speed": 15
|
127 |
-
}
|
128 |
-
]
|
129 |
-
}
|
130 |
-
]
|
131 |
-
}
|
132 |
-
|
133 |
-
SCHEMAS = {
|
134 |
-
"weather_forecast": schema,
|
135 |
-
"other": { "input": "PIPPO"}
|
136 |
-
}
|
137 |
|
138 |
def parse_raw_messages(messages_raw):
|
139 |
messages_clean = []
|
|
|
6 |
|
7 |
from flow import full_flow
|
8 |
|
9 |
+
from utils import use_cost_tracker, get_costs, compute_hash
|
10 |
+
|
11 |
+
with open('schemas.json', 'r') as f:
|
12 |
+
SCHEMAS = json.load(f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
def parse_raw_messages(messages_raw):
|
15 |
messages_clean = []
|
schemas.json
ADDED
@@ -0,0 +1,643 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"weather_forecast": {
|
3 |
+
"display_name": "API Automation - Weather Forecast",
|
4 |
+
"description": "Agora enables two machines that do not support the same API to communicate with each other. In this example, Alice requests a weather forecast for a specific location and date from Bob's weather service.",
|
5 |
+
"schema": {
|
6 |
+
"input": {
|
7 |
+
"type": "object",
|
8 |
+
"properties": {
|
9 |
+
"location": {
|
10 |
+
"type": "string",
|
11 |
+
"description": "The name of the location for which the weather forecast is requested."
|
12 |
+
},
|
13 |
+
"date": {
|
14 |
+
"type": "string",
|
15 |
+
"format": "date",
|
16 |
+
"description": "The date for which the weather forecast is requested, in YYYY-MM-DD format."
|
17 |
+
}
|
18 |
+
},
|
19 |
+
"required": [
|
20 |
+
"location",
|
21 |
+
"date"
|
22 |
+
]
|
23 |
+
},
|
24 |
+
"output": {
|
25 |
+
"type": "object",
|
26 |
+
"properties": {
|
27 |
+
"temperature": {
|
28 |
+
"type": "number",
|
29 |
+
"description": "The forecasted temperature in degrees Celsius."
|
30 |
+
},
|
31 |
+
"condition": {
|
32 |
+
"type": "string",
|
33 |
+
"description": "A brief description of the weather condition (e.g., sunny, cloudy, rainy)."
|
34 |
+
},
|
35 |
+
"humidity": {
|
36 |
+
"type": "number",
|
37 |
+
"description": "The forecasted humidity percentage."
|
38 |
+
},
|
39 |
+
"wind_speed": {
|
40 |
+
"type": "number",
|
41 |
+
"description": "The forecasted wind speed in kilometers per hour."
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"required": [
|
45 |
+
"temperature",
|
46 |
+
"condition",
|
47 |
+
"humidity",
|
48 |
+
"wind_speed"
|
49 |
+
]
|
50 |
+
},
|
51 |
+
"description": "Alice requests a weather forecast for a specific location and date from Bob's weather service.",
|
52 |
+
"examples": [
|
53 |
+
{
|
54 |
+
"location": "New York",
|
55 |
+
"date": "2023-10-15"
|
56 |
+
},
|
57 |
+
{
|
58 |
+
"location": "London",
|
59 |
+
"date": "2023-11-01"
|
60 |
+
}
|
61 |
+
],
|
62 |
+
"tools": [
|
63 |
+
{
|
64 |
+
"name": "WeatherForecastAPI",
|
65 |
+
"description": "An API that provides weather forecasts for a given location and date.",
|
66 |
+
"input": {
|
67 |
+
"type": "object",
|
68 |
+
"properties": {
|
69 |
+
"location": {
|
70 |
+
"type": "string",
|
71 |
+
"description": "The name of the location for which the weather forecast is requested."
|
72 |
+
},
|
73 |
+
"date": {
|
74 |
+
"type": "string",
|
75 |
+
"format": "date",
|
76 |
+
"description": "The date for which the weather forecast is requested, in YYYY-MM-DD format."
|
77 |
+
}
|
78 |
+
},
|
79 |
+
"required": [
|
80 |
+
"location",
|
81 |
+
"date"
|
82 |
+
]
|
83 |
+
},
|
84 |
+
"output": {
|
85 |
+
"type": "object",
|
86 |
+
"properties": {
|
87 |
+
"temperature": {
|
88 |
+
"type": "number",
|
89 |
+
"description": "The forecasted temperature in degrees Celsius."
|
90 |
+
},
|
91 |
+
"condition": {
|
92 |
+
"type": "string",
|
93 |
+
"description": "A brief description of the weather condition (e.g., sunny, cloudy, rainy)."
|
94 |
+
},
|
95 |
+
"humidity": {
|
96 |
+
"type": "number",
|
97 |
+
"description": "The forecasted humidity percentage."
|
98 |
+
},
|
99 |
+
"wind_speed": {
|
100 |
+
"type": "number",
|
101 |
+
"description": "The forecasted wind speed in kilometers per hour."
|
102 |
+
}
|
103 |
+
},
|
104 |
+
"required": [
|
105 |
+
"temperature",
|
106 |
+
"condition",
|
107 |
+
"humidity",
|
108 |
+
"wind_speed"
|
109 |
+
]
|
110 |
+
},
|
111 |
+
"dummy_outputs": [
|
112 |
+
{
|
113 |
+
"temperature": 18,
|
114 |
+
"condition": "Sunny",
|
115 |
+
"humidity": 55,
|
116 |
+
"wind_speed": 10
|
117 |
+
},
|
118 |
+
{
|
119 |
+
"temperature": 12,
|
120 |
+
"condition": "Cloudy",
|
121 |
+
"humidity": 80,
|
122 |
+
"wind_speed": 15
|
123 |
+
}
|
124 |
+
]
|
125 |
+
}
|
126 |
+
]
|
127 |
+
}
|
128 |
+
},
|
129 |
+
"restaurant": {
|
130 |
+
"display_name": "Personal Assistant - Restaurant Booking",
|
131 |
+
"description": "Agora can be used for personal assistant tasks: any Agora-powered agent can communicate with any Agora-powered agent, even if they have very different internal schemas. In this example, Alice requests a table reservation at a restaurant for a specific date, time, and party size from Bob's restaurant.",
|
132 |
+
"schema": {
|
133 |
+
"input": {
|
134 |
+
"type": "object",
|
135 |
+
"properties": {
|
136 |
+
"restaurant": {
|
137 |
+
"type": "string",
|
138 |
+
"description": "The name of the restaurant for the reservation."
|
139 |
+
},
|
140 |
+
"booking_date": {
|
141 |
+
"type": "string",
|
142 |
+
"format": "date",
|
143 |
+
"description": "The date of the reservation in YYYY-MM-DD format."
|
144 |
+
},
|
145 |
+
"party_size": {
|
146 |
+
"type": "number",
|
147 |
+
"description": "The number of guests for the table booking."
|
148 |
+
},
|
149 |
+
"booking_time": {
|
150 |
+
"type": "string",
|
151 |
+
"format": "time",
|
152 |
+
"description": "The desired reservation time in HH:MM format (24-hour time)."
|
153 |
+
}
|
154 |
+
},
|
155 |
+
"required": [
|
156 |
+
"restaurant",
|
157 |
+
"booking_date",
|
158 |
+
"party_size",
|
159 |
+
"booking_time"
|
160 |
+
]
|
161 |
+
},
|
162 |
+
"output": {
|
163 |
+
"type": "object",
|
164 |
+
"properties": {
|
165 |
+
"reservation_id": {
|
166 |
+
"type": "string",
|
167 |
+
"description": "The confirmation number for the reservation."
|
168 |
+
},
|
169 |
+
"reservation_status": {
|
170 |
+
"type": "string",
|
171 |
+
"description": "The reservation status (e.g., confirmed, pending, or declined)."
|
172 |
+
}
|
173 |
+
},
|
174 |
+
"required": [
|
175 |
+
"reservation_id",
|
176 |
+
"reservation_status"
|
177 |
+
]
|
178 |
+
},
|
179 |
+
"description": "Alice requests a table reservation at a restaurant for a specific date, time, and party size from Bob's booking service.",
|
180 |
+
"examples": [
|
181 |
+
{
|
182 |
+
"restaurant": "The Green Olive",
|
183 |
+
"booking_date": "2023-12-15",
|
184 |
+
"booking_time": "19:00",
|
185 |
+
"party_size": 4
|
186 |
+
},
|
187 |
+
{
|
188 |
+
"restaurant": "Ocean's Delight",
|
189 |
+
"booking_date": "2023-12-20",
|
190 |
+
"booking_time": "18:30",
|
191 |
+
"party_size": 2
|
192 |
+
}
|
193 |
+
],
|
194 |
+
"tools": [
|
195 |
+
{
|
196 |
+
"name": "TableReservationAPI",
|
197 |
+
"description": "An API that facilitates restaurant table reservations based on requested details.",
|
198 |
+
"input": {
|
199 |
+
"type": "object",
|
200 |
+
"properties": {
|
201 |
+
"venue_name": {
|
202 |
+
"type": "string",
|
203 |
+
"description": "The restaurant name."
|
204 |
+
},
|
205 |
+
"date": {
|
206 |
+
"type": "string",
|
207 |
+
"format": "date",
|
208 |
+
"description": "The reservation date, formatted as YYYY-MM-DD."
|
209 |
+
},
|
210 |
+
"time": {
|
211 |
+
"type": "string",
|
212 |
+
"format": "time",
|
213 |
+
"description": "The time for the reservation, formatted as HH:MM (24-hour time)."
|
214 |
+
},
|
215 |
+
"guest_count": {
|
216 |
+
"type": "number",
|
217 |
+
"description": "The number of guests for the reservation."
|
218 |
+
}
|
219 |
+
},
|
220 |
+
"required": [
|
221 |
+
"venue_name",
|
222 |
+
"date",
|
223 |
+
"time",
|
224 |
+
"guest_count"
|
225 |
+
]
|
226 |
+
},
|
227 |
+
"output": {
|
228 |
+
"type": "object",
|
229 |
+
"properties": {
|
230 |
+
"confirmation_code": {
|
231 |
+
"type": "string",
|
232 |
+
"description": "The unique confirmation number for the booking."
|
233 |
+
},
|
234 |
+
"status": {
|
235 |
+
"type": "string",
|
236 |
+
"description": "The reservation outcome (e.g., confirmed, pending, declined)."
|
237 |
+
}
|
238 |
+
},
|
239 |
+
"required": [
|
240 |
+
"confirmation_code",
|
241 |
+
"status"
|
242 |
+
]
|
243 |
+
},
|
244 |
+
"dummy_outputs": [
|
245 |
+
{
|
246 |
+
"confirmation_code": "ABC12345",
|
247 |
+
"status": "confirmed"
|
248 |
+
},
|
249 |
+
{
|
250 |
+
"confirmation_code": "XYZ67890",
|
251 |
+
"status": "pending"
|
252 |
+
}
|
253 |
+
]
|
254 |
+
}
|
255 |
+
]
|
256 |
+
}
|
257 |
+
},
|
258 |
+
"customer_service": {
|
259 |
+
"display_name": "Business Integration - Customer Service Tickets",
|
260 |
+
"description": "Agora can be used to integrate different systems within a business. In this example, Alice is a customer service frontend that communicates with an in-house ticket tracking system.",
|
261 |
+
"schema": {
|
262 |
+
"input": {
|
263 |
+
"type": "object",
|
264 |
+
"properties": {
|
265 |
+
"external_ticket_id": {
|
266 |
+
"type": "string",
|
267 |
+
"description": "The unique identifier for the customer service ticket in the external system."
|
268 |
+
},
|
269 |
+
"summary": {
|
270 |
+
"type": "string",
|
271 |
+
"description": "A brief summary of the issue reported in the ticket."
|
272 |
+
},
|
273 |
+
"description": {
|
274 |
+
"type": "string",
|
275 |
+
"description": "A detailed description of the issue provided by the customer."
|
276 |
+
},
|
277 |
+
"priority": {
|
278 |
+
"type": "string",
|
279 |
+
"description": "The priority level of the ticket (e.g., low, medium, high, urgent)."
|
280 |
+
},
|
281 |
+
"created_date": {
|
282 |
+
"type": "string",
|
283 |
+
"format": "date-time",
|
284 |
+
"description": "The timestamp when the ticket was created in the external system."
|
285 |
+
}
|
286 |
+
},
|
287 |
+
"required": [
|
288 |
+
"external_ticket_id",
|
289 |
+
"summary",
|
290 |
+
"description",
|
291 |
+
"priority",
|
292 |
+
"created_date"
|
293 |
+
]
|
294 |
+
},
|
295 |
+
"output": {
|
296 |
+
"type": "object",
|
297 |
+
"properties": {
|
298 |
+
"internal_ticket_id": {
|
299 |
+
"type": "string",
|
300 |
+
"description": "The unique identifier for the ticket created in the in-house tracking system."
|
301 |
+
},
|
302 |
+
"status": {
|
303 |
+
"type": "string",
|
304 |
+
"description": "The current status of the integration task (e.g., success, failed)."
|
305 |
+
}
|
306 |
+
},
|
307 |
+
"required": [
|
308 |
+
"internal_ticket_id",
|
309 |
+
"status"
|
310 |
+
]
|
311 |
+
},
|
312 |
+
"description": "Integrate a customer service ticket from an external system into an in-house ticket tracking database.",
|
313 |
+
"examples": [
|
314 |
+
{
|
315 |
+
"external_ticket_id": "EXT123456",
|
316 |
+
"summary": "User unable to access account",
|
317 |
+
"description": "Customer reports being locked out of their account after password reset.",
|
318 |
+
"priority": "high",
|
319 |
+
"created_date": "2023-11-10T15:45:00Z"
|
320 |
+
},
|
321 |
+
{
|
322 |
+
"external_ticket_id": "EXT654321",
|
323 |
+
"summary": "Error on checkout page",
|
324 |
+
"description": "Customer encounters an error when attempting to finalize purchase.",
|
325 |
+
"priority": "urgent",
|
326 |
+
"created_date": "2023-11-11T09:30:00Z"
|
327 |
+
}
|
328 |
+
],
|
329 |
+
"tools": [
|
330 |
+
{
|
331 |
+
"name": "TicketIntegrationAPI",
|
332 |
+
"description": "An API for creating tickets in an in-house tracking system based on external ticket data.",
|
333 |
+
"input": {
|
334 |
+
"type": "object",
|
335 |
+
"properties": {
|
336 |
+
"source_ticket_id": {
|
337 |
+
"type": "string",
|
338 |
+
"description": "The ID of the ticket in the external system."
|
339 |
+
},
|
340 |
+
"title": {
|
341 |
+
"type": "string",
|
342 |
+
"description": "A concise title summarizing the ticket issue."
|
343 |
+
},
|
344 |
+
"details": {
|
345 |
+
"type": "string",
|
346 |
+
"description": "Detailed information regarding the ticket issue."
|
347 |
+
},
|
348 |
+
"urgency": {
|
349 |
+
"type": "string",
|
350 |
+
"description": "The urgency level of the ticket (e.g., low, medium, high, urgent)."
|
351 |
+
},
|
352 |
+
"opened_at": {
|
353 |
+
"type": "string",
|
354 |
+
"format": "date-time",
|
355 |
+
"description": "Timestamp indicating when the ticket was opened in the external system."
|
356 |
+
}
|
357 |
+
},
|
358 |
+
"required": [
|
359 |
+
"source_ticket_id",
|
360 |
+
"title",
|
361 |
+
"details",
|
362 |
+
"urgency",
|
363 |
+
"opened_at"
|
364 |
+
]
|
365 |
+
},
|
366 |
+
"output": {
|
367 |
+
"type": "object",
|
368 |
+
"properties": {
|
369 |
+
"inhouse_ticket_id": {
|
370 |
+
"type": "string",
|
371 |
+
"description": "The ID of the created ticket in the in-house system."
|
372 |
+
},
|
373 |
+
"integration_status": {
|
374 |
+
"type": "string",
|
375 |
+
"description": "The outcome of the integration attempt (e.g., success, failure, duplicate)."
|
376 |
+
}
|
377 |
+
},
|
378 |
+
"required": [
|
379 |
+
"inhouse_ticket_id",
|
380 |
+
"integration_status"
|
381 |
+
]
|
382 |
+
},
|
383 |
+
"dummy_outputs": [
|
384 |
+
{
|
385 |
+
"inhouse_ticket_id": "IN123456",
|
386 |
+
"integration_status": "success"
|
387 |
+
},
|
388 |
+
{
|
389 |
+
"inhouse_ticket_id": "IN654321",
|
390 |
+
"integration_status": "duplicate"
|
391 |
+
}
|
392 |
+
]
|
393 |
+
}
|
394 |
+
]
|
395 |
+
}
|
396 |
+
},
|
397 |
+
"smart_home": {
|
398 |
+
"display_name": "Smart Homes - Thermostat Control",
|
399 |
+
"description": "Agora can be used to automate tasks in smart homes, even if the devices are not natively compatible. In this example, Alice is a thermostat that communicates with an air conditioner unit to maintain a specified temperature range.",
|
400 |
+
"schema": {
|
401 |
+
"input": {
|
402 |
+
"type": "object",
|
403 |
+
"properties": {
|
404 |
+
"ac_unit_id": {
|
405 |
+
"type": "string",
|
406 |
+
"description": "The unique identifier for the air conditioner unit that will receive commands from the thermostat."
|
407 |
+
},
|
408 |
+
"target_temperature": {
|
409 |
+
"type": "number",
|
410 |
+
"description": "The desired room temperature to be maintained in degrees Celsius."
|
411 |
+
},
|
412 |
+
"temperature_min": {
|
413 |
+
"type": "number",
|
414 |
+
"description": "The minimum allowable room temperature (in \u00b0C) before activating cooling."
|
415 |
+
},
|
416 |
+
"temperature_max": {
|
417 |
+
"type": "number",
|
418 |
+
"description": "The maximum allowable room temperature (in \u00b0C) before activating cooling."
|
419 |
+
},
|
420 |
+
"monitor_interval": {
|
421 |
+
"type": "number",
|
422 |
+
"description": "The frequency in seconds at which the thermostat checks the current room temperature."
|
423 |
+
}
|
424 |
+
},
|
425 |
+
"required": [
|
426 |
+
"ac_unit_id",
|
427 |
+
"target_temperature",
|
428 |
+
"temperature_range",
|
429 |
+
"monitor_interval",
|
430 |
+
"temperature_min",
|
431 |
+
"temperature_max"
|
432 |
+
]
|
433 |
+
},
|
434 |
+
"output": {
|
435 |
+
"type": "object",
|
436 |
+
"properties": {
|
437 |
+
"task_id": {
|
438 |
+
"type": "string",
|
439 |
+
"description": "The unique identifier for this monitoring and control task."
|
440 |
+
},
|
441 |
+
"communication_status": {
|
442 |
+
"type": "string",
|
443 |
+
"description": "The status of the communication with the AC unit (e.g., active, error, completed)."
|
444 |
+
}
|
445 |
+
},
|
446 |
+
"required": [
|
447 |
+
"task_id",
|
448 |
+
"communication_status"
|
449 |
+
]
|
450 |
+
},
|
451 |
+
"description": "Thermostat monitors room temperature and communicates with the AC unit to maintain a specified temperature range.",
|
452 |
+
"examples": [
|
453 |
+
{
|
454 |
+
"ac_unit_id": "ac456",
|
455 |
+
"target_temperature": 22,
|
456 |
+
"temperature_min": 21,
|
457 |
+
"temperature_max": 23,
|
458 |
+
"monitor_interval": 60
|
459 |
+
},
|
460 |
+
{
|
461 |
+
"ac_unit_id": "ac101",
|
462 |
+
"target_temperature": 20,
|
463 |
+
"temperature_min": 19,
|
464 |
+
"temperature_max": 21,
|
465 |
+
"monitor_interval": 120
|
466 |
+
}
|
467 |
+
],
|
468 |
+
"tools": [
|
469 |
+
{
|
470 |
+
"name": "ACControlAPI",
|
471 |
+
"description": "An API used by the thermostat to send commands to the air conditioner to adjust its settings based on the current room temperature.",
|
472 |
+
"input": {
|
473 |
+
"type": "object",
|
474 |
+
"properties": {
|
475 |
+
"device_id": {
|
476 |
+
"type": "string",
|
477 |
+
"description": "The ID of the air conditioner receiving temperature control commands."
|
478 |
+
},
|
479 |
+
"temperature_setting": {
|
480 |
+
"type": "number",
|
481 |
+
"description": "The target temperature the AC should aim to achieve."
|
482 |
+
},
|
483 |
+
"temp_range_min": {
|
484 |
+
"type": "number",
|
485 |
+
"description": "The minimum allowable room temperature (in \u00b0C) before activating cooling."
|
486 |
+
},
|
487 |
+
"temp_range_max": {
|
488 |
+
"type": "number",
|
489 |
+
"description": "The maximum allowable room temperature (in \u00b0C) before activating cooling."
|
490 |
+
}
|
491 |
+
},
|
492 |
+
"required": [
|
493 |
+
"device_id",
|
494 |
+
"temperature_setting",
|
495 |
+
"temp_range_min",
|
496 |
+
"temp_range_max"
|
497 |
+
]
|
498 |
+
},
|
499 |
+
"output": {
|
500 |
+
"type": "object",
|
501 |
+
"properties": {
|
502 |
+
"control_task_id": {
|
503 |
+
"type": "string",
|
504 |
+
"description": "The unique identifier for the temperature control task."
|
505 |
+
},
|
506 |
+
"status": {
|
507 |
+
"type": "string",
|
508 |
+
"description": "The result of the control task setup (e.g., active, failed, adjusting)."
|
509 |
+
}
|
510 |
+
},
|
511 |
+
"required": [
|
512 |
+
"control_task_id",
|
513 |
+
"status"
|
514 |
+
]
|
515 |
+
},
|
516 |
+
"dummy_outputs": [
|
517 |
+
{
|
518 |
+
"control_task_id": "CTRL001",
|
519 |
+
"status": "active"
|
520 |
+
},
|
521 |
+
{
|
522 |
+
"control_task_id": "CTRL002",
|
523 |
+
"status": "failed"
|
524 |
+
}
|
525 |
+
]
|
526 |
+
}
|
527 |
+
]
|
528 |
+
}
|
529 |
+
},
|
530 |
+
"supply_chain": {
|
531 |
+
"display_name": "Supply Chain Management - Inventory Alerts",
|
532 |
+
"description": "Agora can be used to manage supply chain systems across different vendors. In this example, Alice is an inventory management system that communicates with an off-site storage facility to set a restocking order.",
|
533 |
+
"schema": {
|
534 |
+
"input": {
|
535 |
+
"type": "object",
|
536 |
+
"properties": {
|
537 |
+
"item_id": {
|
538 |
+
"type": "string",
|
539 |
+
"description": "The unique identifier for the item in the inventory."
|
540 |
+
},
|
541 |
+
"low_stock_threshold": {
|
542 |
+
"type": "number",
|
543 |
+
"description": "The minimum quantity threshold for this item before a low stock alert is triggered."
|
544 |
+
},
|
545 |
+
"restock_quantity": {
|
546 |
+
"type": "number",
|
547 |
+
"description": "The recommended quantity of the item to reorder when stock is low."
|
548 |
+
}
|
549 |
+
},
|
550 |
+
"required": [
|
551 |
+
"item_id",
|
552 |
+
"low_stock_threshold",
|
553 |
+
"restock_quantity"
|
554 |
+
]
|
555 |
+
},
|
556 |
+
"output": {
|
557 |
+
"type": "object",
|
558 |
+
"properties": {
|
559 |
+
"alert_status": {
|
560 |
+
"type": "string",
|
561 |
+
"description": "The status of the stock level for this item based on its low stock threshold (e.g., 'sufficient', 'low')."
|
562 |
+
},
|
563 |
+
"recommended_action": {
|
564 |
+
"type": "string",
|
565 |
+
"description": "The suggested action based on stock levels, such as 'order more' or 'monitor'."
|
566 |
+
}
|
567 |
+
},
|
568 |
+
"required": [
|
569 |
+
"alert_status",
|
570 |
+
"recommended_action"
|
571 |
+
]
|
572 |
+
},
|
573 |
+
"description": "Manages the low stock threshold and restock quantities for items in the storage facility, allowing updates to thresholds and reorder recommendations.",
|
574 |
+
"examples": [
|
575 |
+
{
|
576 |
+
"item_id": "item123",
|
577 |
+
"low_stock_threshold": 20,
|
578 |
+
"restock_quantity": 50
|
579 |
+
},
|
580 |
+
{
|
581 |
+
"item_id": "item456",
|
582 |
+
"low_stock_threshold": 10,
|
583 |
+
"restock_quantity": 30
|
584 |
+
}
|
585 |
+
],
|
586 |
+
"tools": [
|
587 |
+
{
|
588 |
+
"name": "InventoryThresholdAPI",
|
589 |
+
"description": "An API that updates the low stock threshold and restock quantity for an item in the inventory system.",
|
590 |
+
"input": {
|
591 |
+
"type": "object",
|
592 |
+
"properties": {
|
593 |
+
"item_code": {
|
594 |
+
"type": "string",
|
595 |
+
"description": "The unique identifier for the item to update."
|
596 |
+
},
|
597 |
+
"low_stock_level": {
|
598 |
+
"type": "number",
|
599 |
+
"description": "The updated threshold below which an item is considered low stock."
|
600 |
+
},
|
601 |
+
"restock_level": {
|
602 |
+
"type": "number",
|
603 |
+
"description": "The updated recommended quantity to reorder when stock is low."
|
604 |
+
}
|
605 |
+
},
|
606 |
+
"required": [
|
607 |
+
"item_code",
|
608 |
+
"low_stock_level",
|
609 |
+
"restock_level"
|
610 |
+
]
|
611 |
+
},
|
612 |
+
"output": {
|
613 |
+
"type": "object",
|
614 |
+
"properties": {
|
615 |
+
"status": {
|
616 |
+
"type": "string",
|
617 |
+
"description": "The outcome of the update action, indicating whether the thresholds were successfully updated."
|
618 |
+
},
|
619 |
+
"new_alert_status": {
|
620 |
+
"type": "string",
|
621 |
+
"description": "The updated alert status based on the new threshold values (e.g., 'low', 'sufficient')."
|
622 |
+
}
|
623 |
+
},
|
624 |
+
"required": [
|
625 |
+
"status",
|
626 |
+
"new_alert_status"
|
627 |
+
]
|
628 |
+
},
|
629 |
+
"dummy_outputs": [
|
630 |
+
{
|
631 |
+
"status": "success",
|
632 |
+
"new_alert_status": "low"
|
633 |
+
},
|
634 |
+
{
|
635 |
+
"status": "success",
|
636 |
+
"new_alert_status": "sufficient"
|
637 |
+
}
|
638 |
+
]
|
639 |
+
}
|
640 |
+
]
|
641 |
+
}
|
642 |
+
}
|
643 |
+
}
|