Update app.py
Browse files
app.py
CHANGED
@@ -7,9 +7,17 @@ from tools.final_answer import FinalAnswerTool
|
|
7 |
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
10 |
-
# Initialize the
|
11 |
-
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
15 |
@tool
|
@@ -59,7 +67,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
59 |
|
60 |
agent = CodeAgent(
|
61 |
model=model,
|
62 |
-
tools=[
|
63 |
max_steps=6,
|
64 |
verbosity_level=1,
|
65 |
grammar=None,
|
|
|
7 |
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
10 |
+
# Initialize the search tool
|
11 |
+
search_tool = DuckDuckGoSearchTool()
|
12 |
|
13 |
+
# Perform a search
|
14 |
+
search_results = search_tool("Latest news on AI advancements")
|
15 |
+
|
16 |
+
# Process the search results
|
17 |
+
for result in search_results:
|
18 |
+
print(result['title'])
|
19 |
+
print(result['url'])
|
20 |
+
print(result['snippet'])
|
21 |
|
22 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
23 |
@tool
|
|
|
67 |
|
68 |
agent = CodeAgent(
|
69 |
model=model,
|
70 |
+
tools=[search_tool, final_answer, image_generation_tool], ## add your tools here (don't remove final answer)
|
71 |
max_steps=6,
|
72 |
verbosity_level=1,
|
73 |
grammar=None,
|