-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtools_description.py
472 lines (414 loc) · 16 KB
/
tools_description.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
tools = [
{
"type": "function",
"function": {
"name": "generate_data_using_script",
"description": "Use uv to run a given script with the provided email argument to generate the data files",
"parameters": {
"type": "object",
"properties": {
"script_url": {
"type": "string",
"description": "Script Url"
},
"email_argument": {
"type": "string",
"description": "Email argument"
},
},
"required": ["script_url", "email_argument"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "format_file",
"description": "Use prettier with the given version to format the contents of the file whose path is provided",
"parameters": {
"type": "object",
"properties": {
"file_path": {
"type": "string",
"description": "File Path"
},
"prettier_version": {
"type": "string",
"description": "prettier version"
},
},
"required": ["file_path", "prettier_version"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "count_no_of_days",
"description": "Count the number of a particular day of the week, example Wednesday, from the dates given in a particular file (path specified) and output the result to a given file (path specified)",
"parameters": {
"type": "object",
"properties": {
"dates_file_path": {
"type": "string",
"description": "Path of the file containing the dates"
},
"day_of_the_week": {
"type": "string",
"description": "Day of the week as per English calender eg format: Wednesday"
},
"output_file_path": {
"type": "string",
"description": "Path of the required output file"
},
},
"required": ["dates_file_path", "day_of_the_week", "output_file_path"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "sort_contacts",
"description": "Sort the array of contacts in a given file (path specified) by prop_1, then by prop_2 and write the result to a output file (path specified)",
"parameters": {
"type": "object",
"properties": {
"contacts_file_path": {
"type": "string",
"description": "Path of the file containing the contacts"
},
"sorting_properties": {
"type": "array",
"items": {
"type": "string",
"description": "Property by which the array should be sorted, in the order of priority"
},
"description": "Array of properties by which the array of contacts should be sorted, in the order of priority"
},
"output_file_path": {
"type": "string",
"description": "Path of the required output file"
},
},
"required": ["contacts_file_path", "sorting_properties", "output_file_path"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "manipulate_logs",
"description": "Write the first line of the given number of most recent .log file in a given path to a given output file (path specified)",
"parameters": {
"type": "object",
"properties": {
"dir_path": {
"type": "string",
"description": "Path of the directory containing the .log files"
},
"num_of_recent": {
"type": "string",
"description": "Required number of most recent .log file"
},
"output_file_path": {
"type": "string",
"description": "Path of the required output file"
},
},
"required": ["dir_path", "num_of_recent", "output_file_path"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "manipulate_markdowns",
"description": "Extract the first occurrance of each H1 (line starting with # ) from .md files in a given directory (path specified), then, create a index file in the specified path that that maps each filename to its title ",
"parameters": {
"type": "object",
"properties": {
"dir_path": {
"type": "string",
"description": "Path of the directory containing the .md files"
},
"output_file_path": {
"type": "string",
"description": "Path of the required output file"
},
},
"required": ["dir_path", "output_file_path"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "extract_email_info",
"description": "Extract the required information, eg: sender's email address, etc., from a email message (path specified) and write it to the specified output file (path specified)",
"parameters": {
"type": "object",
"properties": {
"email_file_path": {
"type": "string",
"description": "Path of the file containing the email message"
},
"req_info": {
"type": "string",
"description": "The required information eg: sender's email address or receiver's email address or sender's name, etc."
},
"output_file_path": {
"type": "string",
"description": "Path of the required output file"
},
},
"required": ["email_file_path", "req_info", "output_file_path"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "extract_cc_number",
"description": "Extract the required information from a credit card image (path specified) and write it to the specified output file (path specified)",
"parameters": {
"type": "object",
"properties": {
"img_file_path": {
"type": "string",
"description": "Path of the credit card image file"
},
"req_info": {
"type": "string",
"description": "The required information"
},
"output_file_path": {
"type": "string",
"description": "Path of the required output file"
},
},
"required": ["img_file_path", "req_info", "output_file_path"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "get_most_similar_comments",
"description": "Get the most similar pair of comments in a given file (path specified) and write them to a output file (path specified)",
"parameters": {
"type": "object",
"properties": {
"comments_file_path": {
"type": "string",
"description": "Path of the file conatining the comments"
},
"output_file_path": {
"type": "string",
"description": "Path of the required output file"
},
},
"required": ["comments_file_path", "output_file_path"],
"additionalProperties": False
},
"strict": True
}
},
########## Starting Business Tools Description ###############
# Tool Description for task B3 - Fetch data from an API and save it
{
"type": "function",
"function": {
"name": "fetch_and_save_data",
"description": "Fetch data from the given api url with optional parameters and save to the specified output file",
"parameters": {
"type": "object",
"properties": {
"api_url": {
"type": "string",
"description": "Url of the api endpoint"
},
"params": {
"type": "string",
"description": "Parameters for the api call"
},
"output_file_path": {
"type": "string",
"description": "Path of the required output file"
},
},
"required": ["api_url", "output_file_path"],
"additionalProperties": False
},
"strict": False
}
},
{
"type": "function",
"function": {
"name": "clone_and_commit_git_repo",
"description": "This function handles prompts that involve cloning a git repository. It takes the entire prompt and processes it to clone the repo and commit changes.",
"parameters": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The entire user prompt that asks for cloning a git repository."
}
},
"required": ["prompt"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "run_sql_query",
"description": "This function handles prompts that involve running a SQL query on a SQLite or DuckDB database. This takes the entire user prompt as its only argument - prompt.",
"parameters": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The entire user prompt as provided without any modifications"
}
},
"required": ["prompt"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "scrape_website",
"description": "This function handles prompts that involve scraping a website. This takes the entire user prompt as its only argument - prompt.",
"parameters": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The entire user prompt that asks for scraping a website"
}
},
"required": ["prompt"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "compress_or_resize",
"description": "This function handles prompts that involve compresing or resizing an image. This takes the entire user prompt as its only argument - prompt.",
"parameters": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The entire user prompt that asks for compresing or resizing an image"
}
},
"required": ["prompt"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "transcribe_audio",
"description": "This function handles prompts that involve transcribing audio from an mp3 file. This takes the entire user prompt as its only argument - prompt.",
"parameters": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The entire user prompt that asks for transcribing audio from an mp3 file"
}
},
"required": ["prompt"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "markdown_to_html",
"description": "This function handles prompts that involve converting markdown to html. This takes the entire user prompt as its only argument - prompt.",
"parameters": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The entire user prompt that asks for converting markdown to html"
}
},
"required": ["prompt"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "csv_to_json",
"description": "This function handles prompts that involve filtering a CSV file and returns JSON data. This takes the entire user prompt as its only argument - prompt",
"parameters": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The entire user prompt that asks for filtering a CSV file and returns JSON data"
}
},
"required": ["prompt"],
"additionalProperties": False
},
"strict": True
}
},
{
"type": "function",
"function": {
"name": "other_tasks",
"description": "This function handles prompts that involve tasks not covered by the other specified functions. This takes the entire user prompt as its only argument - prompt.",
"parameters": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The entire user prompt that involves tasks not specified in the other functions."
}
},
"required": ["prompt"],
"additionalProperties": False
},
"strict": True
}
},
]