Nioi commited on
Commit
77fac25
·
1 Parent(s): 5a0465b

minor fixes

Browse files
Files changed (2) hide show
  1. agent.py +1 -2
  2. tools/{media.py → chess.py} +0 -21
agent.py CHANGED
@@ -1,9 +1,8 @@
1
  import os
2
  from smolagents import CodeAgent, DuckDuckGoSearchTool, OpenAIServerModel, VisitWebpageTool, LiteLLMModel
3
- from tools.attached_files import csv_reader, download_file_from_url, excel_reader
4
  from tools.basic_math import *
5
  from tools.browser import arvix_search, wiki_search
6
- from tools.media import transcribe_audio
7
 
8
  def get_agent(provider:str) -> CodeAgent:
9
  search_tool = DuckDuckGoSearchTool(max_results=5)
 
1
  import os
2
  from smolagents import CodeAgent, DuckDuckGoSearchTool, OpenAIServerModel, VisitWebpageTool, LiteLLMModel
3
+ from tools.attached_files import csv_reader, download_file_from_url, excel_reader, transcribe_audio
4
  from tools.basic_math import *
5
  from tools.browser import arvix_search, wiki_search
 
6
 
7
  def get_agent(provider:str) -> CodeAgent:
8
  search_tool = DuckDuckGoSearchTool(max_results=5)
tools/{media.py → chess.py} RENAMED
@@ -1,28 +1,7 @@
1
  from smolagents import tool
2
- import whisper
3
  import requests
4
- from attached_files import download_file_from_url
5
 
6
  STOCKFISH_API_URL = "https://stockfish.online/api/s/v2.php"
7
- MODEL = whisper.load_model("tiny")
8
-
9
- @tool
10
- def transcribe_audio(task_id: str) -> str:
11
- """
12
- Extract MP3 file content and return it as text. Supported file extensions: .mp3
13
- Args:
14
- task_id: the question TASK_ID.
15
- """
16
-
17
- file_path = download_file_from_url(FILES_URL+task_id)
18
- result = None
19
-
20
- try:
21
- result = MODEL.transcribe(file_path)
22
- except Exception as e:
23
- return f"Error transcribing file: {str(e)}"
24
-
25
- return result['text']
26
 
27
  #@tool
28
  def get_fen(file_path:str) -> str:
 
1
  from smolagents import tool
 
2
  import requests
 
3
 
4
  STOCKFISH_API_URL = "https://stockfish.online/api/s/v2.php"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  #@tool
7
  def get_fen(file_path:str) -> str: