Spaces:
Sleeping
Sleeping
Update tools/tool_base.py
Browse files- tools/tool_base.py +9 -8
tools/tool_base.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
-
class
|
| 2 |
-
name = ""
|
| 3 |
-
description = ""
|
| 4 |
-
inputs = {}
|
| 5 |
-
output_type = "string"
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
|
| 10 |
def forward(self, **kwargs):
|
| 11 |
-
raise NotImplementedError("
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class BaseTool:
|
| 2 |
+
name: str = "base_tool"
|
| 3 |
+
description: str = "Base class for tools."
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
inputs: dict = {}
|
| 6 |
+
output_type: str = "string"
|
| 7 |
|
| 8 |
def forward(self, **kwargs):
|
| 9 |
+
raise NotImplementedError("Each tool must implement a `forward` method.")
|
| 10 |
+
|
| 11 |
+
def __call__(self, **kwargs):
|
| 12 |
+
return self.forward(**kwargs)
|