alisamak commited on
Commit
0dfb3a0
·
verified ·
1 Parent(s): 0452919

Update basic_agent.py

Browse files
Files changed (1) hide show
  1. basic_agent.py +12 -38
basic_agent.py CHANGED
@@ -9,43 +9,17 @@ class BasicAgent:
9
  except Exception as e:
10
  return f"Error: {e}"
11
 
12
- def select_tool(self, question: str):
13
- q = question.lower()
14
 
15
- if "wikipedia" in q or "encyclopedia" in q:
16
- return all_tools[1] # search_wikipedia
17
- elif "youtube" in q or "video" in q:
18
- return all_tools[2] # search_youtube_transcript
19
- elif "opposite" in q or "reverse" in q:
20
- return all_tools[3] # reverse_sentence
21
- elif "chess" in q or "position" in q:
22
- return all_tools[4] # solve_chess_position
23
- elif "table" in q or "commutative" in q:
24
- return all_tools[5] # math_solver
25
- elif "libretext" in q or "document" in q:
26
- return all_tools[6] # document_search
27
- elif "vegetable" in q or "botany" in q:
28
- return all_tools[7] # classify_vegetable
29
- elif "audio" in q or "transcribe" in q or "mp3" in q:
30
- return all_tools[8] # transcribe_audio
31
- elif "imdb" in q or "movie" in q or "tv show" in q:
32
- return all_tools[9] # search_imdb
33
- elif "python" in q or "code" in q:
34
- return all_tools[10] # run_python_code
35
- elif "yankee" in q or "baseball" in q and "walks" in q:
36
- return all_tools[11] # search_baseball_stats
37
- elif "nasa" in q or "universe today" in q:
38
- return all_tools[12] # scrape_document
39
- elif "specimen" in q or "zoological" in q:
40
- return all_tools[13] # search_zoological_database
41
- elif "olympic" in q or "athletes" in q:
42
- return all_tools[14] # search_olympic_database
43
- elif "roster" in q or "pitcher" in q:
44
- return all_tools[15] # search_baseball_roster
45
- elif "excel" in q or "sales" in q or "menu" in q:
46
- return all_tools[16] # process_excel
47
- elif "malko" in q or "music competition" in q:
48
- return all_tools[17] # search_classical_music_database
49
- else:
50
- return all_tools[0] # fallback to search_duckduckgo
51
 
 
9
  except Exception as e:
10
  return f"Error: {e}"
11
 
12
+ def select_tool(self, question: str):
13
+ q = question.lower()
14
 
15
+ if "youtube.com" in q or "youtu.be" in q or "in the video" in q:
16
+ return analyze_youtube_video # direct reference, not index
17
+
18
+ elif "how many" in q or "number of" in q:
19
+ return extract_number_from_text
20
+
21
+ elif "wikipedia" in q or "encyclopedia" in q or "who is" in q:
22
+ return search_wikipedia
23
+
24
+ return extract_number_from_text # fallback tool
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25