Sonu313131 commited on
Commit
4a1be5d
·
verified ·
1 Parent(s): 5a3587b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -27
app.py CHANGED
@@ -16,32 +16,7 @@ login(token=os.environ["HUGGINGFACEHUB_API_TOKEN"])
16
  search_tool = DuckDuckGoSearchTool()
17
 
18
  # --- Tool 1: Wikipedia Search Tool ---
19
- import wikipedia
20
-
21
- class WikipediaTool(Tool):
22
- name = "wikipedia_search"
23
- description = "Search Wikipedia for a given topic and return a concise summary."
24
-
25
- inputs = {
26
- "query": {
27
- "type": "string",
28
- "description": "The topic to search on Wikipedia"
29
- }
30
- }
31
-
32
- output_type = "string"
33
-
34
- def forward(self, query: str) -> str:
35
- try:
36
- page = wikipedia.page(query)
37
- return page.summary[:1000] # First 1000 characters
38
- except wikipedia.exceptions.DisambiguationError as e:
39
- return f"Disambiguation: {', '.join(e.options[:5])}"
40
- except wikipedia.exceptions.PageError:
41
- return "No Wikipedia page found."
42
- except Exception as e:
43
- return f"Error: {str(e)}"
44
-
45
 
46
 
47
  # --- Tool 2: Audio Transcription Tool (uses whisper base) ---
@@ -122,7 +97,7 @@ async def run_and_submit_all(profile: gr.OAuthProfile | None):
122
 
123
  try:
124
  agent = ToolCallingAgent(
125
- tools=[search_tool, wiki_tool, audio_tool, excel_tool],
126
  model=InferenceClientModel(model="deepseek-ai/DeepSeek-V3", provider="together"),
127
  max_steps=15,
128
  verbosity_level=0,
 
16
  search_tool = DuckDuckGoSearchTool()
17
 
18
  # --- Tool 1: Wikipedia Search Tool ---
19
+ #
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
 
22
  # --- Tool 2: Audio Transcription Tool (uses whisper base) ---
 
97
 
98
  try:
99
  agent = ToolCallingAgent(
100
+ tools=[search_tool, audio_tool, excel_tool],
101
  model=InferenceClientModel(model="deepseek-ai/DeepSeek-V3", provider="together"),
102
  max_steps=15,
103
  verbosity_level=0,