Markiian Tsalyk
commited on
Commit
·
6692c96
1
Parent(s):
25e2c90
Switch to serp API
Browse files- __pycache__/tools.cpython-313.pyc +0 -0
- llama_index_agent.py +2 -1
- tools.py +3 -2
__pycache__/tools.cpython-313.pyc
CHANGED
Binary files a/__pycache__/tools.cpython-313.pyc and b/__pycache__/tools.cpython-313.pyc differ
|
|
llama_index_agent.py
CHANGED
@@ -121,6 +121,7 @@ class LlamaIndexAgent:
|
|
121 |
system_prompt="""
|
122 |
You are a helpful AI assistant that can use tools to answer the user's questions.
|
123 |
You have set of tools that you are free to use.
|
|
|
124 |
When you have the complete answer to the user's question, always use the final_answer tool to present it.
|
125 |
""",
|
126 |
)
|
@@ -171,7 +172,7 @@ if __name__ == "__main__":
|
|
171 |
# "Who did the actor who played Ray in the Polish-language version of Everybody Loves Raymond play in Magda M.? Give only the first name.",
|
172 |
# "Who nominated the only Featured Article on English Wikipedia about a dinosaur that was promoted in November 2016?",
|
173 |
# "What is the final numeric output from the attached Python code? File name: f918266a-b3e0-4914-865d-4faa564f1aef.py",
|
174 |
-
"""Examine the video at https://www.youtube.com/watch?v=1htKBjuUWec.\n\nWhat does Teal'c say in response to the question \"Isn't that hot?\"""",
|
175 |
# "What is the surname of the equine veterinarian mentioned in 1.E Exercises from the chemistry materials licensed by Marisa Alviar-Agnew & Henry Agnew under the CK-12 license in LibreText's Introductory Chemistry materials as compiled 08/21/2023?",
|
176 |
# """
|
177 |
# I'm making a grocery list for my mom, but she's a professor of botany and she's a real stickler when it comes to categorizing things. I need to add different foods to different categories on the grocery list, but if I make a mistake, she won't buy anything inserted in the wrong category. Here's the list I have so far:\n\nmilk, eggs, flour, whole bean coffee, Oreos, sweet potatoes, fresh basil, plums, green beans, rice, corn, bell pepper, whole allspice, acorns, broccoli, celery, zucchini, lettuce, peanuts\n\nI need to make headings for the fruits and vegetables. Could you please create a list of just the vegetables from my list? If you could do that, then I can figure out how to categorize the rest of the list into the appropriate categories. But remember that my mom is a real stickler, so make sure that no botanical fruits end up on the vegetable list, or she won't get them when she's at the store. Please alphabetize the list of vegetables, and place each item in a comma separated list.
|
|
|
121 |
system_prompt="""
|
122 |
You are a helpful AI assistant that can use tools to answer the user's questions.
|
123 |
You have set of tools that you are free to use.
|
124 |
+
You can do web search, parse wikipedia, execute python scripts, read xlsx, get youtube video transcript from youtube link, reverse texts, fetch historical events.
|
125 |
When you have the complete answer to the user's question, always use the final_answer tool to present it.
|
126 |
""",
|
127 |
)
|
|
|
172 |
# "Who did the actor who played Ray in the Polish-language version of Everybody Loves Raymond play in Magda M.? Give only the first name.",
|
173 |
# "Who nominated the only Featured Article on English Wikipedia about a dinosaur that was promoted in November 2016?",
|
174 |
# "What is the final numeric output from the attached Python code? File name: f918266a-b3e0-4914-865d-4faa564f1aef.py",
|
175 |
+
# """Examine the video at https://www.youtube.com/watch?v=1htKBjuUWec.\n\nWhat does Teal'c say in response to the question \"Isn't that hot?\"""",
|
176 |
# "What is the surname of the equine veterinarian mentioned in 1.E Exercises from the chemistry materials licensed by Marisa Alviar-Agnew & Henry Agnew under the CK-12 license in LibreText's Introductory Chemistry materials as compiled 08/21/2023?",
|
177 |
# """
|
178 |
# I'm making a grocery list for my mom, but she's a professor of botany and she's a real stickler when it comes to categorizing things. I need to add different foods to different categories on the grocery list, but if I make a mistake, she won't buy anything inserted in the wrong category. Here's the list I have so far:\n\nmilk, eggs, flour, whole bean coffee, Oreos, sweet potatoes, fresh basil, plums, green beans, rice, corn, bell pepper, whole allspice, acorns, broccoli, celery, zucchini, lettuce, peanuts\n\nI need to make headings for the fruits and vegetables. Could you please create a list of just the vegetables from my list? If you could do that, then I can figure out how to categorize the rest of the list into the appropriate categories. But remember that my mom is a real stickler, so make sure that no botanical fruits end up on the vegetable list, or she won't get them when she's at the store. Please alphabetize the list of vegetables, and place each item in a comma separated list.
|
tools.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from smolagents import DuckDuckGoSearchTool
|
2 |
from youtube_transcript_api import YouTubeTranscriptApi
|
3 |
import wikipedia
|
4 |
from wikipedia_tables_parser import fetch_wikipedia_tables
|
@@ -99,7 +99,8 @@ def web_search(query: str, **kwargs) -> str:
|
|
99 |
Return:
|
100 |
String with web search results.
|
101 |
"""
|
102 |
-
result = DuckDuckGoSearchTool().forward(query)
|
|
|
103 |
print(result)
|
104 |
return result
|
105 |
|
|
|
1 |
+
from smolagents import DuckDuckGoSearchTool, GoogleSearchTool
|
2 |
from youtube_transcript_api import YouTubeTranscriptApi
|
3 |
import wikipedia
|
4 |
from wikipedia_tables_parser import fetch_wikipedia_tables
|
|
|
99 |
Return:
|
100 |
String with web search results.
|
101 |
"""
|
102 |
+
# result = DuckDuckGoSearchTool().forward(query)
|
103 |
+
result = GoogleSearchTool(provider="serpapi").forward(query)
|
104 |
print(result)
|
105 |
return result
|
106 |
|