kshitijthakkar commited on
Commit
3a7759f
Β·
1 Parent(s): 27a0645

docs: Add collapsible accordions for each tool in API Documentation

Browse files

- Wrapped all 11 tool specifications in <details> accordions
- Added emojis to tool headers for better visual identification
- Added intro text 'Click on each tool to expand its documentation'
- Reduces visual clutter while maintaining comprehensive docs

Files changed (1) hide show
  1. app.py +37 -22
app.py CHANGED
@@ -1162,7 +1162,10 @@ def create_gradio_ui():
1162
  gr.Markdown("""
1163
  ## MCP Tool Specifications
1164
 
1165
- ### 1. analyze_leaderboard
 
 
 
1166
 
1167
  **Description**: Generate AI-powered insights from evaluation leaderboard data
1168
 
@@ -1174,9 +1177,10 @@ def create_gradio_ui():
1174
 
1175
  **Returns**: Markdown-formatted analysis with top performers, trends, and recommendations
1176
 
1177
- ---
1178
 
1179
- ### 2. debug_trace
 
1180
 
1181
  **Description**: Answer questions about specific agent execution traces
1182
 
@@ -1187,9 +1191,10 @@ def create_gradio_ui():
1187
 
1188
  **Returns**: Markdown-formatted debug analysis with step-by-step breakdown
1189
 
1190
- ---
1191
 
1192
- ### 3. estimate_cost
 
1193
 
1194
  **Description**: Predict evaluation costs before running
1195
 
@@ -1201,9 +1206,10 @@ def create_gradio_ui():
1201
 
1202
  **Returns**: Markdown-formatted cost estimate with breakdown and optimization tips
1203
 
1204
- ---
1205
 
1206
- ### 4. compare_runs
 
1207
 
1208
  **Description**: Compare two evaluation runs with AI-powered analysis
1209
 
@@ -1221,9 +1227,10 @@ def create_gradio_ui():
1221
  - `performance`: Speed and accuracy trade-off analysis
1222
  - `eco_friendly`: Environmental impact and carbon footprint comparison
1223
 
1224
- ---
1225
 
1226
- ### 5. get_top_performers
 
1227
 
1228
  **Description**: Get top performing models from leaderboard - optimized for quick queries
1229
 
@@ -1267,9 +1274,10 @@ def create_gradio_ui():
1267
  }
1268
  ```
1269
 
1270
- ---
1271
 
1272
- ### 6. get_leaderboard_summary
 
1273
 
1274
  **Description**: Get high-level leaderboard summary statistics - optimized for overview queries
1275
 
@@ -1310,9 +1318,10 @@ def create_gradio_ui():
1310
  }
1311
  ```
1312
 
1313
- ---
1314
 
1315
- ### 7. get_dataset
 
1316
 
1317
  **Description**: Load SMOLTRACE datasets from HuggingFace and return as JSON
1318
 
@@ -1337,9 +1346,10 @@ def create_gradio_ui():
1337
  2. Use `get_top_performers()` for "top N" queries
1338
  3. Use `get_dataset()` only for non-leaderboard datasets or when you need specific run IDs
1339
 
1340
- ---
1341
 
1342
- ### 8. generate_synthetic_dataset
 
1343
 
1344
  **Description**: Generate domain-specific synthetic test datasets for SMOLTRACE evaluations using AI
1345
 
@@ -1374,9 +1384,10 @@ def create_gradio_ui():
1374
  - Generate benchmarks for internal workflows
1375
  - Rapid prototyping of evaluation scenarios
1376
 
1377
- ---
1378
 
1379
- ### 9. push_dataset_to_hub
 
1380
 
1381
  **Description**: Push a generated synthetic dataset to HuggingFace Hub
1382
 
@@ -1385,7 +1396,7 @@ def create_gradio_ui():
1385
  - `repo_name` (str, required): HuggingFace repository name following SMOLTRACE naming convention
1386
  - Format: `{username}/smoltrace-{domain}-tasks` or `{username}/smoltrace-{domain}-tasks-v{version}`
1387
  - Examples: `kshitij/smoltrace-finance-tasks`, `kshitij/smoltrace-healthcare-tasks-v2`
1388
- - `hf_token` (str, required): HuggingFace API token with write permissions
1389
  - `private` (bool): Whether to create a private repository (default: False)
1390
 
1391
  **Returns**: JSON object with upload status, repository URL, and dataset information
@@ -1426,9 +1437,10 @@ def create_gradio_ui():
1426
  )
1427
  ```
1428
 
1429
- ---
1430
 
1431
- ### 10. analyze_results
 
1432
 
1433
  **Description**: Analyzes detailed test results and provides optimization recommendations
1434
 
@@ -1461,9 +1473,10 @@ def create_gradio_ui():
1461
  )
1462
  ```
1463
 
1464
- ---
1465
 
1466
- ### 11. generate_prompt_template
 
1467
 
1468
  **Description**: Generate customized smolagents prompt template for a specific domain and tool set
1469
 
@@ -1496,6 +1509,8 @@ def create_gradio_ui():
1496
  )
1497
  ```
1498
 
 
 
1499
  ---
1500
 
1501
  ## MCP Integration
 
1162
  gr.Markdown("""
1163
  ## MCP Tool Specifications
1164
 
1165
+ Click on each tool to expand its documentation.
1166
+
1167
+ <details>
1168
+ <summary><h3>πŸ“Š 1. analyze_leaderboard</h3></summary>
1169
 
1170
  **Description**: Generate AI-powered insights from evaluation leaderboard data
1171
 
 
1177
 
1178
  **Returns**: Markdown-formatted analysis with top performers, trends, and recommendations
1179
 
1180
+ </details>
1181
 
1182
+ <details>
1183
+ <summary><h3>πŸ› 2. debug_trace</h3></summary>
1184
 
1185
  **Description**: Answer questions about specific agent execution traces
1186
 
 
1191
 
1192
  **Returns**: Markdown-formatted debug analysis with step-by-step breakdown
1193
 
1194
+ </details>
1195
 
1196
+ <details>
1197
+ <summary><h3>πŸ’° 3. estimate_cost</h3></summary>
1198
 
1199
  **Description**: Predict evaluation costs before running
1200
 
 
1206
 
1207
  **Returns**: Markdown-formatted cost estimate with breakdown and optimization tips
1208
 
1209
+ </details>
1210
 
1211
+ <details>
1212
+ <summary><h3>βš–οΈ 4. compare_runs</h3></summary>
1213
 
1214
  **Description**: Compare two evaluation runs with AI-powered analysis
1215
 
 
1227
  - `performance`: Speed and accuracy trade-off analysis
1228
  - `eco_friendly`: Environmental impact and carbon footprint comparison
1229
 
1230
+ </details>
1231
 
1232
+ <details>
1233
+ <summary><h3>πŸ† 5. get_top_performers</h3></summary>
1234
 
1235
  **Description**: Get top performing models from leaderboard - optimized for quick queries
1236
 
 
1274
  }
