Spaces:
Running
Running
HuanzhiMao
commited on
Commit
•
0157229
1
Parent(s):
4d1746c
Fixing Dual Window Bug and Adding Single Model Demo (#1)
Browse files- Fixed dual demo bug and added single model demo (6956b4fae89e4448a204432fb361de025b1458dc)
- Removed print statement for debugging (dbfe8f49b22f73a3c119bce8e2920284fe279ddd)
- app.py +161 -425
- app_utils.py +95 -0
- base_handler.py +5 -2
- config/.DS_Store +0 -0
- config/gorilla_file_system.json +18 -18
- config/math_api.json +17 -17
- config/message_api.json +10 -10
- config/posting_api.json +14 -14
- config/ticket_api.json +9 -9
- config/trading_bot.json +22 -22
- config/travel_booking.json +17 -17
- config/vehicle_control.json +22 -22
- multi_turn_eval/multi_turn_utils.py +1 -1
- state.py +124 -0
- state_manager.py +119 -0
app.py
CHANGED
@@ -1,469 +1,205 @@
|
|
1 |
import gradio as gr
|
2 |
from backend import get_handler
|
3 |
-
import time
|
4 |
-
import uuid
|
5 |
-
import json
|
6 |
-
import os
|
7 |
import queue
|
8 |
from db import collection
|
9 |
from info_table import api_info, api_samples
|
|
|
|
|
10 |
|
11 |
-
|
12 |
-
/* Highlight the entire message box for the bot */
|
13 |
-
.bot-highlight {
|
14 |
-
background-color: yellow !important;
|
15 |
-
padding: 0px;
|
16 |
-
border-radius: 8px;
|
17 |
-
}
|
18 |
-
"""
|
19 |
-
|
20 |
-
# Initialize test_entry and handler
|
21 |
-
def initialize_empty_test_entry():
|
22 |
-
return {
|
23 |
-
"initial_config": {},
|
24 |
-
"involved_classes": [],
|
25 |
-
"id": str(uuid.uuid4()), # Generate unique ID
|
26 |
-
"question": [],
|
27 |
-
"function": []
|
28 |
-
}
|
29 |
-
|
30 |
-
test_entry_1 = initialize_empty_test_entry()
|
31 |
-
test_entry_2 = initialize_empty_test_entry()
|
32 |
-
|
33 |
-
inference_data_1 = {"message": []} # Do not change this
|
34 |
-
inference_data_2 = {"message": []} # Do not change this
|
35 |
-
|
36 |
-
# Define available models and categories
|
37 |
-
models = ["gpt-4o-mini-2024-07-18-FC", "gpt-4o-2024-08-06-FC", "gpt-4o-mini-2024-07-18-FC", "gpt-4-turbo-2024-04-09-FC", "gpt-3.5-turbo-0125-FC"]
|
38 |
-
categories = ["GorillaFileSystem", "MathAPI", "MessageAPI", "TwitterAPI", "TicketAPI", "TradingBot", "TravelAPI", "VehicleControlAPI"]
|
39 |
-
|
40 |
-
initial_chat_history = [
|
41 |
-
{"role": "user", "content": "Hi, can you help me with some tasks?"},
|
42 |
-
{"role": "assistant", "content": "Hello there! How can I assist you today?"},
|
43 |
-
]
|
44 |
-
|
45 |
shared_queue = queue.Queue()
|
46 |
|
47 |
-
def get_initial_state():
|
48 |
-
return initial_chat_history
|
49 |
-
|
50 |
-
DEFAULT_MODEL_1 = models[0]
|
51 |
-
DEFAULT_MODEL_2 = models[1]
|
52 |
-
DEFAULT_TEMPERATURE_1 = 0.7
|
53 |
-
DEFAULT_TEMPERATURE_2 = 0.4
|
54 |
-
|
55 |
-
current_model_1 = models[0]
|
56 |
-
current_model_2 = models[0]
|
57 |
-
current_category = categories[0]
|
58 |
-
current_temperature = DEFAULT_TEMPERATURE_1
|
59 |
-
current_temperature = DEFAULT_TEMPERATURE_2
|
60 |
-
|
61 |
-
# Initialize handler
|
62 |
-
handler_1 = get_handler(DEFAULT_MODEL_1, DEFAULT_TEMPERATURE_1)
|
63 |
-
handler_2 = get_handler(DEFAULT_MODEL_2, DEFAULT_TEMPERATURE_2)
|
64 |
-
|
65 |
-
def print_like_dislike(x: gr.LikeData):
|
66 |
-
print(x.index, x.value, x.liked)
|
67 |
-
|
68 |
-
|
69 |
-
def add_message(history1, history2, message, target):
|
70 |
-
|
71 |
-
if target in ["Model 1", "Both"]:
|
72 |
-
for x in message["files"]:
|
73 |
-
history1.append({"role": "user", "content": {"path": x}})
|
74 |
-
if message["text"] is not None:
|
75 |
-
history1.append({"role": "user", "content": message["text"]})
|
76 |
-
test_entry_1["question"] = [{"role": "user", "content": message["text"]}]
|
77 |
-
|
78 |
-
if target in ["Model 2", "Both"]:
|
79 |
-
for x in message["files"]:
|
80 |
-
history2.append({"role": "user", "content": {"path": x}})
|
81 |
-
if message["text"] is not None:
|
82 |
-
history2.append({"role": "user", "content": message["text"]})
|
83 |
-
test_entry_2["question"] = [{"role": "user", "content": message["text"]}]
|
84 |
-
|
85 |
-
return history1, history2, gr.MultimodalTextbox(value=None, interactive=False)
|
86 |
-
|
87 |
-
def equalize_and_zip(list1, list2):
|
88 |
-
# Determine the maximum length of the two lists
|
89 |
-
if list1 == None:
|
90 |
-
list1 = []
|
91 |
-
if list2 == None:
|
92 |
-
list2 = []
|
93 |
-
|
94 |
-
if isinstance(list1, str):
|
95 |
-
list1 = [list1]
|
96 |
-
if isinstance(list2, str):
|
97 |
-
list2 = [list2]
|
98 |
-
|
99 |
-
max_len = max(len(list1), len(list2))
|
100 |
-
|
101 |
-
# Extend both lists to the same length by appending None
|
102 |
-
list1.extend([None] * (max_len - len(list1)))
|
103 |
-
list2.extend([None] * (max_len - len(list2)))
|
104 |
-
|
105 |
-
# Zip the lists together
|
106 |
-
return list(zip(list1, list2))
|
107 |
-
|
108 |
-
def consume_data(shared_queue):
|
109 |
-
none_list = []
|
110 |
-
while True:
|
111 |
-
data = shared_queue.get()
|
112 |
-
if data is None:
|
113 |
-
if data in none_list:
|
114 |
-
print("[Consumer] No more data to consume. Exiting.")
|
115 |
-
break
|
116 |
-
else:
|
117 |
-
none_list.append(data)
|
118 |
-
yield data
|
119 |
-
|
120 |
-
def bot(history1: list, history2: list, target):
|
121 |
-
|
122 |
-
if target == "Model 1":
|
123 |
-
gen = bot_response(history1, handler_1, test_entry_1, inference_data_1, "Model 1")
|
124 |
-
print("gen: ", gen)
|
125 |
-
while True:
|
126 |
-
stop = True
|
127 |
-
try:
|
128 |
-
gen_his_1 = next(gen)
|
129 |
-
stop = False
|
130 |
-
yield gen_his_1, history2
|
131 |
-
except StopIteration:
|
132 |
-
pass
|
133 |
-
if stop:
|
134 |
-
break
|
135 |
-
elif target == "Model 2":
|
136 |
-
gen = bot_response(history2, handler_2, test_entry_2, inference_data_2, "Model 2")
|
137 |
-
while True:
|
138 |
-
stop = True
|
139 |
-
try:
|
140 |
-
gen_his_2 = next(gen)
|
141 |
-
stop = False
|
142 |
-
yield history1, gen_his_2
|
143 |
-
except StopIteration:
|
144 |
-
pass
|
145 |
-
if stop:
|
146 |
-
break
|
147 |
-
elif target == "Both":
|
148 |
-
gen1 = bot_response(history1, handler_1, test_entry_1, inference_data_1, "Model 1")
|
149 |
-
gen2 = bot_response(history2, handler_2, test_entry_2, inference_data_2, "Model 2")
|
150 |
-
while True:
|
151 |
-
stop = True
|
152 |
-
try:
|
153 |
-
gen_his_1 = next(gen1)
|
154 |
-
stop = False
|
155 |
-
except StopIteration:
|
156 |
-
pass
|
157 |
-
try:
|
158 |
-
gen_his_2 = next(gen2)
|
159 |
-
stop = False
|
160 |
-
except StopIteration:
|
161 |
-
pass
|
162 |
-
yield gen_his_1, gen_his_2
|
163 |
-
if stop:
|
164 |
-
break
|
165 |
-
|
166 |
-
|
167 |
-
def bot_response(history, handler, test_entry, inference_data, model_target):
|
168 |
-
|
169 |
-
global inference_data_1, inference_data_2
|
170 |
-
|
171 |
-
for item in handler.inference(test_entry, inference_data):
|
172 |
-
# Processing logic remains the same
|
173 |
-
if item[0] == "regular":
|
174 |
-
responses_results = equalize_and_zip(item[1], item[2])
|
175 |
-
for (model_res, exec_res) in responses_results:
|
176 |
-
if model_res is not None:
|
177 |
-
response = model_res
|
178 |
-
history.append({"role": "assistant", "content": "<b>Model Response🤖: </b><br>"})
|
179 |
-
for character in response:
|
180 |
-
history[-1]["content"] += character
|
181 |
-
time.sleep(0.01)
|
182 |
-
yield history
|
183 |
-
if exec_res is not None:
|
184 |
-
response = exec_res
|
185 |
-
history[-1]["content"] += "<br><br><b>Model Execution💻: </b><br>"
|
186 |
-
yield history
|
187 |
-
# history.append({"role": "assistant", "content": "<span class='bot-highlight'> Model Execution: </span>"})
|
188 |
-
for character in response:
|
189 |
-
# history[-1]["content"] = history[-1]["content"][0:-7] + character + "</span>"
|
190 |
-
history[-1]["content"] += character
|
191 |
-
time.sleep(0.01)
|
192 |
-
yield history
|
193 |
-
elif item[0] == 'summary':
|
194 |
-
response = item[1]
|
195 |
-
if response is not None:
|
196 |
-
history.append({"role": "assistant", "content": "<b>Summary✅: </b><br>"})
|
197 |
-
for character in response:
|
198 |
-
history[-1]["content"] += character
|
199 |
-
time.sleep(0.01)
|
200 |
-
yield history
|
201 |
-
|
202 |
-
elif item[0] == "final":
|
203 |
-
# Update inference data based on the target
|
204 |
-
if model_target == "Model 1":
|
205 |
-
inference_data_1 = item[2]
|
206 |
-
elif model_target == "Model 2":
|
207 |
-
inference_data_2 = item[2]
|
208 |
-
|
209 |
-
# Saves the model, cateogry, temperature, and history to the database
|
210 |
-
def save_1(history):
|
211 |
-
if len(history) > 2:
|
212 |
-
document = {"model": current_model_1,
|
213 |
-
"category": current_category,
|
214 |
-
"temperature": current_temperature_1,
|
215 |
-
"history": history}
|
216 |
-
# Have error in database connection
|
217 |
-
collection.insert_one(document)
|
218 |
-
|
219 |
-
def save_2(history):
|
220 |
-
if len(history) > 2:
|
221 |
-
document = {"model": current_model_2,
|
222 |
-
"category": current_category,
|
223 |
-
"temperature": current_temperature_2,
|
224 |
-
"history": history}
|
225 |
-
# Have error in database connection
|
226 |
-
collection.insert_one(document)
|
227 |
-
|
228 |
-
# Function to assign new unique ID on restart or at the start
|
229 |
-
def restart_chat_1(history):
|
230 |
-
global test_entry_1
|
231 |
-
test_entry_1["id"] = str(uuid.uuid4()) # Reinitialize test_entry with new ID
|
232 |
-
global handler_1
|
233 |
-
handler_1 = get_handler(model_dropdown_1.value, temperature_slider_1.value)
|
234 |
-
# print("test: entry", test_entry_1)
|
235 |
-
return [{"role": "user", "content": "Hi, can you help me with some tasks?"},
|
236 |
-
{"role": "assistant", "content": "Hello there! How can I assist you today?"}]
|
237 |
-
|
238 |
-
# Saves history before restarting chat,
|
239 |
-
def restart_chat_and_save_1(history):
|
240 |
-
save_1(history)
|
241 |
-
return restart_chat_1(history)
|
242 |
-
|
243 |
-
def restart_chat_2(history):
|
244 |
-
global test_entry_2
|
245 |
-
test_entry_2["id"] = str(uuid.uuid4()) # Reinitialize test_entry with new ID
|
246 |
-
global handler_2
|
247 |
-
handler_2 = get_handler(model_dropdown_2.value, temperature_slider_2.value)
|
248 |
-
# print("test: entry", test_entry_2)
|
249 |
-
return [{"role": "user", "content": "Hi, can you help me with some tasks?"},
|
250 |
-
{"role": "assistant", "content": "Hello there! How can I assist you today?"}]
|
251 |
-
|
252 |
-
# Saves history before restarting chat,
|
253 |
-
def restart_chat_and_save_2(history):
|
254 |
-
save_2(history)
|
255 |
-
return restart_chat_2(history)
|
256 |
-
|
257 |
-
# Function to report an issue
|
258 |
def report_issue():
|
259 |
return gr.Info("Thank you for reporting the issue. Our team will look into it.")
|
260 |
|
261 |
-
|
262 |
-
def update_handler_1(model, temp_slider, history):
|
263 |
-
global current_model_1
|
264 |
-
current_model_1 = model
|
265 |
-
global current_temperature_1
|
266 |
-
current_temperature_1 = temp_slider
|
267 |
-
print("update handler 1: ", model, temp_slider)
|
268 |
-
global handler_1
|
269 |
-
handler_1 = get_handler(model, temp_slider) # Reinitialize handler with new model and temperature
|
270 |
-
restart_history = restart_chat_1(history)
|
271 |
-
return model, restart_history
|
272 |
-
|
273 |
-
# Update handler 2 when model or temperature is changed
|
274 |
-
def update_handler_2(model, temp_slider, history):
|
275 |
-
global current_model_2
|
276 |
-
current_model_2 = model
|
277 |
-
global current_temperature_2
|
278 |
-
current_temperature_2 = temp_slider
|
279 |
-
print("update handler 2: ", model, temp_slider)
|
280 |
-
global handler_2
|
281 |
-
handler_2 = get_handler(model, temp_slider) # Reinitialize handler with new model and temperature
|
282 |
-
restart_history = restart_chat_2(history)
|
283 |
-
return model, restart_history
|
284 |
-
|
285 |
-
# Update involved_classes and load config based on category
|
286 |
-
def update_category_and_load_config(category):
|
287 |
-
global current_category
|
288 |
-
current_category = category
|
289 |
-
print("update category: ", category)
|
290 |
-
|
291 |
-
global test_entry_1, test_entry_2
|
292 |
-
# Update involved_classes
|
293 |
-
test_entry_1["initial_config"] = {category: {}}
|
294 |
-
test_entry_1["involved_classes"] = [category]
|
295 |
-
|
296 |
-
test_entry_2["initial_config"] = {category: {}}
|
297 |
-
test_entry_2["involved_classes"] = [category]
|
298 |
-
|
299 |
-
# Load the JSON file from the config folder corresponding to the category
|
300 |
-
config_path = os.path.join("config", f"{category}.json")
|
301 |
-
|
302 |
-
if os.path.exists(config_path):
|
303 |
-
with open(config_path, 'r') as config_file:
|
304 |
-
data = json.load(config_file)
|
305 |
-
test_entry_1["function"] = data.copy() # Load JSON content into test_entry["function"]
|
306 |
-
test_entry_2["function"] = data.copy()
|
307 |
-
|
308 |
-
return category
|
309 |
-
|
310 |
-
def load_example(example):
|
311 |
-
if example == "Example 1 - GFSFileSystem":
|
312 |
-
return models[0], 0.8, models[1], 0.3, categories[0], "Move final_report.pdf' within document directory to 'temp' directory in document. Make sure to create the directory"
|
313 |
-
elif example == "Example 2 - TradingBot":
|
314 |
-
return models[1], 0.9, models[2], 0.7, categories[5], "I'm contemplating enhancing my investment portfolio with some tech industry assets, and I've got my eye on Nvidia Corp. I'm keen to know its current stock price, and would appreciate if you could source this information for me."
|
315 |
-
elif example == "Example 3 - TravelAPI":
|
316 |
-
return models[2], 0.7, models[0], 0.2, categories[6], "As I plan a getaway, I'm curious about all the airports available for my travel. Would you share that information with me?"
|
317 |
-
return models[0], 0.7, models[2], 0.36, categories[0], "Move final_report.pdf' within document directory to 'temp' directory in document. Make sure to create the directory"
|
318 |
-
|
319 |
-
# Add logic to load examples when example buttons are clicked
|
320 |
-
def load_example_and_update(example, history_1, history_2):
|
321 |
-
save_1(history_1)
|
322 |
-
save_2(history_2)
|
323 |
-
# Load the example configuration
|
324 |
-
model_1, temp_1, model_2, temp_2, category, message = load_example(example)
|
325 |
-
update_category_and_load_config(category)
|
326 |
-
# Update the interface components
|
327 |
-
return model_1, temp_1, model_2, temp_2, category, message
|
328 |
-
|
329 |
-
# initialize test entry with default configurations
|
330 |
-
update_category_and_load_config(categories[0])
|
331 |
-
|
332 |
-
with gr.Blocks(css=custom_css) as demo:
|
333 |
gr.Markdown("# Multiturn LLM Chat Interface")
|
334 |
|
335 |
-
with gr.
|
336 |
-
with gr.
|
337 |
-
gr.Markdown("## Configurations")
|
338 |
-
|
339 |
-
model_dropdown_1 = gr.Dropdown(choices=models, label="Select Model 1", value=DEFAULT_MODEL_1, interactive=True)
|
340 |
-
temperature_slider_1 = gr.Slider(0, 1, value=DEFAULT_TEMPERATURE_1, label="Temperature 1", interactive=True)
|
341 |
-
|
342 |
-
model_dropdown_2 = gr.Dropdown(choices=models, label="Select Model 2", value=DEFAULT_MODEL_2, interactive=True)
|
343 |
-
temperature_slider_2 = gr.Slider(0, 1, value=DEFAULT_TEMPERATURE_2, label="Temperature 2", interactive=True)
|
344 |
-
|
345 |
-
category_dropdown = gr.Dropdown(choices=categories, label="Select Category", value=categories[0], interactive=True)
|
346 |
-
|
347 |
-
with gr.Column(scale=3):
|
348 |
-
|
349 |
with gr.Row():
|
350 |
-
|
351 |
-
|
352 |
-
gr.
|
353 |
-
|
354 |
-
|
|
|
|
|
|
|
355 |
with gr.Row():
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
with gr.Row():
|
364 |
-
|
365 |
-
|
|
|
|
|
|
|
366 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
367 |
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
chat_msg = chat_input.submit(
|
381 |
-
add_message, [chatbot1, chatbot2, chat_input, target_dropdown], [chatbot1, chatbot2, chat_input]
|
382 |
-
)
|
383 |
|
384 |
-
|
385 |
-
|
386 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
387 |
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
example_btn3 = gr.Button("Example 3 - TravelAPI")
|
395 |
-
|
396 |
-
gr.Markdown("<br><br>")
|
397 |
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
for i in range(len(category_info)):
|
405 |
-
with gr.Accordion(category_info.iloc[i]["Function Name"], open=False):
|
406 |
-
gr.Markdown(category_info.iloc[i]["Description"])
|
407 |
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
|
|
|
|
|
|
416 |
|
417 |
# Update handler when the model or temperature is changed
|
418 |
-
|
419 |
-
|
420 |
-
[
|
421 |
-
[
|
422 |
)
|
423 |
|
424 |
# Update handler when the model or temperature is changed
|
425 |
-
|
426 |
-
|
427 |
-
[
|
428 |
-
[
|
429 |
)
|
430 |
|
431 |
-
|
432 |
-
|
433 |
-
[
|
434 |
-
[
|
435 |
)
|
436 |
|
437 |
-
|
438 |
-
|
439 |
-
[
|
440 |
-
[
|
441 |
)
|
442 |
|
443 |
# Update category and load config when a category is selected
|
444 |
-
|
445 |
-
|
446 |
-
inputs=
|
447 |
-
outputs=
|
448 |
)
|
449 |
|
450 |
# Set up the event handler for the restart button to reset the chat and test_entry
|
451 |
-
|
452 |
-
|
453 |
|
454 |
-
|
455 |
-
|
456 |
|
457 |
-
|
458 |
-
outputs=[
|
459 |
-
|
460 |
-
outputs=[
|
461 |
-
|
462 |
-
outputs=[
|
463 |
|
464 |
demo.launch(share=False)
|
465 |
|
466 |
|
467 |
-
|
468 |
-
|
469 |
-
|
|
|
1 |
import gradio as gr
|
2 |
from backend import get_handler
|
|
|
|
|
|
|
|
|
3 |
import queue
|
4 |
from db import collection
|
5 |
from info_table import api_info, api_samples
|
6 |
+
from app_utils import *
|
7 |
+
from state_manager import StateManager
|
8 |
|
9 |
+
state_manager = StateManager(collection)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
shared_queue = queue.Queue()
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
def report_issue():
|
13 |
return gr.Info("Thank you for reporting the issue. Our team will look into it.")
|
14 |
|
15 |
+
with gr.Blocks(css=CUSTOM_CSS) as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
gr.Markdown("# Multiturn LLM Chat Interface")
|
17 |
|
18 |
+
with gr.Tabs() as tabs:
|
19 |
+
with gr.Tab("Single Model Demo"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
with gr.Row():
|
21 |
+
with gr.Column(scale=1):
|
22 |
+
gr.Markdown("## Configuration")
|
23 |
+
single_model_dropdown = gr.Dropdown(choices=MODELS, label="Select Model", value=MODELS[0], interactive=True)
|
24 |
+
single_temperature_slider = gr.Slider(0, 1, value=DEFAULT_TEMPERATURE_1, label="Temperature", interactive=True)
|
25 |
+
single_category_dropdown = gr.Dropdown(choices=CATEGORIES, label="Select Category", value=CATEGORIES[0], interactive=True)
|
26 |
+
|
27 |
+
with gr.Column(scale=2):
|
28 |
+
single_chatbot = gr.Chatbot(elem_id="chatbot", bubble_full_width=False, type="messages")
|
29 |
with gr.Row():
|
30 |
+
single_restart_btn = gr.Button("Restart")
|
31 |
+
single_report_btn = gr.Button("Report Issue")
|
32 |
+
single_chat_input = gr.MultimodalTextbox(
|
33 |
+
interactive=True,
|
34 |
+
file_count="multiple",
|
35 |
+
placeholder="Enter message or upload file...",
|
36 |
+
show_label=False,
|
37 |
+
)
|
38 |
+
demo.load(lambda: get_initial_state(), outputs=single_chatbot)
|
39 |
+
single_chat_msg = single_chat_input.submit(
|
40 |
+
state_manager.add_message, [single_chat_input], [single_chatbot, single_chat_input]
|
41 |
+
)
|
42 |
+
single_bot_msg = single_chat_msg.then(state_manager.get_reponse_single, [], single_chatbot, api_name="bot_response")
|
43 |
+
single_bot_msg.then(lambda: gr.MultimodalTextbox(interactive=True), None, [single_chat_input])
|
44 |
+
|
45 |
+
single_chatbot.like(print_like_dislike, None, None, like_user_message=True)
|
46 |
+
|
47 |
with gr.Row():
|
48 |
+
single_example_btn1 = gr.Button("Example 1 - GFSFileSystem")
|
49 |
+
single_example_btn2 = gr.Button("Example 2 - TradingBot")
|
50 |
+
single_example_btn3 = gr.Button("Example 3 - TravelAPI")
|
51 |
+
|
52 |
+
with gr.Tab("Dual Model Demo"):
|
53 |
with gr.Row():
|
54 |
+
with gr.Column(scale=1):
|
55 |
+
gr.Markdown("## Configurations")
|
56 |
+
dual_model_dropdown_1 = gr.Dropdown(choices=MODELS, label="Select Model 1", value=DEFAULT_MODEL_1, interactive=True)
|
57 |
+
dual_temperature_slider_1 = gr.Slider(0, 1, value=DEFAULT_TEMPERATURE_1, label="Temperature 1", interactive=True)
|
58 |
+
dual_model_dropdown_2 = gr.Dropdown(choices=MODELS, label="Select Model 2", value=DEFAULT_MODEL_2, interactive=True)
|
59 |
+
dual_temperature_slider_2 = gr.Slider(0, 1, value=DEFAULT_TEMPERATURE_2, label="Temperature 2", interactive=True)
|
60 |
+
dual_category_dropdown = gr.Dropdown(choices=CATEGORIES, label="Select Category", value=CATEGORIES[0], interactive=True)
|
61 |
|
62 |
+
with gr.Column(scale=3):
|
63 |
+
with gr.Row():
|
64 |
+
with gr.Column():
|
65 |
+
gr.Markdown("### Model 1")
|
66 |
+
dual_chatbot1 = gr.Chatbot(elem_id="chatbot1", bubble_full_width=False, type="messages")
|
67 |
+
with gr.Row():
|
68 |
+
dual_restart_btn_1 = gr.Button("Restart")
|
69 |
+
dual_report_btn_1 = gr.Button("Report Issue")
|
70 |
+
with gr.Column():
|
71 |
+
gr.Markdown("### Model 2")
|
72 |
+
dual_chatbot2 = gr.Chatbot(elem_id="chatbot2", bubble_full_width=False, type="messages")
|
73 |
+
with gr.Row():
|
74 |
+
dual_restart_btn_2 = gr.Button("Restart")
|
75 |
+
dual_report_btn_2 = gr.Button("Report Issue")
|
76 |
+
with gr.Row():
|
77 |
+
dual_target_dropdown = gr.Dropdown(choices=["Model 1", "Model 2", "Both"], container=False, value="Both", interactive=True, scale=1)
|
78 |
+
dual_chat_input = gr.MultimodalTextbox(
|
79 |
+
interactive=True,
|
80 |
+
file_count="multiple",
|
81 |
+
placeholder="Enter message or upload file...",
|
82 |
+
show_label=False,
|
83 |
+
scale=4
|
84 |
+
)
|
85 |
+
|
86 |
+
demo.load(lambda: get_initial_state(), outputs=dual_chatbot1)
|
87 |
+
demo.load(lambda: get_initial_state(), outputs=dual_chatbot2)
|
88 |
+
|
89 |
+
dual_chat_msg = dual_chat_input.submit(
|
90 |
+
state_manager.add_message, [dual_chat_input, dual_target_dropdown], [dual_chatbot1, dual_chatbot2, dual_chat_input]
|
91 |
+
)
|
92 |
|
93 |
+
dual_bot_msg = dual_chat_msg.then(state_manager.get_reponse_dual, inputs=[dual_target_dropdown], outputs=[dual_chatbot1, dual_chatbot2])
|
94 |
+
|
95 |
+
dual_bot_msg.then(lambda: gr.MultimodalTextbox(interactive=True), None, [dual_chat_input])
|
|
|
|
|
|
|
96 |
|
97 |
+
dual_chatbot1.like(print_like_dislike, None, None, like_user_message=True)
|
98 |
+
dual_chatbot2.like(print_like_dislike, None, None, like_user_message=True)
|
99 |
+
|
100 |
+
with gr.Row():
|
101 |
+
dual_example_btn1 = gr.Button("Example 1 - GFSFileSystem")
|
102 |
+
dual_example_btn2 = gr.Button("Example 2 - TradingBot")
|
103 |
+
dual_example_btn3 = gr.Button("Example 3 - TravelAPI")
|
104 |
+
|
105 |
+
with gr.Tab("Function Descriptions"):
|
106 |
+
for category in CATEGORIES:
|
107 |
+
with gr.Tab(category):
|
108 |
+
with gr.Group():
|
109 |
+
category_info = api_info[api_info["Class Name"] == category]
|
110 |
+
with gr.Accordion("Function description", open=False):
|
111 |
+
with gr.Group():
|
112 |
+
for i in range(len(category_info)):
|
113 |
+
with gr.Accordion(category_info.iloc[i]["Function Name"], open=False):
|
114 |
+
gr.Markdown(category_info.iloc[i]["Description"])
|
115 |
+
|
116 |
+
# Sample demo, limit 5 per categories
|
117 |
+
samples = [[sample['question'], sample['ground_truth']] for _, sample in api_samples.iterrows() if category in sample['involved_classes']][:5]
|
118 |
+
gr.Dataset(
|
119 |
+
components=[gr.HTML(), gr.Markdown()],
|
120 |
+
headers= ["Prompt", "API Use"],
|
121 |
+
samples= samples
|
122 |
+
)
|
123 |
+
|
124 |
+
single_model_dropdown.change(
|
125 |
+
state_manager.single_bot.update_handler,
|
126 |
+
[single_model_dropdown, single_temperature_slider],
|
127 |
+
[single_model_dropdown, single_chatbot]
|
128 |
+
)
|
129 |
|
130 |
+
# Update handler when the temperature is changed
|
131 |
+
single_temperature_slider.change(
|
132 |
+
state_manager.single_bot.update_handler,
|
133 |
+
[single_model_dropdown, single_temperature_slider],
|
134 |
+
[single_model_dropdown, single_chatbot]
|
135 |
+
)
|
|
|
|
|
|
|
136 |
|
137 |
+
# Update category and load config when a category is selected
|
138 |
+
single_category_dropdown.change(
|
139 |
+
state_manager.single_update_category_and_load_config,
|
140 |
+
inputs=single_category_dropdown,
|
141 |
+
outputs=single_category_dropdown
|
142 |
+
)
|
|
|
|
|
|
|
143 |
|
144 |
+
# Set up the event handler for the restart button to reset the chat and test_entry
|
145 |
+
# restart_btn.click(restart_chat, None, [chatbot])
|
146 |
+
single_restart_btn.click(state_manager.single_bot.restart_chat_and_save, [], [single_chatbot])
|
147 |
+
single_report_btn.click(report_issue, None, None)
|
148 |
+
|
149 |
+
single_example_btn1.click(state_manager.single_load_example_and_update, inputs=[single_example_btn1],
|
150 |
+
outputs=[single_model_dropdown, single_temperature_slider, single_category_dropdown, single_chat_input])
|
151 |
+
single_example_btn2.click(state_manager.single_load_example_and_update, inputs=[single_example_btn2],
|
152 |
+
outputs=[single_model_dropdown, single_temperature_slider, single_category_dropdown, single_chat_input])
|
153 |
+
single_example_btn3.click(state_manager.single_load_example_and_update, inputs=[single_example_btn3],
|
154 |
+
outputs=[single_model_dropdown, single_temperature_slider, single_category_dropdown, single_chat_input])
|
155 |
|
156 |
# Update handler when the model or temperature is changed
|
157 |
+
dual_model_dropdown_1.change(
|
158 |
+
state_manager.dual_bot1.update_handler,
|
159 |
+
[dual_model_dropdown_1, dual_temperature_slider_1],
|
160 |
+
[dual_model_dropdown_1, dual_chatbot1]
|
161 |
)
|
162 |
|
163 |
# Update handler when the model or temperature is changed
|
164 |
+
dual_model_dropdown_2.change(
|
165 |
+
state_manager.dual_bot2.update_handler,
|
166 |
+
[dual_model_dropdown_2, dual_temperature_slider_2],
|
167 |
+
[dual_model_dropdown_2, dual_chatbot2]
|
168 |
)
|
169 |
|
170 |
+
dual_temperature_slider_1.change(
|
171 |
+
state_manager.dual_bot1.update_handler,
|
172 |
+
[dual_model_dropdown_1, dual_temperature_slider_1],
|
173 |
+
[dual_model_dropdown_1, dual_chatbot1]
|
174 |
)
|
175 |
|
176 |
+
dual_temperature_slider_2.change(
|
177 |
+
state_manager.dual_bot2.update_handler,
|
178 |
+
[dual_model_dropdown_2, dual_temperature_slider_2],
|
179 |
+
[dual_model_dropdown_2, dual_chatbot2]
|
180 |
)
|
181 |
|
182 |
# Update category and load config when a category is selected
|
183 |
+
dual_category_dropdown.change(
|
184 |
+
state_manager.dual_update_category_and_load_config,
|
185 |
+
inputs=dual_category_dropdown,
|
186 |
+
outputs=dual_category_dropdown
|
187 |
)
|
188 |
|
189 |
# Set up the event handler for the restart button to reset the chat and test_entry
|
190 |
+
dual_restart_btn_1.click(state_manager.dual_bot1.restart_chat_and_save, [], [dual_chatbot1])
|
191 |
+
dual_report_btn_1.click(report_issue, None, None)
|
192 |
|
193 |
+
dual_restart_btn_2.click(state_manager.dual_bot2.restart_chat_and_save, [], [dual_chatbot2])
|
194 |
+
dual_report_btn_2.click(report_issue, None, None)
|
195 |
|
196 |
+
dual_example_btn1.click(state_manager.dual_load_example_and_update, inputs=[dual_example_btn1],
|
197 |
+
outputs=[dual_model_dropdown_1, dual_temperature_slider_1, dual_model_dropdown_2, dual_temperature_slider_2, dual_category_dropdown, dual_chat_input])
|
198 |
+
dual_example_btn2.click(state_manager.dual_load_example_and_update, inputs=[dual_example_btn2],
|
199 |
+
outputs=[dual_model_dropdown_1, dual_temperature_slider_1, dual_model_dropdown_2, dual_temperature_slider_2, dual_category_dropdown, dual_chat_input])
|
200 |
+
dual_example_btn3.click(state_manager.dual_load_example_and_update, inputs=[dual_example_btn3],
|
201 |
+
outputs=[dual_model_dropdown_1, dual_temperature_slider_1, dual_model_dropdown_2, dual_temperature_slider_2, dual_category_dropdown, dual_chat_input])
|
202 |
|
203 |
demo.launch(share=False)
|
204 |
|
205 |
|
|
|
|
|
|
app_utils.py
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from backend import get_handler
|
3 |
+
import uuid
|
4 |
+
|
5 |
+
CUSTOM_CSS = """
|
6 |
+
/* Highlight the entire message box for the bot */
|
7 |
+
.bot-highlight {
|
8 |
+
background-color: yellow !important;
|
9 |
+
padding: 0px;
|
10 |
+
border-radius: 8px;
|
11 |
+
}
|
12 |
+
"""
|
13 |
+
|
14 |
+
MAPPINGS = {"GorillaFileSystem": "gorilla_file_system",
|
15 |
+
"MathAPI": "math_api",
|
16 |
+
"MessageAPI": "message_api",
|
17 |
+
"TwitterAPI": "posting_api",
|
18 |
+
"TicketAPI": "ticket_api",
|
19 |
+
"TradingBot": "trading_bot",
|
20 |
+
"TravelAPI": "travel_booking",
|
21 |
+
"VehicleControlAPI": "vehicle_control"}
|
22 |
+
|
23 |
+
MODELS = ["gpt-4o-mini-2024-07-18-FC", "gpt-4o-2024-08-06-FC", "gpt-4o-mini-2024-07-18-FC",
|
24 |
+
"gpt-4-turbo-2024-04-09-FC", "gpt-3.5-turbo-0125-FC"]
|
25 |
+
CATEGORIES = ["GorillaFileSystem", "MathAPI", "MessageAPI", "TwitterAPI",
|
26 |
+
"TicketAPI", "TradingBot", "TravelAPI", "VehicleControlAPI"]
|
27 |
+
|
28 |
+
DEFAULT_MODEL_1 = MODELS[0]
|
29 |
+
DEFAULT_MODEL_2 = MODELS[1]
|
30 |
+
DEFAULT_TEMPERATURE_1 = 0.7
|
31 |
+
DEFAULT_TEMPERATURE_2 = 0.4
|
32 |
+
|
33 |
+
INITIAL_CHAT_HISTORY = [
|
34 |
+
{"role": "user", "content": "Hi, can you help me with some tasks?"},
|
35 |
+
{"role": "assistant", "content": "Hello there! How can I assist you today?"},
|
36 |
+
]
|
37 |
+
|
38 |
+
SINGLE_MODEL_BOT_EXAMPLE_SETTING = {
|
39 |
+
"Example 1 - GFSFileSystem": (MODELS[0], 0.8, CATEGORIES[0], "Move final_report.pdf' within document directory to 'temp' directory in document. Make sure to create the directory"),
|
40 |
+
"Example 2 - TradingBot": (MODELS[1], 0.9, CATEGORIES[5], "I'm contemplating enhancing my investment portfolio with some tech industry assets, and I've got my eye on Nvidia Corp. I'm keen to know its current stock price, and would appreciate if you could source this information for me."),
|
41 |
+
"Example 3 - TravelAPI": (MODELS[2], 0.7, CATEGORIES[6], "As I plan a getaway, I'm curious about all the airports available for my travel. Would you share that information with me?"),
|
42 |
+
}
|
43 |
+
|
44 |
+
DUAL_MODEL_BOT_1_EXAMPLE_SETTING = {
|
45 |
+
"Example 1 - GFSFileSystem": (MODELS[0], 0.8, CATEGORIES[0], "Move final_report.pdf' within document directory to 'temp' directory in document. Make sure to create the directory"),
|
46 |
+
"Example 2 - TradingBot": (MODELS[1], 0.9, CATEGORIES[5], "I'm contemplating enhancing my investment portfolio with some tech industry assets, and I've got my eye on Nvidia Corp. I'm keen to know its current stock price, and would appreciate if you could source this information for me."),
|
47 |
+
"Example 3 - TravelAPI": (MODELS[2], 0.7, CATEGORIES[6], "As I plan a getaway, I'm curious about all the airports available for my travel. Would you share that information with me?"),
|
48 |
+
}
|
49 |
+
|
50 |
+
DUAL_MODEL_BOT_2_EXAMPLE_SETTING = {
|
51 |
+
"Example 1 - GFSFileSystem": (MODELS[3], 0.5, CATEGORIES[0], "Move final_report.pdf' within document directory to 'temp' directory in document. Make sure to create the directory"),
|
52 |
+
"Example 2 - TradingBot": (MODELS[4], 0.6, CATEGORIES[5], "I'm contemplating enhancing my investment portfolio with some tech industry assets, and I've got my eye on Nvidia Corp. I'm keen to know its current stock price, and would appreciate if you could source this information for me."),
|
53 |
+
"Example 3 - TravelAPI": (MODELS[0], 0.4, CATEGORIES[6], "As I plan a getaway, I'm curious about all the airports available for my travel. Would you share that information with me?"),
|
54 |
+
}
|
55 |
+
|
56 |
+
def get_initial_state():
|
57 |
+
return list(INITIAL_CHAT_HISTORY)
|
58 |
+
|
59 |
+
def print_like_dislike(x: gr.LikeData):
|
60 |
+
print(x.index, x.value, x.liked)
|
61 |
+
|
62 |
+
def equalize_and_zip(list1, list2):
|
63 |
+
if list1 == None:
|
64 |
+
list1 = []
|
65 |
+
if list2 == None:
|
66 |
+
list2 = []
|
67 |
+
if isinstance(list1, str):
|
68 |
+
list1 = [list1]
|
69 |
+
if isinstance(list2, str):
|
70 |
+
list2 = [list2]
|
71 |
+
max_len = max(len(list1), len(list2))
|
72 |
+
list1.extend([None] * (max_len - len(list1)))
|
73 |
+
list2.extend([None] * (max_len - len(list2)))
|
74 |
+
return list(zip(list1, list2))
|
75 |
+
|
76 |
+
def consume_data(shared_queue):
|
77 |
+
none_list = []
|
78 |
+
while True:
|
79 |
+
data = shared_queue.get()
|
80 |
+
if data is None:
|
81 |
+
if data in none_list:
|
82 |
+
print("[Consumer] No more data to consume. Exiting.")
|
83 |
+
break
|
84 |
+
else:
|
85 |
+
none_list.append(data)
|
86 |
+
yield data
|
87 |
+
|
88 |
+
def initialize_empty_test_entry():
|
89 |
+
return {
|
90 |
+
"initial_config": {},
|
91 |
+
"involved_classes": [],
|
92 |
+
"id": str(uuid.uuid4()),
|
93 |
+
"question": [],
|
94 |
+
"function": []
|
95 |
+
}
|
base_handler.py
CHANGED
@@ -115,9 +115,10 @@ class BaseHandler:
|
|
115 |
|
116 |
if turn_idx == 0:
|
117 |
inference_data = self.add_first_turn_message_FC(
|
118 |
-
inference_data, current_turn_message
|
119 |
)
|
120 |
else:
|
|
|
121 |
inference_data = self._add_next_turn_user_message_FC(
|
122 |
inference_data, current_turn_message
|
123 |
)
|
@@ -127,6 +128,8 @@ class BaseHandler:
|
|
127 |
current_turn_input_token_count: list[float] = []
|
128 |
current_turn_output_token_count: list[float] = []
|
129 |
current_turn_latency: list[float] = []
|
|
|
|
|
130 |
|
131 |
count = 0
|
132 |
while True:
|
@@ -285,7 +288,7 @@ class BaseHandler:
|
|
285 |
"inference_log": all_inference_log,
|
286 |
}
|
287 |
|
288 |
-
yield ("final",
|
289 |
|
290 |
|
291 |
def decode_ast(self, result, language="Python"):
|
|
|
115 |
|
116 |
if turn_idx == 0:
|
117 |
inference_data = self.add_first_turn_message_FC(
|
118 |
+
inference_data, [current_turn_message]
|
119 |
)
|
120 |
else:
|
121 |
+
assert isinstance(current_turn_message, list), "Current turn message is not a list"
|
122 |
inference_data = self._add_next_turn_user_message_FC(
|
123 |
inference_data, current_turn_message
|
124 |
)
|
|
|
128 |
current_turn_input_token_count: list[float] = []
|
129 |
current_turn_output_token_count: list[float] = []
|
130 |
current_turn_latency: list[float] = []
|
131 |
+
|
132 |
+
involved_instances = None
|
133 |
|
134 |
count = 0
|
135 |
while True:
|
|
|
288 |
"inference_log": all_inference_log,
|
289 |
}
|
290 |
|
291 |
+
yield ("final", current_turn_response, inference_data, involved_instances)
|
292 |
|
293 |
|
294 |
def decode_ast(self, result, language="Python"):
|
config/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
config/gorilla_file_system.json
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
-
{"name": "cat", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Display the contents of a file of any extension from currrent directory.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the file from current directory to display. No path is allowed. "}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {"file_content": {"type": "string", "description": "The content of the file."}}}}
|
2 |
-
{"name": "cd", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Change the current working directory to the specified folder.", "parameters": {"type": "dict", "properties": {"folder": {"type": "string", "description": "The folder of the directory to change to. You can only change one folder at a time. "}}, "required": ["folder"]}, "response": {"type": "dict", "properties": {"current_working_directory": {"type": "string", "description": "The new current working directory path."}}}}
|
3 |
-
{"name": "cp", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Copy a file or directory from one location to another. If the destination is a directory, the source file or directory will be copied into the destination directory. Both source and destination must be local to the current directory.", "parameters": {"type": "dict", "properties": {"source": {"type": "string", "description": "The name of the file or directory to copy."}, "destination": {"type": "string", "description": "The destination name to copy the file or directory to. If the destination is a directory, the source will be copied into this directory. No file paths allowed. "}}, "required": ["source", "destination"]}, "response": {"type": "dict", "properties": {"result": {"type": "string", "description": "The result of the copy operation or an error message if the operation fails."}}}}
|
4 |
-
{"name": "diff", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Compare two files of any extension line by line at the current directory.", "parameters": {"type": "dict", "properties": {"file_name1": {"type": "string", "description": "The name of the first file in current directory."}, "file_name2": {"type": "string", "description": "The name of the second file in current directorry. "}}, "required": ["file_name1", "file_name2"]}, "response": {"type": "dict", "properties": {"diff_lines": {"type": "string", "description": "The differences between the two files."}}}}
|
5 |
-
{"name": "du", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Estimate the disk usage of a directory and its contents.", "parameters": {"type": "dict", "properties": {"human_readable": {"type": "boolean", "description": "If True, returns the size in human-readable format (e.g., KB, MB). ", "default": false}}, "required": []}, "response": {"type": "dict", "properties": {"disk_usage": {"type": "string", "description": "The estimated disk usage."}}}}
|
6 |
-
{"name": "echo", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Write content to a file at current directory or display it in the terminal.", "parameters": {"type": "dict", "properties": {"content": {"type": "string", "description": "The content to write or display."}, "file_name": {"type": "string", "description": "The name of the file at current directory to write the content to. Defaults to None. ", "default": "None"}}, "required": ["content"]}, "response": {"type": "dict", "properties": {"terminal_output": {"type": "string", "description": "The content if no file name is provided, or None if written to file."}}}}
|
7 |
-
{"name": "find", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Find any file or directories under specific path that contain name in its file name. This method searches for files of any extension and directories within a specified path that match the given name. If no name is provided, it returns all files and directories in the specified path and its subdirectories. Note: This method performs a recursive search through all subdirectories of the given path.", "parameters": {"type": "dict", "properties": {"path": {"type": "string", "description": "The directory path to start the search. Defaults to the current directory (\".\").", "default": "."}, "name": {"type": "string", "description": "The name of the file or directory to search for. If None, all items are returned. ", "default": "None"}}, "required": []}, "response": {"type": "dict", "properties": {"matches": {"type": "array", "description": "A list of matching file and directory paths relative to the given path.", "items": {"type": "string"}}}}}
|
8 |
-
{"name": "grep", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Search for lines in a file of any extension at current directory that contain the specified pattern.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the file to search. No path is allowed and you can only perform on file at local directory."}, "pattern": {"type": "string", "description": "The pattern to search for. "}}, "required": ["file_name", "pattern"]}, "response": {"type": "dict", "properties": {"matching_lines": {"type": "array", "description": "Lines that match the pattern.", "items": {"type": "string"}}}}}
|
9 |
-
{"name": "ls", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: List the contents of the current directory.", "parameters": {"type": "dict", "properties": {"a": {"type": "boolean", "description": "Show hidden files and directories. Defaults to False. ", "default": false}}, "required": []}, "response": {"type": "dict", "properties": {"current_directory_content": {"type": "array", "description": "A list of the contents of the specified directory.", "items": {"type": "string"}}}}}
|
10 |
-
{"name": "mkdir", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Create a new directory in the current directory.", "parameters": {"type": "dict", "properties": {"dir_name": {"type": "string", "description": "The name of the new directory at current directory. You can only create directory at current directory."}}, "required": ["dir_name"]}, "response": {"type": "dict", "properties": {}}}
|
11 |
-
{"name": "mv", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Move a file or directory from one location to another. so", "parameters": {"type": "dict", "properties": {"source": {"type": "string", "description": "Source name of the file or directory to move. Source must be local to the current directory."}, "destination": {"type": "string", "description": "The destination name to move the file or directory to. Destination must be local to the current directory and cannot be a path. If destination is not an existing directory like when renaming something, destination is the new file name. "}}, "required": ["source", "destination"]}, "response": {"type": "dict", "properties": {"result": {"type": "string", "description": "The result of the move operation."}}}}
|
12 |
-
{"name": "pwd", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Return the current working directory path.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"current_working_directory": {"type": "string", "description": "The current working directory path."}}}}
|
13 |
-
{"name": "rm", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Remove a file or directory.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the file or directory to remove. "}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {"result": {"type": "string", "description": "The result of the remove operation."}}}}
|
14 |
-
{"name": "rmdir", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Remove a directory at current directory.", "parameters": {"type": "dict", "properties": {"dir_name": {"type": "string", "description": "The name of the directory to remove. Directory must be local to the current directory. "}}, "required": ["dir_name"]}, "response": {"type": "dict", "properties": {"result": {"type": "string", "description": "The result of the remove operation."}}}}
|
15 |
-
{"name": "sort", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Sort the contents of a file line by line.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the file appeared at current directory to sort. "}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {"sorted_content": {"type": "string", "description": "The sorted content of the file."}}}}
|
16 |
-
{"name": "tail", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Display the last part of a file of any extension.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the file to display. No path is allowed and you can only perform on file at local directory."}, "lines": {"type": "integer", "description": "The number of lines to display from the end of the file. Defaults to 10. ", "default": 10}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {"last_lines": {"type": "string", "description": "The last part of the file."}}}}
|
17 |
-
{"name": "touch", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Create a new file of any extension in the current directory.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the new file in the current directory. file_name is local to the current directory and does not allow path."}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {}}}
|
18 |
-
{"name": "wc", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Count the number of lines, words, and characters in a file of any extension from current directory.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "Name of the file of current directory to perform wc operation on."}, "mode": {"type": "string", "description": "Mode of operation ('l' for lines, 'w' for words, 'c' for characters). ", "default": "l"}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {"count": {"type": "integer", "description": "The count of the number of lines, words, or characters in the file."}, "type": {"type": "string", "description": "The type of unit we are counting. [Enum]: [\"lines\", \"words\", \"characters\"]"}}}}
|
|
|
1 |
+
[{"name": "cat", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Display the contents of a file of any extension from currrent directory.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the file from current directory to display. No path is allowed. "}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {"file_content": {"type": "string", "description": "The content of the file."}}}},
|
2 |
+
{"name": "cd", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Change the current working directory to the specified folder.", "parameters": {"type": "dict", "properties": {"folder": {"type": "string", "description": "The folder of the directory to change to. You can only change one folder at a time. "}}, "required": ["folder"]}, "response": {"type": "dict", "properties": {"current_working_directory": {"type": "string", "description": "The new current working directory path."}}}},
|
3 |
+
{"name": "cp", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Copy a file or directory from one location to another. If the destination is a directory, the source file or directory will be copied into the destination directory. Both source and destination must be local to the current directory.", "parameters": {"type": "dict", "properties": {"source": {"type": "string", "description": "The name of the file or directory to copy."}, "destination": {"type": "string", "description": "The destination name to copy the file or directory to. If the destination is a directory, the source will be copied into this directory. No file paths allowed. "}}, "required": ["source", "destination"]}, "response": {"type": "dict", "properties": {"result": {"type": "string", "description": "The result of the copy operation or an error message if the operation fails."}}}},
|
4 |
+
{"name": "diff", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Compare two files of any extension line by line at the current directory.", "parameters": {"type": "dict", "properties": {"file_name1": {"type": "string", "description": "The name of the first file in current directory."}, "file_name2": {"type": "string", "description": "The name of the second file in current directorry. "}}, "required": ["file_name1", "file_name2"]}, "response": {"type": "dict", "properties": {"diff_lines": {"type": "string", "description": "The differences between the two files."}}}},
|
5 |
+
{"name": "du", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Estimate the disk usage of a directory and its contents.", "parameters": {"type": "dict", "properties": {"human_readable": {"type": "boolean", "description": "If True, returns the size in human-readable format (e.g., KB, MB). ", "default": false}}, "required": []}, "response": {"type": "dict", "properties": {"disk_usage": {"type": "string", "description": "The estimated disk usage."}}}},
|
6 |
+
{"name": "echo", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Write content to a file at current directory or display it in the terminal.", "parameters": {"type": "dict", "properties": {"content": {"type": "string", "description": "The content to write or display."}, "file_name": {"type": "string", "description": "The name of the file at current directory to write the content to. Defaults to None. ", "default": "None"}}, "required": ["content"]}, "response": {"type": "dict", "properties": {"terminal_output": {"type": "string", "description": "The content if no file name is provided, or None if written to file."}}}},
|
7 |
+
{"name": "find", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Find any file or directories under specific path that contain name in its file name. This method searches for files of any extension and directories within a specified path that match the given name. If no name is provided, it returns all files and directories in the specified path and its subdirectories. Note: This method performs a recursive search through all subdirectories of the given path.", "parameters": {"type": "dict", "properties": {"path": {"type": "string", "description": "The directory path to start the search. Defaults to the current directory (\".\").", "default": "."}, "name": {"type": "string", "description": "The name of the file or directory to search for. If None, all items are returned. ", "default": "None"}}, "required": []}, "response": {"type": "dict", "properties": {"matches": {"type": "array", "description": "A list of matching file and directory paths relative to the given path.", "items": {"type": "string"}}}}},
|
8 |
+
{"name": "grep", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Search for lines in a file of any extension at current directory that contain the specified pattern.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the file to search. No path is allowed and you can only perform on file at local directory."}, "pattern": {"type": "string", "description": "The pattern to search for. "}}, "required": ["file_name", "pattern"]}, "response": {"type": "dict", "properties": {"matching_lines": {"type": "array", "description": "Lines that match the pattern.", "items": {"type": "string"}}}}},
|
9 |
+
{"name": "ls", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: List the contents of the current directory.", "parameters": {"type": "dict", "properties": {"a": {"type": "boolean", "description": "Show hidden files and directories. Defaults to False. ", "default": false}}, "required": []}, "response": {"type": "dict", "properties": {"current_directory_content": {"type": "array", "description": "A list of the contents of the specified directory.", "items": {"type": "string"}}}}},
|
10 |
+
{"name": "mkdir", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Create a new directory in the current directory.", "parameters": {"type": "dict", "properties": {"dir_name": {"type": "string", "description": "The name of the new directory at current directory. You can only create directory at current directory."}}, "required": ["dir_name"]}, "response": {"type": "dict", "properties": {}}},
|
11 |
+
{"name": "mv", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Move a file or directory from one location to another. so", "parameters": {"type": "dict", "properties": {"source": {"type": "string", "description": "Source name of the file or directory to move. Source must be local to the current directory."}, "destination": {"type": "string", "description": "The destination name to move the file or directory to. Destination must be local to the current directory and cannot be a path. If destination is not an existing directory like when renaming something, destination is the new file name. "}}, "required": ["source", "destination"]}, "response": {"type": "dict", "properties": {"result": {"type": "string", "description": "The result of the move operation."}}}},
|
12 |
+
{"name": "pwd", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Return the current working directory path.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"current_working_directory": {"type": "string", "description": "The current working directory path."}}}},
|
13 |
+
{"name": "rm", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Remove a file or directory.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the file or directory to remove. "}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {"result": {"type": "string", "description": "The result of the remove operation."}}}},
|
14 |
+
{"name": "rmdir", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Remove a directory at current directory.", "parameters": {"type": "dict", "properties": {"dir_name": {"type": "string", "description": "The name of the directory to remove. Directory must be local to the current directory. "}}, "required": ["dir_name"]}, "response": {"type": "dict", "properties": {"result": {"type": "string", "description": "The result of the remove operation."}}}},
|
15 |
+
{"name": "sort", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Sort the contents of a file line by line.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the file appeared at current directory to sort. "}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {"sorted_content": {"type": "string", "description": "The sorted content of the file."}}}},
|
16 |
+
{"name": "tail", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Display the last part of a file of any extension.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the file to display. No path is allowed and you can only perform on file at local directory."}, "lines": {"type": "integer", "description": "The number of lines to display from the end of the file. Defaults to 10. ", "default": 10}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {"last_lines": {"type": "string", "description": "The last part of the file."}}}},
|
17 |
+
{"name": "touch", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Create a new file of any extension in the current directory.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "The name of the new file in the current directory. file_name is local to the current directory and does not allow path."}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {}}},
|
18 |
+
{"name": "wc", "description": "This tool belongs to the Gorilla file system. It is a simple file system that allows users to perform basic file operations such as navigating directories, creating files and directories, reading and writing to files, etc. Tool description: Count the number of lines, words, and characters in a file of any extension from current directory.", "parameters": {"type": "dict", "properties": {"file_name": {"type": "string", "description": "Name of the file of current directory to perform wc operation on."}, "mode": {"type": "string", "description": "Mode of operation ('l' for lines, 'w' for words, 'c' for characters). ", "default": "l"}}, "required": ["file_name"]}, "response": {"type": "dict", "properties": {"count": {"type": "integer", "description": "The count of the number of lines, words, or characters in the file."}, "type": {"type": "string", "description": "The type of unit we are counting. [Enum]: [\"lines\", \"words\", \"characters\"]"}}}}]
|
config/math_api.json
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
{"name": "absolute_value", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the absolute value of a number.", "parameters": {"type": "dict", "properties": {"number": {"type": "float", "description": "The number to calculate the absolute value of. "}}, "required": ["number"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The absolute value of the number."}}}}
|
2 |
-
{"name": "add", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Add two numbers.", "parameters": {"type": "dict", "properties": {"a": {"type": "float", "description": "First number."}, "b": {"type": "float", "description": "Second number. "}}, "required": ["a", "b"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Sum of the two numbers."}}}}
|
3 |
-
{"name": "divide", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Divide one number by another.", "parameters": {"type": "dict", "properties": {"a": {"type": "float", "description": "Numerator."}, "b": {"type": "float", "description": "Denominator. "}}, "required": ["a", "b"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Quotient of the division."}}}}
|
4 |
-
{"name": "imperial_si_conversion", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Convert a value between imperial and SI units.", "parameters": {"type": "dict", "properties": {"value": {"type": "float", "description": "Value to be converted."}, "unit_in": {"type": "string", "description": "Unit of the input value."}, "unit_out": {"type": "string", "description": "Unit to convert the value to. "}}, "required": ["value", "unit_in", "unit_out"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Converted value in the new unit."}}}}
|
5 |
-
{"name": "logarithm", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Compute the logarithm of a number with adjustable precision using mpmath.", "parameters": {"type": "dict", "properties": {"value": {"type": "float", "description": "The number to compute the logarithm of."}, "base": {"type": "float", "description": "The base of the logarithm."}, "precision": {"type": "integer", "description": "Desired precision for the result. "}}, "required": ["value", "base", "precision"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The logarithm of the number with respect to the given base."}}}}
|
6 |
-
{"name": "max_value", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Find the maximum value in a list of numbers.", "parameters": {"type": "dict", "properties": {"numbers": {"type": "array", "items": {"type": "float"}, "description": "List of numbers to find the maximum from. "}}, "required": ["numbers"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The maximum value in the list."}}}}
|
7 |
-
{"name": "mean", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the mean of a list of numbers.", "parameters": {"type": "dict", "properties": {"numbers": {"type": "array", "items": {"type": "float"}, "description": "List of numbers to calculate the mean of. "}}, "required": ["numbers"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Mean of the numbers."}}}}
|
8 |
-
{"name": "min_value", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Find the minimum value in a list of numbers.", "parameters": {"type": "dict", "properties": {"numbers": {"type": "array", "items": {"type": "float"}, "description": "List of numbers to find the minimum from. "}}, "required": ["numbers"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The minimum value in the list."}}}}
|
9 |
-
{"name": "multiply", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Multiply two numbers.", "parameters": {"type": "dict", "properties": {"a": {"type": "float", "description": "First number."}, "b": {"type": "float", "description": "Second number. "}}, "required": ["a", "b"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Product of the two numbers."}}}}
|
10 |
-
{"name": "percentage", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the percentage of a part relative to a whole.", "parameters": {"type": "dict", "properties": {"part": {"type": "float", "description": "The part value."}, "whole": {"type": "float", "description": "The whole value. "}}, "required": ["part", "whole"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The percentage of the part relative to the whole."}}}}
|
11 |
-
{"name": "power", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Raise a number to a power.", "parameters": {"type": "dict", "properties": {"base": {"type": "float", "description": "The base number."}, "exponent": {"type": "float", "description": "The exponent. "}}, "required": ["base", "exponent"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The base raised to the power of the exponent."}}}}
|
12 |
-
{"name": "round_number", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Round a number to a specified number of decimal places.", "parameters": {"type": "dict", "properties": {"number": {"type": "float", "description": "The number to round."}, "decimal_places": {"type": "integer", "description": "The number of decimal places to round to. Defaults to 0. ", "default": 0}}, "required": ["number"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The rounded number."}}}}
|
13 |
-
{"name": "si_unit_conversion", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Convert a value from one SI unit to another.", "parameters": {"type": "dict", "properties": {"value": {"type": "float", "description": "Value to be converted."}, "unit_in": {"type": "string", "description": "Unit of the input value."}, "unit_out": {"type": "string", "description": "Unit to convert the value to. "}}, "required": ["value", "unit_in", "unit_out"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Converted value in the new unit."}}}}
|
14 |
-
{"name": "square_root", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the square root of a number with adjustable precision using the decimal module.", "parameters": {"type": "dict", "properties": {"number": {"type": "float", "description": "The number to calculate the square root of."}, "precision": {"type": "integer", "description": "Desired precision for the result. "}}, "required": ["number", "precision"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The square root of the number, or an error message."}}}}
|
15 |
-
{"name": "standard_deviation", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the standard deviation of a list of numbers.", "parameters": {"type": "dict", "properties": {"numbers": {"type": "array", "items": {"type": "float"}, "description": "List of numbers to calculate the standard deviation of. "}}, "required": ["numbers"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Standard deviation of the numbers."}}}}
|
16 |
-
{"name": "subtract", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Subtract one number from another.", "parameters": {"type": "dict", "properties": {"a": {"type": "float", "description": "Number to subtract from."}, "b": {"type": "float", "description": "Number to subtract. "}}, "required": ["a", "b"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Difference between the two numbers."}}}}
|
17 |
-
{"name": "sum_values", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the sum of a list of numbers.", "parameters": {"type": "dict", "properties": {"numbers": {"type": "array", "items": {"type": "float"}, "description": "List of numbers to sum. "}}, "required": ["numbers"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The sum of all numbers in the list."}}}}
|
|
|
1 |
+
[{"name": "absolute_value", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the absolute value of a number.", "parameters": {"type": "dict", "properties": {"number": {"type": "float", "description": "The number to calculate the absolute value of. "}}, "required": ["number"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The absolute value of the number."}}}},
|
2 |
+
{"name": "add", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Add two numbers.", "parameters": {"type": "dict", "properties": {"a": {"type": "float", "description": "First number."}, "b": {"type": "float", "description": "Second number. "}}, "required": ["a", "b"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Sum of the two numbers."}}}},
|
3 |
+
{"name": "divide", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Divide one number by another.", "parameters": {"type": "dict", "properties": {"a": {"type": "float", "description": "Numerator."}, "b": {"type": "float", "description": "Denominator. "}}, "required": ["a", "b"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Quotient of the division."}}}},
|
4 |
+
{"name": "imperial_si_conversion", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Convert a value between imperial and SI units.", "parameters": {"type": "dict", "properties": {"value": {"type": "float", "description": "Value to be converted."}, "unit_in": {"type": "string", "description": "Unit of the input value."}, "unit_out": {"type": "string", "description": "Unit to convert the value to. "}}, "required": ["value", "unit_in", "unit_out"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Converted value in the new unit."}}}},
|
5 |
+
{"name": "logarithm", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Compute the logarithm of a number with adjustable precision using mpmath.", "parameters": {"type": "dict", "properties": {"value": {"type": "float", "description": "The number to compute the logarithm of."}, "base": {"type": "float", "description": "The base of the logarithm."}, "precision": {"type": "integer", "description": "Desired precision for the result. "}}, "required": ["value", "base", "precision"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The logarithm of the number with respect to the given base."}}}},
|
6 |
+
{"name": "max_value", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Find the maximum value in a list of numbers.", "parameters": {"type": "dict", "properties": {"numbers": {"type": "array", "items": {"type": "float"}, "description": "List of numbers to find the maximum from. "}}, "required": ["numbers"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The maximum value in the list."}}}},
|
7 |
+
{"name": "mean", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the mean of a list of numbers.", "parameters": {"type": "dict", "properties": {"numbers": {"type": "array", "items": {"type": "float"}, "description": "List of numbers to calculate the mean of. "}}, "required": ["numbers"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Mean of the numbers."}}}},
|
8 |
+
{"name": "min_value", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Find the minimum value in a list of numbers.", "parameters": {"type": "dict", "properties": {"numbers": {"type": "array", "items": {"type": "float"}, "description": "List of numbers to find the minimum from. "}}, "required": ["numbers"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The minimum value in the list."}}}},
|
9 |
+
{"name": "multiply", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Multiply two numbers.", "parameters": {"type": "dict", "properties": {"a": {"type": "float", "description": "First number."}, "b": {"type": "float", "description": "Second number. "}}, "required": ["a", "b"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Product of the two numbers."}}}},
|
10 |
+
{"name": "percentage", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the percentage of a part relative to a whole.", "parameters": {"type": "dict", "properties": {"part": {"type": "float", "description": "The part value."}, "whole": {"type": "float", "description": "The whole value. "}}, "required": ["part", "whole"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The percentage of the part relative to the whole."}}}},
|
11 |
+
{"name": "power", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Raise a number to a power.", "parameters": {"type": "dict", "properties": {"base": {"type": "float", "description": "The base number."}, "exponent": {"type": "float", "description": "The exponent. "}}, "required": ["base", "exponent"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The base raised to the power of the exponent."}}}},
|
12 |
+
{"name": "round_number", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Round a number to a specified number of decimal places.", "parameters": {"type": "dict", "properties": {"number": {"type": "float", "description": "The number to round."}, "decimal_places": {"type": "integer", "description": "The number of decimal places to round to. Defaults to 0. ", "default": 0}}, "required": ["number"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The rounded number."}}}},
|
13 |
+
{"name": "si_unit_conversion", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Convert a value from one SI unit to another.", "parameters": {"type": "dict", "properties": {"value": {"type": "float", "description": "Value to be converted."}, "unit_in": {"type": "string", "description": "Unit of the input value."}, "unit_out": {"type": "string", "description": "Unit to convert the value to. "}}, "required": ["value", "unit_in", "unit_out"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Converted value in the new unit."}}}},
|
14 |
+
{"name": "square_root", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the square root of a number with adjustable precision using the decimal module.", "parameters": {"type": "dict", "properties": {"number": {"type": "float", "description": "The number to calculate the square root of."}, "precision": {"type": "integer", "description": "Desired precision for the result. "}}, "required": ["number", "precision"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The square root of the number, or an error message."}}}},
|
15 |
+
{"name": "standard_deviation", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the standard deviation of a list of numbers.", "parameters": {"type": "dict", "properties": {"numbers": {"type": "array", "items": {"type": "float"}, "description": "List of numbers to calculate the standard deviation of. "}}, "required": ["numbers"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Standard deviation of the numbers."}}}},
|
16 |
+
{"name": "subtract", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Subtract one number from another.", "parameters": {"type": "dict", "properties": {"a": {"type": "float", "description": "Number to subtract from."}, "b": {"type": "float", "description": "Number to subtract. "}}, "required": ["a", "b"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "Difference between the two numbers."}}}},
|
17 |
+
{"name": "sum_values", "description": "This tool belongs to the Math API, which provides various mathematical operations. Tool description: Calculate the sum of a list of numbers.", "parameters": {"type": "dict", "properties": {"numbers": {"type": "array", "items": {"type": "float"}, "description": "List of numbers to sum. "}}, "required": ["numbers"]}, "response": {"type": "dict", "properties": {"result": {"type": "float", "description": "The sum of all numbers in the list."}}}}]
|
config/message_api.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
{"name": "add_contact", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Add a contact to the workspace.", "parameters": {"type": "dict", "properties": {"user_name": {"type": "string", "description": "User name of contact to be added."}}, "required": ["user_name"]}, "response": {"type": "dict", "properties": {"added_status": {"type": "boolean", "description": "True if the contact was added successfully, False otherwise."}, "user_id": {"type": "string", "description": "User ID of the added contact."}, "message": {"type": "string", "description": "A message describing the result of the addition attempt."}}}}
|
2 |
-
{"name": "delete_message", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Delete the latest message sent to a receiver.", "parameters": {"type": "dict", "properties": {"receiver_id": {"type": "string", "description": "User ID of the user to send the message to."}, "message_id": {"type": "integer", "description": "ID of the message to be deleted."}}, "required": ["receiver_id"]}, "response": {"type": "dict", "properties": {"deleted_status": {"type": "boolean", "description": "True if the message was deleted successfully, False otherwise."}, "message_id": {"type": "integer", "description": "ID of the deleted message."}, "message": {"type": "string", "description": "A message describing the result of the deletion attempt."}}}}
|
3 |
-
{"name": "get_message_stats", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Get statistics about messages for the current user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"stats": {"type": "dict", "description": "Dictionary containing message statistics.", "properties": {"received_count": {"type": "integer", "description": "Number of messages received by the current user."}, "total_contacts": {"type": "integer", "description": "Total number of contacts the user has interacted with."}}}}}}
|
4 |
-
{"name": "get_user_id", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Get user ID from user name.", "parameters": {"type": "dict", "properties": {"user": {"type": "string", "description": "User name of the user. "}}, "required": ["user"]}, "response": {"type": "dict", "properties": {"user_id": {"type": "string", "description": "User ID of the user"}}}}
|
5 |
-
{"name": "list_users", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: List all users in the workspace.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"user_list": {"type": "array", "description": "List of all users in the workspace.", "items": {"type": "string"}}}}}
|
6 |
-
{"name": "message_get_login_status", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Get the login status of the current user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"login_status": {"type": "boolean", "description": "True if the current user is logged in, False otherwise."}}}}
|
7 |
-
{"name": "message_login", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Log in a user with the given user ID to messeage application.", "parameters": {"type": "dict", "properties": {"user_id": {"type": "string", "description": "User ID of the user to log in. "}}, "required": ["user_id"]}, "response": {"type": "dict", "properties": {"login_status": {"type": "boolean", "description": "True if login was successful, False otherwise."}, "message": {"type": "string", "description": "A message describing the result of the login attempt."}}}}
|
8 |
-
{"name": "search_messages", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Search for messages containing a specific keyword.", "parameters": {"type": "dict", "properties": {"keyword": {"type": "string", "description": "The keyword to search for in messages."}}, "required": ["keyword"]}, "response": {"type": "dict", "properties": {"results": {"type": "array", "description": "List of dictionaries containing matching messages.", "items": {"type": "dict", "properties": {"receiver_id": {"type": "string", "description": "User ID of the receiver of the message."}, "message": {"type": "string", "description": "The message containing the keyword."}}}}}}}
|
9 |
-
{"name": "send_message", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Send a message to a user.", "parameters": {"type": "dict", "properties": {"receiver_id": {"type": "string", "description": "User ID of the user to send the message to."}, "message": {"type": "string", "description": "Message to be sent."}}, "required": ["receiver_id", "message"]}, "response": {"type": "dict", "properties": {"sent_status": {"type": "boolean", "description": "True if the message was sent successfully, False otherwise."}, "message_id": {"type": "integer", "description": "ID of the sent message."}, "message": {"type": "string", "description": "A message describing the result of the send attempt."}}}}
|
10 |
-
{"name": "view_messages_sent", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: View all historical messages sent by the current user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"messages": {"type": "dict", "description": "Dictionary of messages grouped by receiver An example of the messages dictionary is {\"USR001\":[\"Hello\"],\"USR002\":[\"World\"]}."}}}}
|
|
|
1 |
+
[{"name": "add_contact", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Add a contact to the workspace.", "parameters": {"type": "dict", "properties": {"user_name": {"type": "string", "description": "User name of contact to be added."}}, "required": ["user_name"]}, "response": {"type": "dict", "properties": {"added_status": {"type": "boolean", "description": "True if the contact was added successfully, False otherwise."}, "user_id": {"type": "string", "description": "User ID of the added contact."}, "message": {"type": "string", "description": "A message describing the result of the addition attempt."}}}},
|
2 |
+
{"name": "delete_message", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Delete the latest message sent to a receiver.", "parameters": {"type": "dict", "properties": {"receiver_id": {"type": "string", "description": "User ID of the user to send the message to."}, "message_id": {"type": "integer", "description": "ID of the message to be deleted."}}, "required": ["receiver_id"]}, "response": {"type": "dict", "properties": {"deleted_status": {"type": "boolean", "description": "True if the message was deleted successfully, False otherwise."}, "message_id": {"type": "integer", "description": "ID of the deleted message."}, "message": {"type": "string", "description": "A message describing the result of the deletion attempt."}}}},
|
3 |
+
{"name": "get_message_stats", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Get statistics about messages for the current user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"stats": {"type": "dict", "description": "Dictionary containing message statistics.", "properties": {"received_count": {"type": "integer", "description": "Number of messages received by the current user."}, "total_contacts": {"type": "integer", "description": "Total number of contacts the user has interacted with."}}}}}},
|
4 |
+
{"name": "get_user_id", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Get user ID from user name.", "parameters": {"type": "dict", "properties": {"user": {"type": "string", "description": "User name of the user. "}}, "required": ["user"]}, "response": {"type": "dict", "properties": {"user_id": {"type": "string", "description": "User ID of the user"}}}},
|
5 |
+
{"name": "list_users", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: List all users in the workspace.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"user_list": {"type": "array", "description": "List of all users in the workspace.", "items": {"type": "string"}}}}},
|
6 |
+
{"name": "message_get_login_status", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Get the login status of the current user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"login_status": {"type": "boolean", "description": "True if the current user is logged in, False otherwise."}}}},
|
7 |
+
{"name": "message_login", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Log in a user with the given user ID to messeage application.", "parameters": {"type": "dict", "properties": {"user_id": {"type": "string", "description": "User ID of the user to log in. "}}, "required": ["user_id"]}, "response": {"type": "dict", "properties": {"login_status": {"type": "boolean", "description": "True if login was successful, False otherwise."}, "message": {"type": "string", "description": "A message describing the result of the login attempt."}}}},
|
8 |
+
{"name": "search_messages", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Search for messages containing a specific keyword.", "parameters": {"type": "dict", "properties": {"keyword": {"type": "string", "description": "The keyword to search for in messages."}}, "required": ["keyword"]}, "response": {"type": "dict", "properties": {"results": {"type": "array", "description": "List of dictionaries containing matching messages.", "items": {"type": "dict", "properties": {"receiver_id": {"type": "string", "description": "User ID of the receiver of the message."}, "message": {"type": "string", "description": "The message containing the keyword."}}}}}}},
|
9 |
+
{"name": "send_message", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: Send a message to a user.", "parameters": {"type": "dict", "properties": {"receiver_id": {"type": "string", "description": "User ID of the user to send the message to."}, "message": {"type": "string", "description": "Message to be sent."}}, "required": ["receiver_id", "message"]}, "response": {"type": "dict", "properties": {"sent_status": {"type": "boolean", "description": "True if the message was sent successfully, False otherwise."}, "message_id": {"type": "integer", "description": "ID of the sent message."}, "message": {"type": "string", "description": "A message describing the result of the send attempt."}}}},
|
10 |
+
{"name": "view_messages_sent", "description": "This tool belongs to the Message API, which is used to manage user interactions in a workspace. Tool description: View all historical messages sent by the current user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"messages": {"type": "dict", "description": "Dictionary of messages grouped by receiver An example of the messages dictionary is {\"USR001\":[\"Hello\"],\"USR002\":[\"World\"]}."}}}}]
|
config/posting_api.json
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
{"name": "authenticate_twitter", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Authenticate a user with username and password.", "parameters": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username of the user."}, "password": {"type": "string", "description": "Password of the user."}}, "required": ["username", "password"]}, "response": {"type": "dict", "properties": {"authentication_status": {"type": "boolean", "description": "True if authenticated, False otherwise."}}}}
|
2 |
-
{"name": "comment", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Comment on a tweet for the authenticated user.", "parameters": {"type": "dict", "properties": {"tweet_id": {"type": "integer", "description": "ID of the tweet to comment on."}, "comment_content": {"type": "string", "description": "Content of the comment."}}, "required": ["tweet_id", "comment_content"]}, "response": {"type": "dict", "properties": {"comment_status": {"type": "string", "description": "Status of the comment action."}}}}
|
3 |
-
{"name": "follow_user", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Follow a user for the authenticated user.", "parameters": {"type": "dict", "properties": {"username_to_follow": {"type": "string", "description": "Username of the user to follow."}}, "required": ["username_to_follow"]}, "response": {"type": "dict", "properties": {"follow_status": {"type": "boolean", "description": "True if followed, False if already following."}}}}
|
4 |
-
{"name": "get_tweet", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Retrieve a specific tweet.", "parameters": {"type": "dict", "properties": {"tweet_id": {"type": "integer", "description": "ID of the tweet to retrieve."}}, "required": ["tweet_id"]}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "ID of the retrieved tweet."}, "username": {"type": "string", "description": "Username of the tweet's author."}, "content": {"type": "string", "description": "Content of the tweet."}, "tags": {"type": "array", "description": "List of tags associated with the tweet.", "items": {"type": "string"}}, "mentions": {"type": "array", "description": "List of users mentioned in the tweet.", "items": {"type": "string"}}}}}
|
5 |
-
{"name": "get_tweet_comments", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Retrieve all comments for a specific tweet.", "parameters": {"type": "dict", "properties": {"tweet_id": {"type": "integer", "description": "ID of the tweet to retrieve comments for."}}, "required": ["tweet_id"]}, "response": {"type": "dict", "properties": {"comments": {"type": "array", "description": "List of dictionaries, each containing comment information.", "items": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username of the commenter."}, "content": {"type": "string", "description": "Content of the comment."}}}}}}}
|
6 |
-
{"name": "get_user_stats", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Get statistics for a specific user.", "parameters": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username of the user to get statistics for."}}, "required": ["username"]}, "response": {"type": "dict", "properties": {"tweet_count": {"type": "integer", "description": "Number of tweets posted by the user."}, "following_count": {"type": "integer", "description": "Number of users the specified user is following."}, "retweet_count": {"type": "integer", "description": "Number of retweets made by the user."}}}}
|
7 |
-
{"name": "get_user_tweets", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Retrieve all tweets from a specific user.", "parameters": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username of the user whose tweets to retrieve."}}, "required": ["username"]}, "response": {"type": "dict", "properties": {"user_tweets": {"type": "array", "description": "List of dictionaries, each containing tweet information.", "items": {"type": "dict", "properties": {"id": {"type": "integer", "description": "ID of the retrieved tweet."}, "username": {"type": "string", "description": "Username of the tweet's author."}, "content": {"type": "string", "description": "Content of the tweet."}, "tags": {"type": "array", "description": "List of tags associated with the tweet.", "items": {"type": "string"}}, "mentions": {"type": "array", "description": "List of users mentioned in the tweet.", "items": {"type": "string"}}}}}}}}
|
8 |
-
{"name": "list_all_following", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: List all users that the authenticated user is following.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"following_list": {"type": "array", "description": "List of all users that the authenticated user is following.", "items": {"type": "string"}}}}}
|
9 |
-
{"name": "mention", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Mention specified users in a tweet.", "parameters": {"type": "dict", "properties": {"tweet_id": {"type": "integer", "description": "ID of the tweet where users are mentioned."}, "mentioned_usernames": {"type": "array", "items": {"type": "string"}, "description": "List of usernames to be mentioned."}}, "required": ["tweet_id", "mentioned_usernames"]}, "response": {"type": "dict", "properties": {"mention_status": {"type": "string", "description": "Status of the mention action."}}}}
|
10 |
-
{"name": "post_tweet", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Post a tweet for the authenticated user.", "parameters": {"type": "dict", "properties": {"content": {"type": "string", "description": "Content of the tweet."}, "tags": {"type": "array", "items": {"type": "string"}, "description": "List of tags for the tweet. Tag name should start with #. This is only relevant if the user wants to add tags to the tweet.", "default": []}, "mentions": {"type": "array", "items": {"type": "string"}, "description": "List of users mentioned in the tweet. Mention name should start with @. This is only relevant if the user wants to add mentions to the tweet.", "default": []}}, "required": ["content"]}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "ID of the posted tweet."}, "username": {"type": "string", "description": "Username of the poster."}, "content": {"type": "string", "description": "Content of the tweet."}, "tags": {"type": "array", "description": "List of tags associated with the tweet.", "items": {"type": "string"}}, "mentions": {"type": "array", "description": "List of users mentioned in the tweet.", "items": {"type": "string"}}}}}
|
11 |
-
{"name": "posting_get_login_status", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Get the login status of the current user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"login_status": {"type": "boolean", "description": "True if the current user is logged in, False otherwise."}}}}
|
12 |
-
{"name": "retweet", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Retweet a tweet for the authenticated user.", "parameters": {"type": "dict", "properties": {"tweet_id": {"type": "integer", "description": "ID of the tweet to retweet."}}, "required": ["tweet_id"]}, "response": {"type": "dict", "properties": {"retweet_status": {"type": "string", "description": "Status of the retweet action."}}}}
|
13 |
-
{"name": "search_tweets", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Search for tweets containing a specific keyword.", "parameters": {"type": "dict", "properties": {"keyword": {"type": "string", "description": "Keyword to search for in the content of the tweets."}}, "required": ["keyword"]}, "response": {"type": "dict", "properties": {"matching_tweets": {"type": "array", "description": "List of dictionaries, each containing tweet information.", "items": {"type": "dict", "properties": {"id": {"type": "integer", "description": "ID of the retrieved tweet."}, "username": {"type": "string", "description": "Username of the tweet's author."}, "content": {"type": "string", "description": "Content of the tweet."}, "tags": {"type": "array", "description": "List of tags associated with the tweet.", "items": {"type": "string"}}, "mentions": {"type": "array", "description": "List of users mentioned in the tweet.", "items": {"type": "string"}}}}}}}}
|
14 |
-
{"name": "unfollow_user", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Unfollow a user for the authenticated user.", "parameters": {"type": "dict", "properties": {"username_to_unfollow": {"type": "string", "description": "Username of the user to unfollow."}}, "required": ["username_to_unfollow"]}, "response": {"type": "dict", "properties": {"unfollow_status": {"type": "boolean", "description": "True if unfollowed, False if not following."}}}}
|
|
|
1 |
+
[{"name": "authenticate_twitter", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Authenticate a user with username and password.", "parameters": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username of the user."}, "password": {"type": "string", "description": "Password of the user."}}, "required": ["username", "password"]}, "response": {"type": "dict", "properties": {"authentication_status": {"type": "boolean", "description": "True if authenticated, False otherwise."}}}},
|
2 |
+
{"name": "comment", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Comment on a tweet for the authenticated user.", "parameters": {"type": "dict", "properties": {"tweet_id": {"type": "integer", "description": "ID of the tweet to comment on."}, "comment_content": {"type": "string", "description": "Content of the comment."}}, "required": ["tweet_id", "comment_content"]}, "response": {"type": "dict", "properties": {"comment_status": {"type": "string", "description": "Status of the comment action."}}}},
|
3 |
+
{"name": "follow_user", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Follow a user for the authenticated user.", "parameters": {"type": "dict", "properties": {"username_to_follow": {"type": "string", "description": "Username of the user to follow."}}, "required": ["username_to_follow"]}, "response": {"type": "dict", "properties": {"follow_status": {"type": "boolean", "description": "True if followed, False if already following."}}}},
|
4 |
+
{"name": "get_tweet", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Retrieve a specific tweet.", "parameters": {"type": "dict", "properties": {"tweet_id": {"type": "integer", "description": "ID of the tweet to retrieve."}}, "required": ["tweet_id"]}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "ID of the retrieved tweet."}, "username": {"type": "string", "description": "Username of the tweet's author."}, "content": {"type": "string", "description": "Content of the tweet."}, "tags": {"type": "array", "description": "List of tags associated with the tweet.", "items": {"type": "string"}}, "mentions": {"type": "array", "description": "List of users mentioned in the tweet.", "items": {"type": "string"}}}}},
|
5 |
+
{"name": "get_tweet_comments", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Retrieve all comments for a specific tweet.", "parameters": {"type": "dict", "properties": {"tweet_id": {"type": "integer", "description": "ID of the tweet to retrieve comments for."}}, "required": ["tweet_id"]}, "response": {"type": "dict", "properties": {"comments": {"type": "array", "description": "List of dictionaries, each containing comment information.", "items": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username of the commenter."}, "content": {"type": "string", "description": "Content of the comment."}}}}}}},
|
6 |
+
{"name": "get_user_stats", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Get statistics for a specific user.", "parameters": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username of the user to get statistics for."}}, "required": ["username"]}, "response": {"type": "dict", "properties": {"tweet_count": {"type": "integer", "description": "Number of tweets posted by the user."}, "following_count": {"type": "integer", "description": "Number of users the specified user is following."}, "retweet_count": {"type": "integer", "description": "Number of retweets made by the user."}}}},
|
7 |
+
{"name": "get_user_tweets", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Retrieve all tweets from a specific user.", "parameters": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username of the user whose tweets to retrieve."}}, "required": ["username"]}, "response": {"type": "dict", "properties": {"user_tweets": {"type": "array", "description": "List of dictionaries, each containing tweet information.", "items": {"type": "dict", "properties": {"id": {"type": "integer", "description": "ID of the retrieved tweet."}, "username": {"type": "string", "description": "Username of the tweet's author."}, "content": {"type": "string", "description": "Content of the tweet."}, "tags": {"type": "array", "description": "List of tags associated with the tweet.", "items": {"type": "string"}}, "mentions": {"type": "array", "description": "List of users mentioned in the tweet.", "items": {"type": "string"}}}}}}}},
|
8 |
+
{"name": "list_all_following", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: List all users that the authenticated user is following.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"following_list": {"type": "array", "description": "List of all users that the authenticated user is following.", "items": {"type": "string"}}}}},
|
9 |
+
{"name": "mention", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Mention specified users in a tweet.", "parameters": {"type": "dict", "properties": {"tweet_id": {"type": "integer", "description": "ID of the tweet where users are mentioned."}, "mentioned_usernames": {"type": "array", "items": {"type": "string"}, "description": "List of usernames to be mentioned."}}, "required": ["tweet_id", "mentioned_usernames"]}, "response": {"type": "dict", "properties": {"mention_status": {"type": "string", "description": "Status of the mention action."}}}},
|
10 |
+
{"name": "post_tweet", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Post a tweet for the authenticated user.", "parameters": {"type": "dict", "properties": {"content": {"type": "string", "description": "Content of the tweet."}, "tags": {"type": "array", "items": {"type": "string"}, "description": "List of tags for the tweet. Tag name should start with #. This is only relevant if the user wants to add tags to the tweet.", "default": []}, "mentions": {"type": "array", "items": {"type": "string"}, "description": "List of users mentioned in the tweet. Mention name should start with @. This is only relevant if the user wants to add mentions to the tweet.", "default": []}}, "required": ["content"]}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "ID of the posted tweet."}, "username": {"type": "string", "description": "Username of the poster."}, "content": {"type": "string", "description": "Content of the tweet."}, "tags": {"type": "array", "description": "List of tags associated with the tweet.", "items": {"type": "string"}}, "mentions": {"type": "array", "description": "List of users mentioned in the tweet.", "items": {"type": "string"}}}}},
|
11 |
+
{"name": "posting_get_login_status", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Get the login status of the current user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"login_status": {"type": "boolean", "description": "True if the current user is logged in, False otherwise."}}}},
|
12 |
+
{"name": "retweet", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Retweet a tweet for the authenticated user.", "parameters": {"type": "dict", "properties": {"tweet_id": {"type": "integer", "description": "ID of the tweet to retweet."}}, "required": ["tweet_id"]}, "response": {"type": "dict", "properties": {"retweet_status": {"type": "string", "description": "Status of the retweet action."}}}},
|
13 |
+
{"name": "search_tweets", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Search for tweets containing a specific keyword.", "parameters": {"type": "dict", "properties": {"keyword": {"type": "string", "description": "Keyword to search for in the content of the tweets."}}, "required": ["keyword"]}, "response": {"type": "dict", "properties": {"matching_tweets": {"type": "array", "description": "List of dictionaries, each containing tweet information.", "items": {"type": "dict", "properties": {"id": {"type": "integer", "description": "ID of the retrieved tweet."}, "username": {"type": "string", "description": "Username of the tweet's author."}, "content": {"type": "string", "description": "Content of the tweet."}, "tags": {"type": "array", "description": "List of tags associated with the tweet.", "items": {"type": "string"}}, "mentions": {"type": "array", "description": "List of users mentioned in the tweet.", "items": {"type": "string"}}}}}}}},
|
14 |
+
{"name": "unfollow_user", "description": "This tool belongs to the TwitterAPI, which provides core functionality for posting tweets, retweeting, commenting, and following users on Twitter. Tool description: Unfollow a user for the authenticated user.", "parameters": {"type": "dict", "properties": {"username_to_unfollow": {"type": "string", "description": "Username of the user to unfollow."}}, "required": ["username_to_unfollow"]}, "response": {"type": "dict", "properties": {"unfollow_status": {"type": "boolean", "description": "True if unfollowed, False if not following."}}}}]
|
config/ticket_api.json
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
{"name": "close_ticket", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Close a ticket.", "parameters": {"type": "dict", "properties": {"ticket_id": {"type": "integer", "description": "ID of the ticket to be closed. "}}, "required": ["ticket_id"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the close operation."}}}}
|
2 |
-
{"name": "create_ticket", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Create a ticket in the system and queue it.", "parameters": {"type": "dict", "properties": {"title": {"type": "string", "description": "Title of the ticket."}, "description": {"type": "string", "description": "Description of the ticket. Defaults to an empty string.", "default": ""}, "priority": {"type": "integer", "description": "Priority of the ticket, from 1 to 5. Defaults to 1. 5 is the highest priority. ", "default": 1}}, "required": ["title"]}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "Unique identifier of the ticket."}, "title": {"type": "string", "description": "Title of the ticket."}, "description": {"type": "string", "description": "Description of the ticket."}, "status": {"type": "string", "description": "Current status of the ticket."}, "priority": {"type": "integer", "description": "Priority level of the ticket."}}}}
|
3 |
-
{"name": "edit_ticket", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Modify the details of an existing ticket.", "parameters": {"type": "dict", "properties": {"ticket_id": {"type": "integer", "description": "ID of the ticket to be changed."}, "updates": {"type": "dict", "description": "Dictionary containing the fields to be updated. - title (str) : [Optional] New title for the ticket. ", "properties": {"description": {"type": "string", "description": "New description for the ticket."}, "status": {"type": "string", "description": "New status for the ticket."}, "priority": {"type": "integer", "description": "New priority for the ticket."}}}}, "required": ["ticket_id", "updates"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the update operation."}}}}
|
4 |
-
{"name": "get_ticket", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Get a specific ticket by its ID.", "parameters": {"type": "dict", "properties": {"ticket_id": {"type": "integer", "description": "ID of the ticket to retrieve. "}}, "required": ["ticket_id"]}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "Unique identifier of the ticket."}, "title": {"type": "string", "description": "Title of the ticket."}, "description": {"type": "string", "description": "Description of the ticket."}, "status": {"type": "string", "description": "Current status of the ticket."}, "priority": {"type": "integer", "description": "Priority level of the ticket."}, "created_by": {"type": "string", "description": "Username of the ticket creator."}}}}
|
5 |
-
{"name": "get_user_tickets", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Get all tickets created by the current user, optionally filtered by status.", "parameters": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status to filter tickets by. If None, return all tickets. ", "default": "None"}}, "required": []}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "Unique identifier of the ticket."}, "title": {"type": "string", "description": "Title of the ticket."}, "description": {"type": "string", "description": "Description of the ticket."}, "status": {"type": "string", "description": "Current status of the ticket."}, "priority": {"type": "integer", "description": "Priority level of the ticket."}, "created_by": {"type": "string", "description": "Username of the ticket"}}}}
|
6 |
-
{"name": "logout", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Log out the current user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"success": {"type": "boolean", "description": "True if logout was successful, False otherwise."}}}}
|
7 |
-
{"name": "resolve_ticket", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Resolve a ticket with a resolution.", "parameters": {"type": "dict", "properties": {"ticket_id": {"type": "integer", "description": "ID of the ticket to be resolved."}, "resolution": {"type": "string", "description": "Resolution details for the ticket. "}}, "required": ["ticket_id", "resolution"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the resolve operation."}}}}
|
8 |
-
{"name": "ticket_get_login_status", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Get the username of the currently authenticated user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"username": {"type": "boolean", "description": "True if a user is logged in, False otherwise."}}}}
|
9 |
-
{"name": "ticket_login", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Authenticate a user for ticket system.", "parameters": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username of the user."}, "password": {"type": "string", "description": "Password of the user. "}}, "required": ["username", "password"]}, "response": {"type": "dict", "properties": {"success": {"type": "boolean", "description": "True if login was successful, False otherwise."}}}}
|
|
|
1 |
+
[{"name": "close_ticket", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Close a ticket.", "parameters": {"type": "dict", "properties": {"ticket_id": {"type": "integer", "description": "ID of the ticket to be closed. "}}, "required": ["ticket_id"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the close operation."}}}},
|
2 |
+
{"name": "create_ticket", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Create a ticket in the system and queue it.", "parameters": {"type": "dict", "properties": {"title": {"type": "string", "description": "Title of the ticket."}, "description": {"type": "string", "description": "Description of the ticket. Defaults to an empty string.", "default": ""}, "priority": {"type": "integer", "description": "Priority of the ticket, from 1 to 5. Defaults to 1. 5 is the highest priority. ", "default": 1}}, "required": ["title"]}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "Unique identifier of the ticket."}, "title": {"type": "string", "description": "Title of the ticket."}, "description": {"type": "string", "description": "Description of the ticket."}, "status": {"type": "string", "description": "Current status of the ticket."}, "priority": {"type": "integer", "description": "Priority level of the ticket."}}}},
|
3 |
+
{"name": "edit_ticket", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Modify the details of an existing ticket.", "parameters": {"type": "dict", "properties": {"ticket_id": {"type": "integer", "description": "ID of the ticket to be changed."}, "updates": {"type": "dict", "description": "Dictionary containing the fields to be updated. - title (str) : [Optional] New title for the ticket. ", "properties": {"description": {"type": "string", "description": "New description for the ticket."}, "status": {"type": "string", "description": "New status for the ticket."}, "priority": {"type": "integer", "description": "New priority for the ticket."}}}}, "required": ["ticket_id", "updates"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the update operation."}}}},
|
4 |
+
{"name": "get_ticket", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Get a specific ticket by its ID.", "parameters": {"type": "dict", "properties": {"ticket_id": {"type": "integer", "description": "ID of the ticket to retrieve. "}}, "required": ["ticket_id"]}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "Unique identifier of the ticket."}, "title": {"type": "string", "description": "Title of the ticket."}, "description": {"type": "string", "description": "Description of the ticket."}, "status": {"type": "string", "description": "Current status of the ticket."}, "priority": {"type": "integer", "description": "Priority level of the ticket."}, "created_by": {"type": "string", "description": "Username of the ticket creator."}}}},
|
5 |
+
{"name": "get_user_tickets", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Get all tickets created by the current user, optionally filtered by status.", "parameters": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status to filter tickets by. If None, return all tickets. ", "default": "None"}}, "required": []}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "Unique identifier of the ticket."}, "title": {"type": "string", "description": "Title of the ticket."}, "description": {"type": "string", "description": "Description of the ticket."}, "status": {"type": "string", "description": "Current status of the ticket."}, "priority": {"type": "integer", "description": "Priority level of the ticket."}, "created_by": {"type": "string", "description": "Username of the ticket"}}}},
|
6 |
+
{"name": "logout", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Log out the current user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"success": {"type": "boolean", "description": "True if logout was successful, False otherwise."}}}},
|
7 |
+
{"name": "resolve_ticket", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Resolve a ticket with a resolution.", "parameters": {"type": "dict", "properties": {"ticket_id": {"type": "integer", "description": "ID of the ticket to be resolved."}, "resolution": {"type": "string", "description": "Resolution details for the ticket. "}}, "required": ["ticket_id", "resolution"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the resolve operation."}}}},
|
8 |
+
{"name": "ticket_get_login_status", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Get the username of the currently authenticated user.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"username": {"type": "boolean", "description": "True if a user is logged in, False otherwise."}}}},
|
9 |
+
{"name": "ticket_login", "description": "This tool belongs to the ticketing system that is part of a company, which allows users to create, view, and manage support business tickets. Tool description: Authenticate a user for ticket system.", "parameters": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username of the user."}, "password": {"type": "string", "description": "Password of the user. "}}, "required": ["username", "password"]}, "response": {"type": "dict", "properties": {"success": {"type": "boolean", "description": "True if login was successful, False otherwise."}}}}]
|
config/trading_bot.json
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
{"name": "add_to_watchlist", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Add a stock to the watchlist.", "parameters": {"type": "dict", "properties": {"stock": {"type": "string", "description": "the stock symbol to add to the watchlist. "}}, "required": ["stock"]}, "response": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "the symbol that were successfully added to the watchlist."}}}}
|
2 |
-
{"name": "cancel_order", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Cancel an order.", "parameters": {"type": "dict", "properties": {"order_id": {"type": "integer", "description": "ID of the order to cancel. "}}, "required": ["order_id"]}, "response": {"type": "dict", "properties": {"order_id": {"type": "integer", "description": "ID of the cancelled order."}, "status": {"type": "string", "description": "New status of the order after cancellation attempt."}}}}
|
3 |
-
{"name": "filter_stocks_by_price", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Filter stocks based on a price range.", "parameters": {"type": "dict", "properties": {"stocks": {"type": "array", "items": {"type": "string"}, "description": "List of stock symbols to filter."}, "min_price": {"type": "float", "description": "Minimum stock price."}, "max_price": {"type": "float", "description": "Maximum stock price. "}}, "required": ["stocks", "min_price", "max_price"]}, "response": {"type": "dict", "properties": {"filtered_stocks": {"type": "array", "description": "Filtered list of stock symbols within the price range.", "items": {"type": "string"}}}}}
|
4 |
-
{"name": "fund_account", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Fund the account with the specified amount.", "parameters": {"type": "dict", "properties": {"amount": {"type": "float", "description": "Amount to fund the account with. "}}, "required": ["amount"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the funding operation."}, "new_balance": {"type": "float", "description": "Updated account balance after funding."}}}}
|
5 |
-
{"name": "get_account_info", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get account information.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"account_id": {"type": "integer", "description": "ID of the account."}, "balance": {"type": "float", "description": "Current balance of the account."}, "binding_card": {"type": "integer", "description": "Card number associated with the account."}}}}
|
6 |
-
{"name": "get_available_stocks", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get a list of stock symbols in the given sector.", "parameters": {"type": "dict", "properties": {"sector": {"type": "string", "description": "The sector to retrieve stocks from (e.g., 'Technology'). "}}, "required": ["sector"]}, "response": {"type": "dict", "properties": {"stock_list": {"type": "array", "description": "List of stock symbols in the specified sector.", "items": {"type": "string"}}}}}
|
7 |
-
{"name": "get_current_time", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the current time.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"current_time": {"type": "string", "description": "Current time in HH:MM AM/PM format."}}}}
|
8 |
-
{"name": "get_order_details", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the details of an order.", "parameters": {"type": "dict", "properties": {"order_id": {"type": "integer", "description": "ID of the order. "}}, "required": ["order_id"]}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "ID of the order."}, "order_type": {"type": "string", "description": "Type of the order."}, "symbol": {"type": "string", "description": "Symbol of the stock in the order."}, "price": {"type": "float", "description": "Price at which the order was placed."}, "amount": {"type": "integer", "description": "Number of shares in the order."}, "status": {"type": "string", "description": "Current status of the order. [Enum]: [\"Open\", \"Pending\", \"Completed\", \"Cancelled\"]"}}}}
|
9 |
-
{"name": "get_order_history", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the stock order ID history.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"order_history": {"type": "array", "description": "List of orders ID in the order history.", "items": {"type": "integer"}}}}}
|
10 |
-
{"name": "get_stock_info", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the details of a stock.", "parameters": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "Symbol that uniquely identifies the stock. "}}, "required": ["symbol"]}, "response": {"type": "dict", "properties": {"price": {"type": "float", "description": "Current price of the stock."}, "percent_change": {"type": "float", "description": "Percentage change in stock price."}, "volume": {"type": "float", "description": "Trading volume of the stock. MA(5) (float): 5-day Moving Average of the stock. MA(20) (float): 20-day Moving Average of the stock."}}}}
|
11 |
-
{"name": "get_symbol_by_name", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the symbol of a stock by company name.", "parameters": {"type": "dict", "properties": {"name": {"type": "string", "description": "Name of the company. "}}, "required": ["name"]}, "response": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "Symbol of the stock or \"Stock not found\" if not available."}}}}
|
12 |
-
{"name": "get_transaction_history", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the transaction history within a specified date range.", "parameters": {"type": "dict", "properties": {"start_date": {"type": "string", "description": "Start date for the history (format: 'YYYY-MM-DD').", "default": "None"}, "end_date": {"type": "string", "description": "End date for the history (format: 'YYYY-MM-DD'). ", "default": "None"}}, "required": []}, "response": {"type": "dict", "properties": {"transaction_history": {"type": "array", "description": "List of transactions within the specified date range.", "items": {"type": "dict", "properties": {"type": {"type": "string", "description": "Type of transaction. [Enum]: [\"deposit\", \"withdrawal\"]"}, "amount": {"type": "float", "description": "Amount involved in the transaction."}, "timestamp": {"type": "string", "description": "Timestamp of the transaction, formatted as 'YYYY-MM-DD HH:MM:SS'."}}}}}}}
|
13 |
-
{"name": "get_watchlist", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the watchlist.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"watchlist": {"type": "array", "description": "List of stock symbols in the watchlist.", "items": {"type": "string"}}}}}
|
14 |
-
{"name": "make_transaction", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Make a deposit or withdrawal based on specified amount.", "parameters": {"type": "dict", "properties": {"account_id": {"type": "integer", "description": "ID of the account."}, "xact_type": {"type": "string", "description": "Transaction type (deposit or withdrawal)."}, "amount": {"type": "float", "description": "Amount to deposit or withdraw. "}}, "required": ["account_id", "xact_type", "amount"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the transaction."}, "new_balance": {"type": "float", "description": "Updated account balance after the transaction."}}}}
|
15 |
-
{"name": "notify_price_change", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Notify if there is a significant price change in the stocks.", "parameters": {"type": "dict", "properties": {"stocks": {"type": "array", "items": {"type": "string"}, "description": "List of stock symbols to check."}, "threshold": {"type": "float", "description": "Percentage change threshold to trigger a notification. "}}, "required": ["stocks", "threshold"]}, "response": {"type": "dict", "properties": {"notification": {"type": "string", "description": "Notification message about the price changes."}}}}
|
16 |
-
{"name": "place_order", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Place an order.", "parameters": {"type": "dict", "properties": {"order_type": {"type": "string", "description": "Type of the order (Buy/Sell)."}, "symbol": {"type": "string", "description": "Symbol of the stock to trade."}, "price": {"type": "float", "description": "Price at which to place the order."}, "amount": {"type": "integer", "description": "Number of shares to trade. "}}, "required": ["order_type", "symbol", "price", "amount"]}, "response": {"type": "dict", "properties": {"order_id": {"type": "integer", "description": "ID of the newly placed order."}, "order_type": {"type": "string", "description": "Type of the order (Buy/Sell)."}, "status": {"type": "string", "description": "Initial status of the order."}, "price": {"type": "float", "description": "Price at which the order was placed."}, "amount": {"type": "integer", "description": "Number of shares in the order."}}}}
|
17 |
-
{"name": "remove_stock_from_watchlist", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Remove a stock from the watchlist.", "parameters": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "Symbol of the stock to remove. "}}, "required": ["symbol"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the removal operation."}}}}
|
18 |
-
{"name": "trading_get_login_status", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the login status.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"status": {"type": "boolean", "description": "Login status."}}}}
|
19 |
-
{"name": "trading_login", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Handle user login.", "parameters": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username for authentication."}, "password": {"type": "string", "description": "Password for authentication. "}}, "required": ["username", "password"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Login status message."}}}}
|
20 |
-
{"name": "trading_logout", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Handle user logout for trading system.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Logout status message."}}}}
|
21 |
-
{"name": "update_market_status", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Update the market status based on the current time.", "parameters": {"type": "dict", "properties": {"current_time_str": {"type": "string", "description": "Current time in HH:MM AM/PM format. "}}, "required": ["current_time_str"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the market. [Enum]: [\"Open\", \"Closed\"]"}}}}
|
22 |
-
{"name": "update_stock_price", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Update the price of a stock.", "parameters": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "Symbol of the stock to update."}, "new_price": {"type": "float", "description": "New price of the stock. "}}, "required": ["symbol", "new_price"]}, "response": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "Symbol of the updated stock."}, "old_price": {"type": "float", "description": "Previous price of the stock."}, "new_price": {"type": "float", "description": "Updated price of the stock."}}}}
|
|
|
1 |
+
[{"name": "add_to_watchlist", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Add a stock to the watchlist.", "parameters": {"type": "dict", "properties": {"stock": {"type": "string", "description": "the stock symbol to add to the watchlist. "}}, "required": ["stock"]}, "response": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "the symbol that were successfully added to the watchlist."}}}},
|
2 |
+
{"name": "cancel_order", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Cancel an order.", "parameters": {"type": "dict", "properties": {"order_id": {"type": "integer", "description": "ID of the order to cancel. "}}, "required": ["order_id"]}, "response": {"type": "dict", "properties": {"order_id": {"type": "integer", "description": "ID of the cancelled order."}, "status": {"type": "string", "description": "New status of the order after cancellation attempt."}}}},
|
3 |
+
{"name": "filter_stocks_by_price", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Filter stocks based on a price range.", "parameters": {"type": "dict", "properties": {"stocks": {"type": "array", "items": {"type": "string"}, "description": "List of stock symbols to filter."}, "min_price": {"type": "float", "description": "Minimum stock price."}, "max_price": {"type": "float", "description": "Maximum stock price. "}}, "required": ["stocks", "min_price", "max_price"]}, "response": {"type": "dict", "properties": {"filtered_stocks": {"type": "array", "description": "Filtered list of stock symbols within the price range.", "items": {"type": "string"}}}}},
|
4 |
+
{"name": "fund_account", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Fund the account with the specified amount.", "parameters": {"type": "dict", "properties": {"amount": {"type": "float", "description": "Amount to fund the account with. "}}, "required": ["amount"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the funding operation."}, "new_balance": {"type": "float", "description": "Updated account balance after funding."}}}},
|
5 |
+
{"name": "get_account_info", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get account information.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"account_id": {"type": "integer", "description": "ID of the account."}, "balance": {"type": "float", "description": "Current balance of the account."}, "binding_card": {"type": "integer", "description": "Card number associated with the account."}}}},
|
6 |
+
{"name": "get_available_stocks", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get a list of stock symbols in the given sector.", "parameters": {"type": "dict", "properties": {"sector": {"type": "string", "description": "The sector to retrieve stocks from (e.g., 'Technology'). "}}, "required": ["sector"]}, "response": {"type": "dict", "properties": {"stock_list": {"type": "array", "description": "List of stock symbols in the specified sector.", "items": {"type": "string"}}}}},
|
7 |
+
{"name": "get_current_time", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the current time.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"current_time": {"type": "string", "description": "Current time in HH:MM AM/PM format."}}}},
|
8 |
+
{"name": "get_order_details", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the details of an order.", "parameters": {"type": "dict", "properties": {"order_id": {"type": "integer", "description": "ID of the order. "}}, "required": ["order_id"]}, "response": {"type": "dict", "properties": {"id": {"type": "integer", "description": "ID of the order."}, "order_type": {"type": "string", "description": "Type of the order."}, "symbol": {"type": "string", "description": "Symbol of the stock in the order."}, "price": {"type": "float", "description": "Price at which the order was placed."}, "amount": {"type": "integer", "description": "Number of shares in the order."}, "status": {"type": "string", "description": "Current status of the order. [Enum]: [\"Open\", \"Pending\", \"Completed\", \"Cancelled\"]"}}}},
|
9 |
+
{"name": "get_order_history", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the stock order ID history.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"order_history": {"type": "array", "description": "List of orders ID in the order history.", "items": {"type": "integer"}}}}},
|
10 |
+
{"name": "get_stock_info", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the details of a stock.", "parameters": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "Symbol that uniquely identifies the stock. "}}, "required": ["symbol"]}, "response": {"type": "dict", "properties": {"price": {"type": "float", "description": "Current price of the stock."}, "percent_change": {"type": "float", "description": "Percentage change in stock price."}, "volume": {"type": "float", "description": "Trading volume of the stock. MA(5) (float): 5-day Moving Average of the stock. MA(20) (float): 20-day Moving Average of the stock."}}}},
|
11 |
+
{"name": "get_symbol_by_name", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the symbol of a stock by company name.", "parameters": {"type": "dict", "properties": {"name": {"type": "string", "description": "Name of the company. "}}, "required": ["name"]}, "response": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "Symbol of the stock or \"Stock not found\" if not available."}}}},
|
12 |
+
{"name": "get_transaction_history", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the transaction history within a specified date range.", "parameters": {"type": "dict", "properties": {"start_date": {"type": "string", "description": "Start date for the history (format: 'YYYY-MM-DD').", "default": "None"}, "end_date": {"type": "string", "description": "End date for the history (format: 'YYYY-MM-DD'). ", "default": "None"}}, "required": []}, "response": {"type": "dict", "properties": {"transaction_history": {"type": "array", "description": "List of transactions within the specified date range.", "items": {"type": "dict", "properties": {"type": {"type": "string", "description": "Type of transaction. [Enum]: [\"deposit\", \"withdrawal\"]"}, "amount": {"type": "float", "description": "Amount involved in the transaction."}, "timestamp": {"type": "string", "description": "Timestamp of the transaction, formatted as 'YYYY-MM-DD HH:MM:SS'."}}}}}}},
|
13 |
+
{"name": "get_watchlist", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the watchlist.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"watchlist": {"type": "array", "description": "List of stock symbols in the watchlist.", "items": {"type": "string"}}}}},
|
14 |
+
{"name": "make_transaction", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Make a deposit or withdrawal based on specified amount.", "parameters": {"type": "dict", "properties": {"account_id": {"type": "integer", "description": "ID of the account."}, "xact_type": {"type": "string", "description": "Transaction type (deposit or withdrawal)."}, "amount": {"type": "float", "description": "Amount to deposit or withdraw. "}}, "required": ["account_id", "xact_type", "amount"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the transaction."}, "new_balance": {"type": "float", "description": "Updated account balance after the transaction."}}}},
|
15 |
+
{"name": "notify_price_change", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Notify if there is a significant price change in the stocks.", "parameters": {"type": "dict", "properties": {"stocks": {"type": "array", "items": {"type": "string"}, "description": "List of stock symbols to check."}, "threshold": {"type": "float", "description": "Percentage change threshold to trigger a notification. "}}, "required": ["stocks", "threshold"]}, "response": {"type": "dict", "properties": {"notification": {"type": "string", "description": "Notification message about the price changes."}}}},
|
16 |
+
{"name": "place_order", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Place an order.", "parameters": {"type": "dict", "properties": {"order_type": {"type": "string", "description": "Type of the order (Buy/Sell)."}, "symbol": {"type": "string", "description": "Symbol of the stock to trade."}, "price": {"type": "float", "description": "Price at which to place the order."}, "amount": {"type": "integer", "description": "Number of shares to trade. "}}, "required": ["order_type", "symbol", "price", "amount"]}, "response": {"type": "dict", "properties": {"order_id": {"type": "integer", "description": "ID of the newly placed order."}, "order_type": {"type": "string", "description": "Type of the order (Buy/Sell)."}, "status": {"type": "string", "description": "Initial status of the order."}, "price": {"type": "float", "description": "Price at which the order was placed."}, "amount": {"type": "integer", "description": "Number of shares in the order."}}}},
|
17 |
+
{"name": "remove_stock_from_watchlist", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Remove a stock from the watchlist.", "parameters": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "Symbol of the stock to remove. "}}, "required": ["symbol"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the removal operation."}}}},
|
18 |
+
{"name": "trading_get_login_status", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Get the login status.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"status": {"type": "boolean", "description": "Login status."}}}},
|
19 |
+
{"name": "trading_login", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Handle user login.", "parameters": {"type": "dict", "properties": {"username": {"type": "string", "description": "Username for authentication."}, "password": {"type": "string", "description": "Password for authentication. "}}, "required": ["username", "password"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Login status message."}}}},
|
20 |
+
{"name": "trading_logout", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Handle user logout for trading system.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Logout status message."}}}},
|
21 |
+
{"name": "update_market_status", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Update the market status based on the current time.", "parameters": {"type": "dict", "properties": {"current_time_str": {"type": "string", "description": "Current time in HH:MM AM/PM format. "}}, "required": ["current_time_str"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "Status of the market. [Enum]: [\"Open\", \"Closed\"]"}}}},
|
22 |
+
{"name": "update_stock_price", "description": "This tool belongs to the trading system, which allows users to trade stocks, manage their account, and view stock information. Tool description: Update the price of a stock.", "parameters": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "Symbol of the stock to update."}, "new_price": {"type": "float", "description": "New price of the stock. "}}, "required": ["symbol", "new_price"]}, "response": {"type": "dict", "properties": {"symbol": {"type": "string", "description": "Symbol of the updated stock."}, "old_price": {"type": "float", "description": "Previous price of the stock."}, "new_price": {"type": "float", "description": "Updated price of the stock."}}}}]
|
config/travel_booking.json
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
{"name": "authenticate_travel", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Authenticate the user with the travel API", "parameters": {"type": "dict", "properties": {"client_id": {"type": "string", "description": "The client applications client_id supplied by App Management"}, "client_secret": {"type": "string", "description": "The client applications client_secret supplied by App Management"}, "refresh_token": {"type": "string", "description": "The refresh token obtained from the initial authentication"}, "grant_type": {"type": "string", "description": "The grant type of the authentication request. Here are the options: read_write, read, write"}, "user_first_name": {"type": "string", "description": "The first name of the user"}, "user_last_name": {"type": "string", "description": "The last name of the user"}}, "required": ["client_id", "client_secret", "refresh_token", "grant_type", "user_first_name", "user_last_name"]}, "response": {"type": "dict", "properties": {"expires_in": {"type": "integer", "description": "The number of time it can use until the access token expires"}, "access_token": {"type": "string", "description": "The access token to be used in the Authorization header of future requests"}, "token_type": {"type": "string", "description": "The type of token"}, "scope": {"type": "string", "description": "The scope of the token"}}}}
|
2 |
-
{"name": "book_flight", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Book a flight given the travel information. From and To should be the airport codes in the IATA format.", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate"}, "card_id": {"type": "string", "description": "The ID of the credit card to use for the booking"}, "travel_date": {"type": "string", "description": "The date of the travel in the format YYYY-MM-DD"}, "travel_from": {"type": "string", "description": "The location the travel is from"}, "travel_to": {"type": "string", "description": "The location the travel is to"}, "travel_class": {"type": "string", "description": "The class of the travel"}, "travel_cost": {"type": "float", "description": "The cost of the travel"}}, "required": ["access_token", "card_id", "travel_date", "travel_from", "travel_to", "travel_class", "travel_cost"]}, "response": {"type": "dict", "properties": {"booking_id": {"type": "string", "description": "The ID of the booking"}, "transaction_id": {"type": "string", "description": "The ID of the transaction"}, "booking_status": {"type": "boolean", "description": "The status of the booking, True if successful, False if failed"}, "booking_history": {"type": "dict", "description": "The booking history if long context is enabled", "properties": {"booking_id": {"type": "string", "description": "The ID of the booking"}, "transaction_id": {"type": "string", "description": "The ID of the transaction"}, "travel_date": {"type": "string", "description": "The date of the travel"}, "travel_from": {"type": "string", "description": "The location the travel is from"}, "travel_to": {"type": "string", "description": "The location the travel is to"}, "travel_class": {"type": "string", "description": "The class of the travel"}, "travel_cost": {"type": "float", "description": "The cost of the travel"}}}}}}
|
3 |
-
{"name": "cancel_booking", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Cancel a booking", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate"}, "booking_id": {"type": "string", "description": "The ID of the booking"}}, "required": ["access_token", "booking_id"]}, "response": {"type": "dict", "properties": {"cancel_status": {"type": "boolean", "description": "The status of the cancellation, True if successful, False if failed"}}}}
|
4 |
-
{"name": "compute_exchange_rate", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Compute the exchange rate between two currencies", "parameters": {"type": "dict", "properties": {"base_currency": {"type": "string", "description": "The base currency. [Enum]: USD, RMB, EUR, JPY, GBP, CAD, AUD, INR, RUB, BRL, MXN"}, "target_currency": {"type": "string", "description": "The target currency. [Enum]: USD, RMB, EUR, JPY, GBP, CAD, AUD, INR, RUB, BRL, MXN"}, "value": {"type": "float", "description": "The value to convert"}}, "required": ["base_currency", "target_currency", "value"]}, "response": {"type": "dict", "properties": {"exchanged_value": {"type": "float", "description": "The value after the exchange"}}}}
|
5 |
-
{"name": "contact_customer_support", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Contact travel booking customer support, get immediate support on an issue with an online call.", "parameters": {"type": "dict", "properties": {"booking_id": {"type": "string", "description": "The ID of the booking"}, "message": {"type": "string", "description": "The message to send to customer support"}}, "required": ["booking_id", "message"]}, "response": {"type": "dict", "properties": {"customer_support_message": {"type": "string", "description": "The message from customer support"}}}}
|
6 |
-
{"name": "get_all_credit_cards", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get all registered credit cards", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"credit_card_list": {"type": "dict", "description": "A dictionary containing all registered credit cards", "properties": {"card_number": {"type": "string", "description": "The number of the credit card"}, "expiration_date": {"type": "string", "description": "The expiration date of the credit card in the format YYYY-MM-DD"}, "cardholder_name": {"type": "string", "description": "The name of the cardholder"}, "card_verification_value": {"type": "integer", "description": "The verification value of the credit card"}, "balance": {"type": "float", "description": "The balance of the credit card"}}}}}}
|
7 |
-
{"name": "get_budget_fiscal_year", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get the budget fiscal year", "parameters": {"type": "dict", "properties": {"lastModifiedAfter": {"type": "string", "description": "Use this field if you only want Fiscal Years that were changed after the supplied date. The supplied date will be interpreted in the UTC time zone. If lastModifiedAfter is not supplied, the service will return all Fiscal Years, regardless of modified date. Example: 2016-03-29T16:12:20. Return in the format of YYYY-MM-DDTHH:MM:SS.", "default": "None"}, "includeRemoved": {"type": "string", "description": "If true, the service will return all Fiscal Years, including those that were previously removed. If not supplied, this field defaults to false.", "default": "None"}}, "required": []}, "response": {"type": "dict", "properties": {"budget_fiscal_year": {"type": "string", "description": "The budget fiscal year"}}}}
|
8 |
-
{"name": "get_credit_card_balance", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get the balance of a credit card", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate"}, "card_id": {"type": "string", "description": "The ID of the credit card"}}, "required": ["access_token", "card_id"]}, "response": {"type": "dict", "properties": {"card_balance": {"type": "float", "description": "The balance of the credit card"}}}}
|
9 |
-
{"name": "get_flight_cost", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get the list of cost of a flight in USD based on location, date, and class", "parameters": {"type": "dict", "properties": {"travel_from": {"type": "string", "description": "The 3 letter code of the departing airport"}, "travel_to": {"type": "string", "description": "The 3 letter code of the arriving airport"}, "travel_date": {"type": "string", "description": "The date of the travel in the format 'YYYY-MM-DD'"}, "travel_class": {"type": "string", "description": "The class of the travel. Options are: economy, business, first."}}, "required": ["travel_from", "travel_to", "travel_date", "travel_class"]}, "response": {"type": "dict", "properties": {"travel_cost_list": {"type": "array", "description": "The list of cost of the travel", "items": {"type": "float"}}}}}
|
10 |
-
{"name": "get_nearest_airport_by_city", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get the nearest airport to the given location", "parameters": {"type": "dict", "properties": {"location": {"type": "string", "description": "The name of the location. [Enum]: Rivermist, Stonebrook, Maplecrest, Silverpine, Shadowridge, London, Paris, Sunset Valley, Oakendale, Willowbend, Crescent Hollow, Autumnville, Pinehaven, Greenfield, San Francisco, Los Angeles, New York, Chicago, Boston, Beijing, Hong Kong, Rome, Tokyo"}}, "required": ["location"]}, "response": {"type": "dict", "properties": {"nearest_airport": {"type": "string", "description": "The nearest airport to the given location"}}}}
|
11 |
-
{"name": "list_all_airports", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: List all available airports", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"airports": {"type": "array", "description": "A list of all available airports", "items": {"type": "string"}}}}}
|
12 |
-
{"name": "purchase_insurance", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Purchase insurance", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate"}, "insurance_type": {"type": "string", "description": "The type of insurance to purchase"}, "insurance_cost": {"type": "float", "description": "The cost of the insurance"}, "booking_id": {"type": "string", "description": "The ID of the booking"}, "card_id": {"type": "string", "description": "The ID of the credit card to use for the"}}, "required": ["access_token", "insurance_type", "booking_id", "insurance_cost", "card_id"]}, "response": {"type": "dict", "properties": {"insurance_id": {"type": "string", "description": "The ID of the insurance"}, "insurance_status": {"type": "boolean", "description": "The status of the insurance purchase, True if successful, False if failed"}}}}
|
13 |
-
{"name": "register_credit_card", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Register a credit card", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate method"}, "card_number": {"type": "string", "description": "The credit card number"}, "expiration_date": {"type": "string", "description": "The expiration date of the credit card in the format MM/YYYY"}, "cardholder_name": {"type": "string", "description": "The name of the cardholder"}, "card_verification_number": {"type": "integer", "description": "The card verification number"}}, "required": ["access_token", "card_number", "expiration_date", "cardholder_name", "card_verification_number"]}, "response": {"type": "dict", "properties": {"card_id": {"type": "string", "description": "The ID of the registered credit card"}}}}
|
14 |
-
{"name": "retrieve_invoice", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Retrieve the invoice for a booking", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate"}, "booking_id": {"type": "string", "description": "The ID of the booking", "default": "None"}, "insurance_id": {"type": "string", "description": "The ID of the insurance", "default": "None"}}, "required": ["access_token"]}, "response": {"type": "dict", "properties": {"invoice": {"type": "dict", "description": "The invoice for the booking", "properties": {"booking_id": {"type": "string", "description": "The ID of the booking"}, "travel_date": {"type": "string", "description": "The date of the travel"}, "travel_from": {"type": "string", "description": "The location the travel is from"}, "travel_to": {"type": "string", "description": "The location the travel is to"}, "travel_class": {"type": "string", "description": "The class of the travel"}, "travel_cost": {"type": "float", "description": "The cost of the travel"}, "transaction_id": {"type": "string", "description": "The ID of the transaction"}}}}}}
|
15 |
-
{"name": "set_budget_limit", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Set the budget limit for the user", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authentication process or initial configuration."}, "budget_limit": {"type": "float", "description": "The budget limit to set in USD"}}, "required": ["access_token", "budget_limit"]}, "response": {"type": "dict", "properties": {"budget_limit": {"type": "float", "description": "The budget limit set in USD"}}}}
|
16 |
-
{"name": "travel_get_login_status", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get the status of the login", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"status": {"type": "boolean", "description": "The status of the login"}}}}
|
17 |
-
{"name": "verify_traveler_information", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Verify the traveler information", "parameters": {"type": "dict", "properties": {"first_name": {"type": "string", "description": "The first name of the traveler"}, "last_name": {"type": "string", "description": "The last name of the traveler"}, "date_of_birth": {"type": "string", "description": "The date of birth of the traveler in the format YYYY-MM-DD"}, "passport_number": {"type": "string", "description": "The passport number of the traveler"}}, "required": ["first_name", "last_name", "date_of_birth", "passport_number"]}, "response": {"type": "dict", "properties": {"verification_status": {"type": "boolean", "description": "The status of the verification, True if successful, False if failed"}, "verification_failure": {"type": "string", "description": "The reason for the verification failure"}}}}
|
|
|
1 |
+
[{"name": "authenticate_travel", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Authenticate the user with the travel API", "parameters": {"type": "dict", "properties": {"client_id": {"type": "string", "description": "The client applications client_id supplied by App Management"}, "client_secret": {"type": "string", "description": "The client applications client_secret supplied by App Management"}, "refresh_token": {"type": "string", "description": "The refresh token obtained from the initial authentication"}, "grant_type": {"type": "string", "description": "The grant type of the authentication request. Here are the options: read_write, read, write"}, "user_first_name": {"type": "string", "description": "The first name of the user"}, "user_last_name": {"type": "string", "description": "The last name of the user"}}, "required": ["client_id", "client_secret", "refresh_token", "grant_type", "user_first_name", "user_last_name"]}, "response": {"type": "dict", "properties": {"expires_in": {"type": "integer", "description": "The number of time it can use until the access token expires"}, "access_token": {"type": "string", "description": "The access token to be used in the Authorization header of future requests"}, "token_type": {"type": "string", "description": "The type of token"}, "scope": {"type": "string", "description": "The scope of the token"}}}},
|
2 |
+
{"name": "book_flight", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Book a flight given the travel information. From and To should be the airport codes in the IATA format.", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate"}, "card_id": {"type": "string", "description": "The ID of the credit card to use for the booking"}, "travel_date": {"type": "string", "description": "The date of the travel in the format YYYY-MM-DD"}, "travel_from": {"type": "string", "description": "The location the travel is from"}, "travel_to": {"type": "string", "description": "The location the travel is to"}, "travel_class": {"type": "string", "description": "The class of the travel"}, "travel_cost": {"type": "float", "description": "The cost of the travel"}}, "required": ["access_token", "card_id", "travel_date", "travel_from", "travel_to", "travel_class", "travel_cost"]}, "response": {"type": "dict", "properties": {"booking_id": {"type": "string", "description": "The ID of the booking"}, "transaction_id": {"type": "string", "description": "The ID of the transaction"}, "booking_status": {"type": "boolean", "description": "The status of the booking, True if successful, False if failed"}, "booking_history": {"type": "dict", "description": "The booking history if long context is enabled", "properties": {"booking_id": {"type": "string", "description": "The ID of the booking"}, "transaction_id": {"type": "string", "description": "The ID of the transaction"}, "travel_date": {"type": "string", "description": "The date of the travel"}, "travel_from": {"type": "string", "description": "The location the travel is from"}, "travel_to": {"type": "string", "description": "The location the travel is to"}, "travel_class": {"type": "string", "description": "The class of the travel"}, "travel_cost": {"type": "float", "description": "The cost of the travel"}}}}}},
|
3 |
+
{"name": "cancel_booking", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Cancel a booking", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate"}, "booking_id": {"type": "string", "description": "The ID of the booking"}}, "required": ["access_token", "booking_id"]}, "response": {"type": "dict", "properties": {"cancel_status": {"type": "boolean", "description": "The status of the cancellation, True if successful, False if failed"}}}},
|
4 |
+
{"name": "compute_exchange_rate", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Compute the exchange rate between two currencies", "parameters": {"type": "dict", "properties": {"base_currency": {"type": "string", "description": "The base currency. [Enum]: USD, RMB, EUR, JPY, GBP, CAD, AUD, INR, RUB, BRL, MXN"}, "target_currency": {"type": "string", "description": "The target currency. [Enum]: USD, RMB, EUR, JPY, GBP, CAD, AUD, INR, RUB, BRL, MXN"}, "value": {"type": "float", "description": "The value to convert"}}, "required": ["base_currency", "target_currency", "value"]}, "response": {"type": "dict", "properties": {"exchanged_value": {"type": "float", "description": "The value after the exchange"}}}},
|
5 |
+
{"name": "contact_customer_support", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Contact travel booking customer support, get immediate support on an issue with an online call.", "parameters": {"type": "dict", "properties": {"booking_id": {"type": "string", "description": "The ID of the booking"}, "message": {"type": "string", "description": "The message to send to customer support"}}, "required": ["booking_id", "message"]}, "response": {"type": "dict", "properties": {"customer_support_message": {"type": "string", "description": "The message from customer support"}}}},
|
6 |
+
{"name": "get_all_credit_cards", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get all registered credit cards", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"credit_card_list": {"type": "dict", "description": "A dictionary containing all registered credit cards", "properties": {"card_number": {"type": "string", "description": "The number of the credit card"}, "expiration_date": {"type": "string", "description": "The expiration date of the credit card in the format YYYY-MM-DD"}, "cardholder_name": {"type": "string", "description": "The name of the cardholder"}, "card_verification_value": {"type": "integer", "description": "The verification value of the credit card"}, "balance": {"type": "float", "description": "The balance of the credit card"}}}}}},
|
7 |
+
{"name": "get_budget_fiscal_year", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get the budget fiscal year", "parameters": {"type": "dict", "properties": {"lastModifiedAfter": {"type": "string", "description": "Use this field if you only want Fiscal Years that were changed after the supplied date. The supplied date will be interpreted in the UTC time zone. If lastModifiedAfter is not supplied, the service will return all Fiscal Years, regardless of modified date. Example: 2016-03-29T16:12:20. Return in the format of YYYY-MM-DDTHH:MM:SS.", "default": "None"}, "includeRemoved": {"type": "string", "description": "If true, the service will return all Fiscal Years, including those that were previously removed. If not supplied, this field defaults to false.", "default": "None"}}, "required": []}, "response": {"type": "dict", "properties": {"budget_fiscal_year": {"type": "string", "description": "The budget fiscal year"}}}},
|
8 |
+
{"name": "get_credit_card_balance", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get the balance of a credit card", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate"}, "card_id": {"type": "string", "description": "The ID of the credit card"}}, "required": ["access_token", "card_id"]}, "response": {"type": "dict", "properties": {"card_balance": {"type": "float", "description": "The balance of the credit card"}}}},
|
9 |
+
{"name": "get_flight_cost", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get the list of cost of a flight in USD based on location, date, and class", "parameters": {"type": "dict", "properties": {"travel_from": {"type": "string", "description": "The 3 letter code of the departing airport"}, "travel_to": {"type": "string", "description": "The 3 letter code of the arriving airport"}, "travel_date": {"type": "string", "description": "The date of the travel in the format 'YYYY-MM-DD'"}, "travel_class": {"type": "string", "description": "The class of the travel. Options are: economy, business, first."}}, "required": ["travel_from", "travel_to", "travel_date", "travel_class"]}, "response": {"type": "dict", "properties": {"travel_cost_list": {"type": "array", "description": "The list of cost of the travel", "items": {"type": "float"}}}}},
|
10 |
+
{"name": "get_nearest_airport_by_city", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get the nearest airport to the given location", "parameters": {"type": "dict", "properties": {"location": {"type": "string", "description": "The name of the location. [Enum]: Rivermist, Stonebrook, Maplecrest, Silverpine, Shadowridge, London, Paris, Sunset Valley, Oakendale, Willowbend, Crescent Hollow, Autumnville, Pinehaven, Greenfield, San Francisco, Los Angeles, New York, Chicago, Boston, Beijing, Hong Kong, Rome, Tokyo"}}, "required": ["location"]}, "response": {"type": "dict", "properties": {"nearest_airport": {"type": "string", "description": "The nearest airport to the given location"}}}},
|
11 |
+
{"name": "list_all_airports", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: List all available airports", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"airports": {"type": "array", "description": "A list of all available airports", "items": {"type": "string"}}}}},
|
12 |
+
{"name": "purchase_insurance", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Purchase insurance", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate"}, "insurance_type": {"type": "string", "description": "The type of insurance to purchase"}, "insurance_cost": {"type": "float", "description": "The cost of the insurance"}, "booking_id": {"type": "string", "description": "The ID of the booking"}, "card_id": {"type": "string", "description": "The ID of the credit card to use for the"}}, "required": ["access_token", "insurance_type", "booking_id", "insurance_cost", "card_id"]}, "response": {"type": "dict", "properties": {"insurance_id": {"type": "string", "description": "The ID of the insurance"}, "insurance_status": {"type": "boolean", "description": "The status of the insurance purchase, True if successful, False if failed"}}}},
|
13 |
+
{"name": "register_credit_card", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Register a credit card", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate method"}, "card_number": {"type": "string", "description": "The credit card number"}, "expiration_date": {"type": "string", "description": "The expiration date of the credit card in the format MM/YYYY"}, "cardholder_name": {"type": "string", "description": "The name of the cardholder"}, "card_verification_number": {"type": "integer", "description": "The card verification number"}}, "required": ["access_token", "card_number", "expiration_date", "cardholder_name", "card_verification_number"]}, "response": {"type": "dict", "properties": {"card_id": {"type": "string", "description": "The ID of the registered credit card"}}}},
|
14 |
+
{"name": "retrieve_invoice", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Retrieve the invoice for a booking", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authenticate"}, "booking_id": {"type": "string", "description": "The ID of the booking", "default": "None"}, "insurance_id": {"type": "string", "description": "The ID of the insurance", "default": "None"}}, "required": ["access_token"]}, "response": {"type": "dict", "properties": {"invoice": {"type": "dict", "description": "The invoice for the booking", "properties": {"booking_id": {"type": "string", "description": "The ID of the booking"}, "travel_date": {"type": "string", "description": "The date of the travel"}, "travel_from": {"type": "string", "description": "The location the travel is from"}, "travel_to": {"type": "string", "description": "The location the travel is to"}, "travel_class": {"type": "string", "description": "The class of the travel"}, "travel_cost": {"type": "float", "description": "The cost of the travel"}, "transaction_id": {"type": "string", "description": "The ID of the transaction"}}}}}},
|
15 |
+
{"name": "set_budget_limit", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Set the budget limit for the user", "parameters": {"type": "dict", "properties": {"access_token": {"type": "string", "description": "The access token obtained from the authentication process or initial configuration."}, "budget_limit": {"type": "float", "description": "The budget limit to set in USD"}}, "required": ["access_token", "budget_limit"]}, "response": {"type": "dict", "properties": {"budget_limit": {"type": "float", "description": "The budget limit set in USD"}}}},
|
16 |
+
{"name": "travel_get_login_status", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Get the status of the login", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"status": {"type": "boolean", "description": "The status of the login"}}}},
|
17 |
+
{"name": "verify_traveler_information", "description": "This tool belongs to the travel system, which allows users to book flights, manage credit cards, and view budget information. Tool description: Verify the traveler information", "parameters": {"type": "dict", "properties": {"first_name": {"type": "string", "description": "The first name of the traveler"}, "last_name": {"type": "string", "description": "The last name of the traveler"}, "date_of_birth": {"type": "string", "description": "The date of birth of the traveler in the format YYYY-MM-DD"}, "passport_number": {"type": "string", "description": "The passport number of the traveler"}}, "required": ["first_name", "last_name", "date_of_birth", "passport_number"]}, "response": {"type": "dict", "properties": {"verification_status": {"type": "boolean", "description": "The status of the verification, True if successful, False if failed"}, "verification_failure": {"type": "string", "description": "The reason for the verification failure"}}}}]
|
config/vehicle_control.json
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
{"name": "activateParkingBrake", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Activates the parking brake of the vehicle.", "parameters": {"type": "dict", "properties": {"mode": {"type": "string", "description": "The mode to set. [Enum]: [\"engage\", \"release\"]"}}, "required": ["mode"]}, "response": {"type": "dict", "properties": {"parkingBrakeStatus": {"type": "string", "description": "The status of the brake. [Enum]: [\"engaged\", \"released\"]"}, "_parkingBrakeForce": {"type": "float", "description": "The force applied to the brake in Newtons."}, "_slopeAngle": {"type": "float", "description": "The slope angle in degrees."}}}}
|
2 |
-
{"name": "adjustClimateControl", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Adjusts the climate control of the vehicle.", "parameters": {"type": "dict", "properties": {"temperature": {"type": "float", "description": "The temperature to set in degree. Default to be celsius."}, "unit": {"type": "string", "description": "The unit of temperature. [Enum]: [\"celsius\", \"fahrenheit\"]", "default": "celsius"}, "fanSpeed": {"type": "integer", "description": "The fan speed to set from 0 to 100. Default is 50.", "default": 50}, "mode": {"type": "string", "description": "The climate mode to set. [Enum]: [\"auto\", \"cool\", \"heat\", \"defrost\"]", "default": "auto"}}, "required": ["temperature"]}, "response": {"type": "dict", "properties": {"currentTemperature": {"type": "float", "description": "The current temperature set in degree Celsius."}, "climateMode": {"type": "string", "description": "The current climate mode set."}, "humidityLevel": {"type": "float", "description": "The humidity level in percentage."}}}}
|
3 |
-
{"name": "check_tire_pressure", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Checks the tire pressure of the vehicle.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"tirePressure": {"type": "dict", "description": "The tire pressure of the vehicle.", "properties": {"frontLeftTirePressure": {"type": "float", "description": "The pressure of the front left tire in psi."}, "frontRightTirePressure": {"type": "float", "description": "The pressure of the front right tire in psi."}, "rearLeftTirePressure": {"type": "float", "description": "The pressure of the rear left tire in psi."}, "rearRightTirePressure": {"type": "float", "description": "The pressure of the rear right tire in psi."}, "healthy_tire_pressure": {"type": "boolean", "description": "True if the tire pressure is healthy, False otherwise."}, "car_info": {"type": "dict", "description": "The metadata of the car."}}}}}}
|
4 |
-
{"name": "displayCarStatus", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Displays the status of the vehicle based on the provided display option.", "parameters": {"type": "dict", "properties": {"option": {"type": "string", "description": "The option to display. [Enum]: [\"fuel\", \"battery\", \"doors\", \"climate\", \"headlights\", \"parkingBrake\", \"brakePadle\", \"engine\"]"}}, "required": ["option"]}, "response": {"type": "dict", "properties": {"status": {"type": "dict", "description": "The status of the vehicle based on the option.", "properties": {"fuelLevel": {"type": "float", "description": "[Optional] The fuel level of the vehicle in gallons."}, "batteryVoltage": {"type": "float", "description": "[Optional] The battery voltage of the vehicle in volts."}, "doorStatus": {"type": "dict", "description": "[Optional] The status of the doors.", "properties": {"driver": {"type": "string", "description": "The status of the driver door. [Enum]: [\"locked\", \"unlocked\"]"}, "passenger": {"type": "string", "description": "The status of the passenger door. [Enum]: [\"locked\", \"unlocked\"]"}, "rear_left": {"type": "string", "description": "The status of the rear left door. [Enum]: [\"locked\", \"unlocked\"]"}, "rear_right": {"type": "string", "description": "The status of the rear right door. [Enum]: [\"locked\", \"unlocked\"]"}}}, "currentACTemperature": {"type": "float", "description": "[Optional] The current temperature set in degree Celsius."}, "fanSpeed": {"type": "integer", "description": "[Optional] The fan speed set from 0 to 100."}, "climateMode": {"type": "string", "description": "[Optional] The climate mode set. [Enum]: [\"auto\", \"cool\", \"heat\", \"defrost\"]"}, "humidityLevel": {"type": "float", "description": "[Optional] The humidity level in percentage."}, "headlightStatus": {"type": "string", "description": "[Optional] The status of the headlights. [Enum]: [\"on\", \"off\"]"}, "parkingBrakeStatus": {"type": "string", "description": "[Optional] The status of the brake. [Enum]: [\"engaged\", \"released\"]"}, "parkingBrakeForce": {"type": "float", "description": "[Optional] The force applied to the brake in Newtons."}, "slopeAngle": {"type": "float", "description": "[Optional] The slope angle in degrees."}, "brakePedalStatus": {"type": "string", "description": "[Optional] The status of the brake pedal. [Enum]: [\"pressed\", \"released\"]"}, "brakePedalForce": {"type": "float", "description": "[Optional] The force applied to the brake pedal in Newtons."}, "engineState": {"type": "string", "description": "[Optional] The state of the engine. [Enum]: [\"running\", \"stopped\"]"}, "metadata": {"type": "string", "description": "[Optional] The metadata of the car."}}}}}}
|
5 |
-
{"name": "display_log", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Displays the log messages.", "parameters": {"type": "dict", "properties": {"messages": {"type": "array", "items": {"type": "string"}, "description": "The list of messages to display."}}, "required": ["messages"]}, "response": {"type": "dict", "properties": {"log": {"type": "array", "description": "The list of messages displayed.", "items": {"type": "string"}}}}}
|
6 |
-
{"name": "estimate_distance", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Estimates the distance between two cities.", "parameters": {"type": "dict", "properties": {"cityA": {"type": "string", "description": "The zipcode of the first city."}, "cityB": {"type": "string", "description": "The zipcode of the second city."}}, "required": ["cityA", "cityB"]}, "response": {"type": "dict", "properties": {"distance": {"type": "float", "description": "The distance between the two cities in km."}, "intermediaryCities": {"type": "array", "description": "[Optional] The list of intermediary cities between the two cities.", "items": {"type": "string"}}}}}
|
7 |
-
{"name": "estimate_drive_feasibility_by_mileage", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Estimates the milage of the vehicle given the distance needed to drive.", "parameters": {"type": "dict", "properties": {"distance": {"type": "float", "description": "The distance to travel in miles."}}, "required": ["distance"]}, "response": {"type": "dict", "properties": {"canDrive": {"type": "boolean", "description": "True if the vehicle can drive the distance, False otherwise."}}}}
|
8 |
-
{"name": "fillFuelTank", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Fills the fuel tank of the vehicle. The fuel tank can hold up to 50 gallons.", "parameters": {"type": "dict", "properties": {"fuelAmount": {"type": "float", "description": "The amount of fuel to fill in gallons; this is the additional fuel to add to the tank."}}, "required": ["fuelAmount"]}, "response": {"type": "dict", "properties": {"fuelLevel": {"type": "float", "description": "The fuel level of the vehicle in gallons."}}}}
|
9 |
-
{"name": "find_nearest_tire_shop", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Finds the nearest tire shop.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"shopLocation": {"type": "string", "description": "The location of the nearest tire shop."}}}}
|
10 |
-
{"name": "gallon_to_liter", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Converts the gallon to liter.", "parameters": {"type": "dict", "properties": {"gallon": {"type": "float", "description": "The amount of gallon to convert."}}, "required": ["gallon"]}, "response": {"type": "dict", "properties": {"liter": {"type": "float", "description": "The amount of liter converted."}}}}
|
11 |
-
{"name": "get_current_speed", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Gets the current speed of the vehicle.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"currentSpeed": {"type": "float", "description": "The current speed of the vehicle in km/h."}}}}
|
12 |
-
{"name": "get_outside_temperature_from_google", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Gets the outside temperature.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"outsideTemperature": {"type": "float", "description": "The outside temperature in degree Celsius."}}}}
|
13 |
-
{"name": "get_outside_temperature_from_weather_com", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Gets the outside temperature.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"outsideTemperature": {"type": "float", "description": "The outside temperature in degree Celsius."}}}}
|
14 |
-
{"name": "get_zipcode_based_on_city", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Gets the zipcode based on the city.", "parameters": {"type": "dict", "properties": {"city": {"type": "string", "description": "The name of the city."}}, "required": ["city"]}, "response": {"type": "dict", "properties": {"zipcode": {"type": "string", "description": "The zipcode of the city."}}}}
|
15 |
-
{"name": "liter_to_gallon", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Converts the liter to gallon.", "parameters": {"type": "dict", "properties": {"liter": {"type": "float", "description": "The amount of liter to convert."}}, "required": ["liter"]}, "response": {"type": "dict", "properties": {"gallon": {"type": "float", "description": "The amount of gallon converted."}}}}
|
16 |
-
{"name": "lockDoors", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Locks the doors of the vehicle.", "parameters": {"type": "dict", "properties": {"unlock": {"type": "boolean", "description": "True if the doors are to be unlocked, False otherwise."}, "door": {"type": "array", "items": {"type": "string"}, "description": "The list of doors to lock or unlock. [Enum]: [\"driver\", \"passenger\", \"rear_left\", \"rear_right\"]"}}, "required": ["unlock", "door"]}, "response": {"type": "dict", "properties": {"lockStatus": {"type": "string", "description": "The status of the lock. [Enum]: [\"locked\", \"unlocked\"]"}, "remainingUnlockedDoors": {"type": "integer", "description": "The number of remaining unlocked doors."}}}}
|
17 |
-
{"name": "pressBrakePedal", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Presses the brake pedal based on pedal position. The brake pedal will be kept pressed until released.", "parameters": {"type": "dict", "properties": {"pedalPosition": {"type": "float", "description": "Position of the brake pedal, between 0 (not pressed) and 1 (fully pressed)."}}, "required": ["pedalPosition"]}, "response": {"type": "dict", "properties": {"brakePedalStatus": {"type": "string", "description": "The status of the brake pedal. [Enum]: [\"pressed\", \"released\"]"}, "brakePedalForce": {"type": "float", "description": "The force applied to the brake pedal in Newtons."}}}}
|
18 |
-
{"name": "releaseBrakePedal", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Releases the brake pedal of the vehicle.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"brakePedalStatus": {"type": "string", "description": "The status of the brake pedal. [Enum]: [\"pressed\", \"released\"]"}, "brakePedalForce": {"type": "float", "description": "The force applied to the brake pedal in Newtons."}}}}
|
19 |
-
{"name": "setCruiseControl", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Sets the cruise control of the vehicle.", "parameters": {"type": "dict", "properties": {"speed": {"type": "float", "description": "The speed to set in m/h. The speed should be between 0 and 120 and a multiple of 5."}, "activate": {"type": "boolean", "description": "True to activate the cruise control, False to deactivate."}, "distanceToNextVehicle": {"type": "float", "description": "The distance to the next vehicle in meters."}}, "required": ["speed", "activate", "distanceToNextVehicle"]}, "response": {"type": "dict", "properties": {"cruiseStatus": {"type": "string", "description": "The status of the cruise control. [Enum]: [\"active\", \"inactive\"]"}, "currentSpeed": {"type": "float", "description": "The current speed of the vehicle in km/h."}, "distanceToNextVehicle": {"type": "float", "description": "The distance to the next vehicle in meters."}}}}
|
20 |
-
{"name": "setHeadlights", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Sets the headlights of the vehicle.", "parameters": {"type": "dict", "properties": {"mode": {"type": "string", "description": "The mode of the headlights. [Enum]: [\"on\", \"off\", \"auto\"]"}}, "required": ["mode"]}, "response": {"type": "dict", "properties": {"headlightStatus": {"type": "string", "description": "The status of the headlights. [Enum]: [\"on\", \"off\"]"}}}}
|
21 |
-
{"name": "set_navigation", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Navigates to the destination.", "parameters": {"type": "dict", "properties": {"destination": {"type": "string", "description": "The destination to navigate in the format of street, city, state."}}, "required": ["destination"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "The status of the navigation."}}}}
|
22 |
-
{"name": "startEngine", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Starts the engine of the vehicle.", "parameters": {"type": "dict", "properties": {"ignitionMode": {"type": "string", "description": "The ignition mode of the vehicle. [Enum]: [\"START\", \"STOP\"]"}}, "required": ["ignitionMode"]}, "response": {"type": "dict", "properties": {"engineState": {"type": "string", "description": "The state of the engine. [Enum]: [\"running\", \"stopped\"]"}, "fuelLevel": {"type": "float", "description": "The fuel level of the vehicle in gallons."}, "batteryVoltage": {"type": "float", "description": "The battery voltage of the vehicle in volts."}}}}
|
|
|
1 |
+
[{"name": "activateParkingBrake", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Activates the parking brake of the vehicle.", "parameters": {"type": "dict", "properties": {"mode": {"type": "string", "description": "The mode to set. [Enum]: [\"engage\", \"release\"]"}}, "required": ["mode"]}, "response": {"type": "dict", "properties": {"parkingBrakeStatus": {"type": "string", "description": "The status of the brake. [Enum]: [\"engaged\", \"released\"]"}, "_parkingBrakeForce": {"type": "float", "description": "The force applied to the brake in Newtons."}, "_slopeAngle": {"type": "float", "description": "The slope angle in degrees."}}}},
|
2 |
+
{"name": "adjustClimateControl", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Adjusts the climate control of the vehicle.", "parameters": {"type": "dict", "properties": {"temperature": {"type": "float", "description": "The temperature to set in degree. Default to be celsius."}, "unit": {"type": "string", "description": "The unit of temperature. [Enum]: [\"celsius\", \"fahrenheit\"]", "default": "celsius"}, "fanSpeed": {"type": "integer", "description": "The fan speed to set from 0 to 100. Default is 50.", "default": 50}, "mode": {"type": "string", "description": "The climate mode to set. [Enum]: [\"auto\", \"cool\", \"heat\", \"defrost\"]", "default": "auto"}}, "required": ["temperature"]}, "response": {"type": "dict", "properties": {"currentTemperature": {"type": "float", "description": "The current temperature set in degree Celsius."}, "climateMode": {"type": "string", "description": "The current climate mode set."}, "humidityLevel": {"type": "float", "description": "The humidity level in percentage."}}}},
|
3 |
+
{"name": "check_tire_pressure", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Checks the tire pressure of the vehicle.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"tirePressure": {"type": "dict", "description": "The tire pressure of the vehicle.", "properties": {"frontLeftTirePressure": {"type": "float", "description": "The pressure of the front left tire in psi."}, "frontRightTirePressure": {"type": "float", "description": "The pressure of the front right tire in psi."}, "rearLeftTirePressure": {"type": "float", "description": "The pressure of the rear left tire in psi."}, "rearRightTirePressure": {"type": "float", "description": "The pressure of the rear right tire in psi."}, "healthy_tire_pressure": {"type": "boolean", "description": "True if the tire pressure is healthy, False otherwise."}, "car_info": {"type": "dict", "description": "The metadata of the car."}}}}}},
|
4 |
+
{"name": "displayCarStatus", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Displays the status of the vehicle based on the provided display option.", "parameters": {"type": "dict", "properties": {"option": {"type": "string", "description": "The option to display. [Enum]: [\"fuel\", \"battery\", \"doors\", \"climate\", \"headlights\", \"parkingBrake\", \"brakePadle\", \"engine\"]"}}, "required": ["option"]}, "response": {"type": "dict", "properties": {"status": {"type": "dict", "description": "The status of the vehicle based on the option.", "properties": {"fuelLevel": {"type": "float", "description": "[Optional] The fuel level of the vehicle in gallons."}, "batteryVoltage": {"type": "float", "description": "[Optional] The battery voltage of the vehicle in volts."}, "doorStatus": {"type": "dict", "description": "[Optional] The status of the doors.", "properties": {"driver": {"type": "string", "description": "The status of the driver door. [Enum]: [\"locked\", \"unlocked\"]"}, "passenger": {"type": "string", "description": "The status of the passenger door. [Enum]: [\"locked\", \"unlocked\"]"}, "rear_left": {"type": "string", "description": "The status of the rear left door. [Enum]: [\"locked\", \"unlocked\"]"}, "rear_right": {"type": "string", "description": "The status of the rear right door. [Enum]: [\"locked\", \"unlocked\"]"}}}, "currentACTemperature": {"type": "float", "description": "[Optional] The current temperature set in degree Celsius."}, "fanSpeed": {"type": "integer", "description": "[Optional] The fan speed set from 0 to 100."}, "climateMode": {"type": "string", "description": "[Optional] The climate mode set. [Enum]: [\"auto\", \"cool\", \"heat\", \"defrost\"]"}, "humidityLevel": {"type": "float", "description": "[Optional] The humidity level in percentage."}, "headlightStatus": {"type": "string", "description": "[Optional] The status of the headlights. [Enum]: [\"on\", \"off\"]"}, "parkingBrakeStatus": {"type": "string", "description": "[Optional] The status of the brake. [Enum]: [\"engaged\", \"released\"]"}, "parkingBrakeForce": {"type": "float", "description": "[Optional] The force applied to the brake in Newtons."}, "slopeAngle": {"type": "float", "description": "[Optional] The slope angle in degrees."}, "brakePedalStatus": {"type": "string", "description": "[Optional] The status of the brake pedal. [Enum]: [\"pressed\", \"released\"]"}, "brakePedalForce": {"type": "float", "description": "[Optional] The force applied to the brake pedal in Newtons."}, "engineState": {"type": "string", "description": "[Optional] The state of the engine. [Enum]: [\"running\", \"stopped\"]"}, "metadata": {"type": "string", "description": "[Optional] The metadata of the car."}}}}}},
|
5 |
+
{"name": "display_log", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Displays the log messages.", "parameters": {"type": "dict", "properties": {"messages": {"type": "array", "items": {"type": "string"}, "description": "The list of messages to display."}}, "required": ["messages"]}, "response": {"type": "dict", "properties": {"log": {"type": "array", "description": "The list of messages displayed.", "items": {"type": "string"}}}}},
|
6 |
+
{"name": "estimate_distance", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Estimates the distance between two cities.", "parameters": {"type": "dict", "properties": {"cityA": {"type": "string", "description": "The zipcode of the first city."}, "cityB": {"type": "string", "description": "The zipcode of the second city."}}, "required": ["cityA", "cityB"]}, "response": {"type": "dict", "properties": {"distance": {"type": "float", "description": "The distance between the two cities in km."}, "intermediaryCities": {"type": "array", "description": "[Optional] The list of intermediary cities between the two cities.", "items": {"type": "string"}}}}},
|
7 |
+
{"name": "estimate_drive_feasibility_by_mileage", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Estimates the milage of the vehicle given the distance needed to drive.", "parameters": {"type": "dict", "properties": {"distance": {"type": "float", "description": "The distance to travel in miles."}}, "required": ["distance"]}, "response": {"type": "dict", "properties": {"canDrive": {"type": "boolean", "description": "True if the vehicle can drive the distance, False otherwise."}}}},
|
8 |
+
{"name": "fillFuelTank", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Fills the fuel tank of the vehicle. The fuel tank can hold up to 50 gallons.", "parameters": {"type": "dict", "properties": {"fuelAmount": {"type": "float", "description": "The amount of fuel to fill in gallons; this is the additional fuel to add to the tank."}}, "required": ["fuelAmount"]}, "response": {"type": "dict", "properties": {"fuelLevel": {"type": "float", "description": "The fuel level of the vehicle in gallons."}}}},
|
9 |
+
{"name": "find_nearest_tire_shop", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Finds the nearest tire shop.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"shopLocation": {"type": "string", "description": "The location of the nearest tire shop."}}}},
|
10 |
+
{"name": "gallon_to_liter", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Converts the gallon to liter.", "parameters": {"type": "dict", "properties": {"gallon": {"type": "float", "description": "The amount of gallon to convert."}}, "required": ["gallon"]}, "response": {"type": "dict", "properties": {"liter": {"type": "float", "description": "The amount of liter converted."}}}},
|
11 |
+
{"name": "get_current_speed", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Gets the current speed of the vehicle.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"currentSpeed": {"type": "float", "description": "The current speed of the vehicle in km/h."}}}},
|
12 |
+
{"name": "get_outside_temperature_from_google", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Gets the outside temperature.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"outsideTemperature": {"type": "float", "description": "The outside temperature in degree Celsius."}}}},
|
13 |
+
{"name": "get_outside_temperature_from_weather_com", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Gets the outside temperature.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"outsideTemperature": {"type": "float", "description": "The outside temperature in degree Celsius."}}}},
|
14 |
+
{"name": "get_zipcode_based_on_city", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Gets the zipcode based on the city.", "parameters": {"type": "dict", "properties": {"city": {"type": "string", "description": "The name of the city."}}, "required": ["city"]}, "response": {"type": "dict", "properties": {"zipcode": {"type": "string", "description": "The zipcode of the city."}}}},
|
15 |
+
{"name": "liter_to_gallon", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Converts the liter to gallon.", "parameters": {"type": "dict", "properties": {"liter": {"type": "float", "description": "The amount of liter to convert."}}, "required": ["liter"]}, "response": {"type": "dict", "properties": {"gallon": {"type": "float", "description": "The amount of gallon converted."}}}},
|
16 |
+
{"name": "lockDoors", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Locks the doors of the vehicle.", "parameters": {"type": "dict", "properties": {"unlock": {"type": "boolean", "description": "True if the doors are to be unlocked, False otherwise."}, "door": {"type": "array", "items": {"type": "string"}, "description": "The list of doors to lock or unlock. [Enum]: [\"driver\", \"passenger\", \"rear_left\", \"rear_right\"]"}}, "required": ["unlock", "door"]}, "response": {"type": "dict", "properties": {"lockStatus": {"type": "string", "description": "The status of the lock. [Enum]: [\"locked\", \"unlocked\"]"}, "remainingUnlockedDoors": {"type": "integer", "description": "The number of remaining unlocked doors."}}}},
|
17 |
+
{"name": "pressBrakePedal", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Presses the brake pedal based on pedal position. The brake pedal will be kept pressed until released.", "parameters": {"type": "dict", "properties": {"pedalPosition": {"type": "float", "description": "Position of the brake pedal, between 0 (not pressed) and 1 (fully pressed)."}}, "required": ["pedalPosition"]}, "response": {"type": "dict", "properties": {"brakePedalStatus": {"type": "string", "description": "The status of the brake pedal. [Enum]: [\"pressed\", \"released\"]"}, "brakePedalForce": {"type": "float", "description": "The force applied to the brake pedal in Newtons."}}}},
|
18 |
+
{"name": "releaseBrakePedal", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Releases the brake pedal of the vehicle.", "parameters": {"type": "dict", "properties": {}, "required": []}, "response": {"type": "dict", "properties": {"brakePedalStatus": {"type": "string", "description": "The status of the brake pedal. [Enum]: [\"pressed\", \"released\"]"}, "brakePedalForce": {"type": "float", "description": "The force applied to the brake pedal in Newtons."}}}},
|
19 |
+
{"name": "setCruiseControl", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Sets the cruise control of the vehicle.", "parameters": {"type": "dict", "properties": {"speed": {"type": "float", "description": "The speed to set in m/h. The speed should be between 0 and 120 and a multiple of 5."}, "activate": {"type": "boolean", "description": "True to activate the cruise control, False to deactivate."}, "distanceToNextVehicle": {"type": "float", "description": "The distance to the next vehicle in meters."}}, "required": ["speed", "activate", "distanceToNextVehicle"]}, "response": {"type": "dict", "properties": {"cruiseStatus": {"type": "string", "description": "The status of the cruise control. [Enum]: [\"active\", \"inactive\"]"}, "currentSpeed": {"type": "float", "description": "The current speed of the vehicle in km/h."}, "distanceToNextVehicle": {"type": "float", "description": "The distance to the next vehicle in meters."}}}},
|
20 |
+
{"name": "setHeadlights", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Sets the headlights of the vehicle.", "parameters": {"type": "dict", "properties": {"mode": {"type": "string", "description": "The mode of the headlights. [Enum]: [\"on\", \"off\", \"auto\"]"}}, "required": ["mode"]}, "response": {"type": "dict", "properties": {"headlightStatus": {"type": "string", "description": "The status of the headlights. [Enum]: [\"on\", \"off\"]"}}}},
|
21 |
+
{"name": "set_navigation", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Navigates to the destination.", "parameters": {"type": "dict", "properties": {"destination": {"type": "string", "description": "The destination to navigate in the format of street, city, state."}}, "required": ["destination"]}, "response": {"type": "dict", "properties": {"status": {"type": "string", "description": "The status of the navigation."}}}},
|
22 |
+
{"name": "startEngine", "description": "This tool belongs to the vehicle control system, which allows users to control various aspects of the car such as engine, doors, climate control, lights, and more. Tool description: Starts the engine of the vehicle.", "parameters": {"type": "dict", "properties": {"ignitionMode": {"type": "string", "description": "The ignition mode of the vehicle. [Enum]: [\"START\", \"STOP\"]"}}, "required": ["ignitionMode"]}, "response": {"type": "dict", "properties": {"engineState": {"type": "string", "description": "The state of the engine. [Enum]: [\"running\", \"stopped\"]"}, "fuelLevel": {"type": "float", "description": "The fuel level of the vehicle in gallons."}, "batteryVoltage": {"type": "float", "description": "The battery voltage of the vehicle in volts."}}}}]
|
multi_turn_eval/multi_turn_utils.py
CHANGED
@@ -42,7 +42,7 @@ def execute_multi_turn_func_call(
|
|
42 |
module_name = CLASS_FILE_PATH_MAPPING[class_name]
|
43 |
# TODO: Handler the model name issue from handler more elegantly
|
44 |
instance_name = (
|
45 |
-
f"{model_name.replace('-', '_').replace('.', '_').replace('/', '_')}_{test_entry_id}_{class_name.lower()}_instance"
|
46 |
)
|
47 |
if instance_name not in globals():
|
48 |
module = importlib.import_module(module_name)
|
|
|
42 |
module_name = CLASS_FILE_PATH_MAPPING[class_name]
|
43 |
# TODO: Handler the model name issue from handler more elegantly
|
44 |
instance_name = (
|
45 |
+
f"{model_name.replace('-', '_').replace('.', '_').replace('/', '_')}_{str(test_entry_id).replace('-', '_')}_{class_name.lower()}_instance"
|
46 |
)
|
47 |
if instance_name not in globals():
|
48 |
module = importlib.import_module(module_name)
|
state.py
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from backend import get_handler
|
2 |
+
import uuid
|
3 |
+
import os
|
4 |
+
import json
|
5 |
+
import time
|
6 |
+
from datetime import datetime
|
7 |
+
from app_utils import *
|
8 |
+
|
9 |
+
class State:
|
10 |
+
"""
|
11 |
+
Manages the state of a chatbot including its model configuration, chat history, and test data.
|
12 |
+
|
13 |
+
Attributes:
|
14 |
+
current_model (str): The currently active model identifier
|
15 |
+
current_temperature (float): The temperature setting for model inference
|
16 |
+
current_category (str): The current category of conversation
|
17 |
+
test_entry (dict): Contains test configuration and data
|
18 |
+
inference_data (dict): Stores inference results and messages
|
19 |
+
handler: The model handler instance
|
20 |
+
history (list): List of conversation messages
|
21 |
+
name (str): Identifier for this bot instance, defaults to "bot"
|
22 |
+
database: Database connection for storing chat history
|
23 |
+
example_settings (dict): Predefined example configurations (see app_utils.py)
|
24 |
+
"""
|
25 |
+
def __init__(self, init_model, init_temperature, database, example_settings, name="bot"):
|
26 |
+
self.current_model = init_model
|
27 |
+
self.current_temperature = init_temperature
|
28 |
+
self.current_category = None
|
29 |
+
self.test_entry = initialize_empty_test_entry()
|
30 |
+
self.inference_data = {"message": []}
|
31 |
+
self.handler = get_handler(self.current_model, self.current_temperature)
|
32 |
+
self.history = self.get_initial_state()
|
33 |
+
self.name = name
|
34 |
+
self.database = database
|
35 |
+
self.example_settings = example_settings
|
36 |
+
|
37 |
+
def initialize(self, category):
|
38 |
+
self.category = category
|
39 |
+
self.update_category_and_load_config(category)
|
40 |
+
|
41 |
+
def get_initial_state(self):
|
42 |
+
return list(INITIAL_CHAT_HISTORY)
|
43 |
+
|
44 |
+
def restart_chat(self, model, temperature):
|
45 |
+
self.test_entry["id"] = str(uuid.uuid4())
|
46 |
+
self.handler = get_handler(model, temperature)
|
47 |
+
self.history = self.get_initial_state()
|
48 |
+
return self.history
|
49 |
+
|
50 |
+
def update_handler(self, model, temperature):
|
51 |
+
self.current_model = model
|
52 |
+
self.current_temperature = temperature
|
53 |
+
self.handler = get_handler(model, temperature)
|
54 |
+
print(f"Update handler for {self.name}: ", model, temperature)
|
55 |
+
self.history = self.restart_chat(model, temperature)
|
56 |
+
return model, self.history
|
57 |
+
|
58 |
+
def save(self):
|
59 |
+
if len(self.history) > 2:
|
60 |
+
document = {"time": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
61 |
+
"model": self.current_model,
|
62 |
+
"category": self.current_category,
|
63 |
+
"temperature": self.current_temperature,
|
64 |
+
"history": self.history}
|
65 |
+
self.database.insert_one(document)
|
66 |
+
|
67 |
+
def restart_chat_and_save(self):
|
68 |
+
self.save()
|
69 |
+
return self.restart_chat(self.current_model, self.current_temperature)
|
70 |
+
|
71 |
+
def update_category_and_load_config(self, category):
|
72 |
+
self.current_category = category
|
73 |
+
self.test_entry["initial_config"] = {category: {}}
|
74 |
+
self.test_entry["involved_classes"] = [category]
|
75 |
+
config_path = os.path.join("config", f"{MAPPINGS[category]}.json")
|
76 |
+
self.load_config(config_path)
|
77 |
+
return category
|
78 |
+
|
79 |
+
def load_config(self, config_path):
|
80 |
+
if os.path.exists(config_path):
|
81 |
+
with open(config_path, 'r') as config_file:
|
82 |
+
data = json.load(config_file)
|
83 |
+
self.test_entry["function"] = data.copy()
|
84 |
+
|
85 |
+
def load_example_and_update(self, example):
|
86 |
+
self.save()
|
87 |
+
model, temp, category, message = self.load_example(example)
|
88 |
+
self.update_category_and_load_config(category)
|
89 |
+
return model, temp, category, message
|
90 |
+
|
91 |
+
def load_example(self, example):
|
92 |
+
return self.example_settings[example]
|
93 |
+
|
94 |
+
def response(self):
|
95 |
+
for item in self.handler.inference(self.test_entry):
|
96 |
+
if item[0] == "regular":
|
97 |
+
responses_results = equalize_and_zip(item[1], item[2])
|
98 |
+
for (model_res, exec_res) in responses_results:
|
99 |
+
if model_res is not None:
|
100 |
+
response = model_res
|
101 |
+
self.history.append({"role": "assistant", "content": "<b>Model Response🤖: </b><br>"})
|
102 |
+
for character in response:
|
103 |
+
self.history[-1]["content"] += character
|
104 |
+
time.sleep(0.01)
|
105 |
+
yield self.history
|
106 |
+
if exec_res is not None:
|
107 |
+
response = exec_res
|
108 |
+
self.history[-1]["content"] += "<br><br><b>Model Execution💻: </b><br>"
|
109 |
+
yield self.history
|
110 |
+
for character in response:
|
111 |
+
self.history[-1]["content"] += character
|
112 |
+
time.sleep(0.01)
|
113 |
+
yield self.history
|
114 |
+
elif item[0] == 'summary':
|
115 |
+
response = item[1]
|
116 |
+
if response is not None:
|
117 |
+
self.history.append({"role": "assistant", "content": "<b>Summary✅: </b><br>"})
|
118 |
+
for character in response:
|
119 |
+
self.history[-1]["content"] += character
|
120 |
+
time.sleep(0.01)
|
121 |
+
yield self.history
|
122 |
+
elif item[0] == "final":
|
123 |
+
self.inference_data = item[2]
|
124 |
+
time.sleep(0.05)
|
state_manager.py
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from app_utils import *
|
2 |
+
from state import State
|
3 |
+
|
4 |
+
class StateManager:
|
5 |
+
"""
|
6 |
+
Manages the state of both single and dual chatbot interfaces.
|
7 |
+
|
8 |
+
Attributes:
|
9 |
+
single_bot (State): State object for the single chatbot interface
|
10 |
+
dual_bot1 (State): State object for the first bot in dual interface
|
11 |
+
dual_bot2 (State): State object for the second bot in dual interface
|
12 |
+
single_current_category (str): Current category selected in single interface
|
13 |
+
dual_current_category (str): Current category selected in dual interface
|
14 |
+
"""
|
15 |
+
def __init__(self, database):
|
16 |
+
self.single_bot = State(MODELS[0], DEFAULT_TEMPERATURE_1, database, SINGLE_MODEL_BOT_EXAMPLE_SETTING, "single_model_bot")
|
17 |
+
self.dual_bot1 = State(MODELS[0], DEFAULT_TEMPERATURE_1, database, DUAL_MODEL_BOT_1_EXAMPLE_SETTING, "dual_model_bot_1")
|
18 |
+
self.dual_bot2 = State(MODELS[1], DEFAULT_TEMPERATURE_2, database, DUAL_MODEL_BOT_2_EXAMPLE_SETTING, "dual_model_bot_2")
|
19 |
+
self.single_current_category = CATEGORIES[0]
|
20 |
+
self.dual_current_category = CATEGORIES[0]
|
21 |
+
self.initialize()
|
22 |
+
|
23 |
+
def initialize(self):
|
24 |
+
self.single_bot.initialize(self.single_current_category)
|
25 |
+
self.dual_bot1.initialize(self.dual_current_category)
|
26 |
+
self.dual_bot2.initialize(self.dual_current_category)
|
27 |
+
|
28 |
+
def add_message_helper(self, message, bot):
|
29 |
+
for x in message["files"]:
|
30 |
+
bot.history.append({"role": "user", "content": {"path": x}})
|
31 |
+
if message["text"] is not None:
|
32 |
+
bot.history.append({"role": "user", "content": message["text"]})
|
33 |
+
bot.test_entry["question"] = [{"role": "user", "content": message["text"]}]
|
34 |
+
|
35 |
+
def add_message(self, message, target=None):
|
36 |
+
if target is None:
|
37 |
+
self.add_message_helper(message, self.single_bot)
|
38 |
+
return self.single_bot.history, gr.MultimodalTextbox(value=None, interactive=False)
|
39 |
+
if target in ["Model 1", "Both"]:
|
40 |
+
print("Adding message to bot1: {message}")
|
41 |
+
self.add_message_helper(message, self.dual_bot1)
|
42 |
+
if target in ["Model 2", "Both"]:
|
43 |
+
print("Adding message to bot2: {message}")
|
44 |
+
self.add_message_helper(message, self.dual_bot2)
|
45 |
+
return self.dual_bot1.history, self.dual_bot2.history, gr.MultimodalTextbox(value=None, interactive=False)
|
46 |
+
|
47 |
+
def get_reponse_single(self):
|
48 |
+
bot_generation = self.single_bot.response()
|
49 |
+
while True:
|
50 |
+
stop = True
|
51 |
+
try:
|
52 |
+
generation_history = next(bot_generation)
|
53 |
+
stop = False
|
54 |
+
yield generation_history
|
55 |
+
except StopIteration:
|
56 |
+
pass
|
57 |
+
if stop:
|
58 |
+
break
|
59 |
+
|
60 |
+
def get_reponse_dual(self, target):
|
61 |
+
if target != "Both":
|
62 |
+
bot_generation = self.dual_bot1.response() if target == "Model 1" else self.dual_bot2.response()
|
63 |
+
while True:
|
64 |
+
stop = True
|
65 |
+
try:
|
66 |
+
generation_history = next(bot_generation)
|
67 |
+
stop = False
|
68 |
+
if target == "Model 1":
|
69 |
+
yield generation_history, self.dual_bot2.history
|
70 |
+
else:
|
71 |
+
yield self.dual_bot1.history, generation_history
|
72 |
+
except StopIteration:
|
73 |
+
pass
|
74 |
+
if stop:
|
75 |
+
break
|
76 |
+
else:
|
77 |
+
bot1_generation = self.dual_bot1.response()
|
78 |
+
bot2_generation = self.dual_bot2.response()
|
79 |
+
while True:
|
80 |
+
stop = True
|
81 |
+
try:
|
82 |
+
generation_history_1 = next(bot1_generation)
|
83 |
+
stop = False
|
84 |
+
except StopIteration:
|
85 |
+
pass
|
86 |
+
try:
|
87 |
+
generation_history_2 = next(bot2_generation)
|
88 |
+
stop = False
|
89 |
+
except StopIteration:
|
90 |
+
pass
|
91 |
+
yield generation_history_1, generation_history_2
|
92 |
+
if stop:
|
93 |
+
break
|
94 |
+
|
95 |
+
def single_update_category_and_load_config(self, category):
|
96 |
+
self.single_current_category = category
|
97 |
+
self.single_bot.update_category_and_load_config(category)
|
98 |
+
return category
|
99 |
+
|
100 |
+
def dual_update_category_and_load_config(self, category):
|
101 |
+
self.dual_current_category = category
|
102 |
+
self.dual_bot1.update_category_and_load_config(category)
|
103 |
+
self.dual_bot2.update_category_and_load_config(category)
|
104 |
+
return category
|
105 |
+
|
106 |
+
def single_load_example_and_update(self, example):
|
107 |
+
model, temp, category, message = self.single_bot.load_example_and_update(example)
|
108 |
+
return model, temp, category, message
|
109 |
+
|
110 |
+
def dual_load_example_and_update(self, example):
|
111 |
+
model_1, temp_1, category_1, message_1 = self.dual_bot1.load_example_and_update(example)
|
112 |
+
model_2, temp_2, category_2, message_2 = self.dual_bot2.load_example_and_update(example)
|
113 |
+
assert category_1 == category_2
|
114 |
+
assert message_1 == message_2
|
115 |
+
return model_1, temp_1, model_2, temp_2, category_1, message_1
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
|