Srj-ai commited on
Commit
75640ad
·
verified ·
1 Parent(s): 49dfb4a

updated prompt

Browse files
Files changed (1) hide show
  1. app.py +5 -15
app.py CHANGED
@@ -3,8 +3,8 @@ import gradio as gr
3
  import requests
4
  import inspect
5
  import pandas as pd
6
- from smolagents import CodeAgent, WebSearchTool, InferenceClientModel, FinalAnswerTool, tool,WikipediaSearchTool, PythonInterpreterTool
7
- from smolagents.tool import SpeechToTextTool
8
 
9
  # (Keep Constants as is)
10
  # --- Constants ---
@@ -19,18 +19,6 @@ wikipedia_search= WikipediaSearchTool()
19
  python_code_executor=PythonInterpreterTool()
20
 
21
 
22
- @tool
23
- def Excel_reader(file_path: str) -> str:
24
- """Reads a Excel file and returns the data frame including rows and columns.
25
- Args:
26
- file_path: The path to the Excel file.
27
- """
28
- df = pd.read_excel(file_path)
29
- return df.to_string()
30
-
31
-
32
-
33
-
34
  class BasicAgent:
35
  def __init__(self):
36
  print("Srj's Agent initialized.")
@@ -42,7 +30,7 @@ class BasicAgent:
42
  )
43
  self.agent = CodeAgent(
44
  model=self.model,
45
- tools=[final_answer, web_search,audio_to_text_tool,wikipedia_search,python_code_executor, Excel_reader], # add your tools here (don't remove final_answer)
46
  max_steps=5,
47
  verbosity_level=1,
48
  planning_interval=None,
@@ -69,6 +57,8 @@ CRITICAL RULES (Follow EXACTLY):
69
  6. For cities: full name, no abbreviations (Los Angeles, not LA)
70
 
71
  Important: Do not hallucinate. Try to keep your answers based on facts as much as you can. If you dont know the answer, try to use the tools you have. You might need to explore links on the same web page, if fits do that as well. Check and recheck your answers.
 
 
72
 
73
  Question: {question}
74
 
 
3
  import requests
4
  import inspect
5
  import pandas as pd
6
+ from smolagents import CodeAgent,SpeechToTextTool, WebSearchTool, InferenceClientModel, FinalAnswerTool, tool,WikipediaSearchTool, PythonInterpreterTool
7
+
8
 
9
  # (Keep Constants as is)
10
  # --- Constants ---
 
19
  python_code_executor=PythonInterpreterTool()
20
 
21
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  class BasicAgent:
23
  def __init__(self):
24
  print("Srj's Agent initialized.")
 
30
  )
31
  self.agent = CodeAgent(
32
  model=self.model,
33
+ tools=[final_answer, web_search,audio_to_text_tool,wikipedia_search,python_code_executor], # add your tools here (don't remove final_answer)
34
  max_steps=5,
35
  verbosity_level=1,
36
  planning_interval=None,
 
57
  6. For cities: full name, no abbreviations (Los Angeles, not LA)
58
 
59
  Important: Do not hallucinate. Try to keep your answers based on facts as much as you can. If you dont know the answer, try to use the tools you have. You might need to explore links on the same web page, if fits do that as well. Check and recheck your answers.
60
+ If there are audio files then use the tool {audio_to_text_tool} to transcribe it. Important, this tool takes the audio file path as its argument and not the audio file name directly.
61
+ If there is any code that you can execute using the tool {python_code_executor}.
62
 
63
  Question: {question}
64