Spaces:
Sleeping
Sleeping
Add Bright Data Dataset Tool
Browse files
tool.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
from typing import Any, Optional
|
| 2 |
from smolagents.tools import Tool
|
| 3 |
import json
|
| 4 |
-
import requests
|
| 5 |
-
import os
|
| 6 |
import time
|
|
|
|
|
|
|
| 7 |
|
| 8 |
class BrightDataDatasetTool(Tool):
|
| 9 |
name = "brightdata_dataset_fetch"
|
|
@@ -20,7 +20,9 @@ class BrightDataDatasetTool(Tool):
|
|
| 20 |
self.inputs = {
|
| 21 |
"dataset": {
|
| 22 |
"type": "string",
|
| 23 |
-
"description":
|
|
|
|
|
|
|
| 24 |
},
|
| 25 |
"url": {
|
| 26 |
"type": "string",
|
|
|
|
| 1 |
from typing import Any, Optional
|
| 2 |
from smolagents.tools import Tool
|
| 3 |
import json
|
|
|
|
|
|
|
| 4 |
import time
|
| 5 |
+
import os
|
| 6 |
+
import requests
|
| 7 |
|
| 8 |
class BrightDataDatasetTool(Tool):
|
| 9 |
name = "brightdata_dataset_fetch"
|
|
|
|
| 20 |
self.inputs = {
|
| 21 |
"dataset": {
|
| 22 |
"type": "string",
|
| 23 |
+
"description": "Dataset key",
|
| 24 |
+
# Provide choices so UI renders a dropdown instead of a long list.
|
| 25 |
+
"enum": sorted(self.datasets.keys()),
|
| 26 |
},
|
| 27 |
"url": {
|
| 28 |
"type": "string",
|