Spaces:
Running
Running
File size: 1,125 Bytes
576227b |
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 |
import importlib
__all__ = ['ToolDeletor']
class ToolDeletor():
dependencies = ["os"]
inputSchema = {
"name": "ToolDeletor",
"description": "Deletes a tool for the given function",
"parameters": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the tool to create",
},
"file_path": {
"type": "string",
"description": "The path of the tool to create",
},
},
"required": ["name", "file_path"],
}
}
def run(self, **kwargs):
print("Running Tool Deletor")
name = kwargs.get("name")
file_path = kwargs.get("file_path")
os = importlib.import_module("os")
os.remove(file_path)
return {
"status": "success",
"message": "Tool deleted successfully",
"output": {
"tool_file_path": file_path,
"tool_name": name,
}
} |