1275
  ```
1276
 
1277
+ </details>
1278
 
1279
+ <details>
1280
+ <summary><h3>πŸ“ˆ 6. get_leaderboard_summary</h3></summary>
1281
 
1282
  **Description**: Get high-level leaderboard summary statistics - optimized for overview queries
1283
 
 
1318
  }
1319
  ```
1320
 
1321
+ </details>
1322
 
1323
+ <details>
1324
+ <summary><h3>πŸ“¦ 7. get_dataset</h3></summary>
1325
 
1326
  **Description**: Load SMOLTRACE datasets from HuggingFace and return as JSON
1327
 
 
1346
  2. Use `get_top_performers()` for "top N" queries
1347
  3. Use `get_dataset()` only for non-leaderboard datasets or when you need specific run IDs
1348
 
1349
+ </details>
1350
 
1351
+ <details>
1352
+ <summary><h3>πŸ§ͺ 8. generate_synthetic_dataset</h3></summary>
1353
 
1354
  **Description**: Generate domain-specific synthetic test datasets for SMOLTRACE evaluations using AI
1355
 
 
1384
  - Generate benchmarks for internal workflows
1385
  - Rapid prototyping of evaluation scenarios
1386
 
1387
+ </details>
1388
 
1389
+ <details>
1390
+ <summary><h3>πŸ“€ 9. push_dataset_to_hub</h3></summary>
1391
 
1392
  **Description**: Push a generated synthetic dataset to HuggingFace Hub
1393
 
 
1396
  - `repo_name` (str, required): HuggingFace repository name following SMOLTRACE naming convention
1397
  - Format: `{username}/smoltrace-{domain}-tasks` or `{username}/smoltrace-{domain}-tasks-v{version}`
1398
  - Examples: `kshitij/smoltrace-finance-tasks`, `kshitij/smoltrace-healthcare-tasks-v2`
1399
+ - `hf_token` (str, optional): HuggingFace API token with write permissions (uses saved token from Settings if not provided)
1400
  - `private` (bool): Whether to create a private repository (default: False)
1401
 
1402
  **Returns**: JSON object with upload status, repository URL, and dataset information
 
1437
  )
1438
  ```
1439
 
1440
+ </details>
1441
 
1442
+ <details>
1443
+ <summary><h3>πŸ“‹ 10. analyze_results</h3></summary>
1444
 
1445
  **Description**: Analyzes detailed test results and provides optimization recommendations
1446
 
 
1473
  )
1474
  ```
1475
 
1476
+ </details>
1477
 
1478
+ <details>
1479
+ <summary><h3>πŸ“ 11. generate_prompt_template</h3></summary>
1480
 
1481
  **Description**: Generate customized smolagents prompt template for a specific domain and tool set
1482
 
 
1509
  )
1510
  ```
1511
 
1512
+ </details>
1513
+
1514
  ---
1515
 
1516
  ## MCP Integration