Tesvia commited on
Commit
10acbd8
·
verified ·
1 Parent(s): 8cf4b42

Upload tools.py

Browse files
Files changed (1) hide show
  1. tools.py +8 -8
tools.py CHANGED
@@ -14,7 +14,7 @@ class PythonRunTool(Tool):
14
  Execute trusted Python code and return printed output + repr() of the last expression (or _result variable).
15
  """
16
  inputs = {
17
- "code": {"type": str, "description": "Python code to execute", "required": True}
18
  }
19
  output_type = "string"
20
 
@@ -37,9 +37,9 @@ class ExcelLoaderTool(Tool):
37
  Read .xlsx/.xls/.csv from disk and return rows as a list of dictionaries with string keys.
38
  """
39
  inputs = {
40
- "path": {"type": str, "description": "Path to .csv/.xls/.xlsx file", "required": True},
41
  "sheet": {
42
- "type": str,
43
  "description": "Sheet name or index (optional, required for Excel files only)",
44
  "required": False,
45
  "default": "",
@@ -69,8 +69,8 @@ class YouTubeTranscriptTool(Tool):
69
  Return the subtitles of a YouTube URL using youtube-transcript-api.
70
  """
71
  inputs = {
72
- "url": {"type": str, "description": "YouTube URL", "required": True},
73
- "lang": {"type": str, "description": "Transcript language (default: en)", "required": False, "default": "en"}
74
  }
75
  output_type = "string"
76
 
@@ -88,8 +88,8 @@ class AudioTranscriptionTool(Tool):
88
  Transcribe an audio file with OpenAI Whisper, returns plain text."
89
  """
90
  inputs = {
91
- "path": {"type": str, "description": "Path to audio file", "required": True},
92
- "model": {"type": str, "description": "Model name for transcription (default: whisper-1)", "required": False, "default": "whisper-1"}
93
  }
94
  output_type = "string"
95
 
@@ -109,7 +109,7 @@ class SimpleOCRTool(Tool):
109
  Return any text spotted in an image via pytesseract OCR.
110
  """
111
  inputs = {
112
- "path": {"type": str, "description": "Path to image file", "required": True}
113
  }
114
  output_type = "string"
115
 
 
14
  Execute trusted Python code and return printed output + repr() of the last expression (or _result variable).
15
  """
16
  inputs = {
17
+ "code": {"type": "string", "description": "Python code to execute", "required": True}
18
  }
19
  output_type = "string"
20
 
 
37
  Read .xlsx/.xls/.csv from disk and return rows as a list of dictionaries with string keys.
38
  """
39
  inputs = {
40
+ "path": {"type": "string", "description": "Path to .csv/.xls/.xlsx file", "required": True},
41
  "sheet": {
42
+ "type": "string",
43
  "description": "Sheet name or index (optional, required for Excel files only)",
44
  "required": False,
45
  "default": "",
 
69
  Return the subtitles of a YouTube URL using youtube-transcript-api.
70
  """
71
  inputs = {
72
+ "url": {"type": "string", "description": "YouTube URL", "required": True},
73
+ "lang": {"type": "string", "description": "Transcript language (default: en)", "required": False, "default": "en"}
74
  }
75
  output_type = "string"
76
 
 
88
  Transcribe an audio file with OpenAI Whisper, returns plain text."
89
  """
90
  inputs = {
91
+ "path": {"type": "string", "description": "Path to audio file", "required": True},
92
+ "model": {"type": "string", "description": "Model name for transcription (default: whisper-1)", "required": False, "default": "whisper-1"}
93
  }
94
  output_type = "string"
95
 
 
109
  Return any text spotted in an image via pytesseract OCR.
110
  """
111
  inputs = {
112
+ "path": {"type": "string", "description": "Path to image file", "required": True}
113
  }
114
  output_type = "string"
115