Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ import os
|
|
7 |
import tempfile
|
8 |
from tools.final_answer import FinalAnswerTool # Assuming this exists in ./tools/final_answer.py
|
9 |
from tools.visit_webpage import VisitWebpageTool # Assuming this exists in ./tools/visit_webpage.py
|
|
|
10 |
from smolagents import GradioUI
|
11 |
import gradio as gr
|
12 |
import json # Not used directly in the provided snippet, but can be common
|
@@ -130,7 +131,7 @@ def get_file_download_link(file_path: str) -> str:
|
|
130 |
|
131 |
|
132 |
final_answer = FinalAnswerTool()
|
133 |
-
|
134 |
visit_webpage=VisitWebpageTool()
|
135 |
|
136 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
@@ -154,7 +155,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
154 |
|
155 |
agent = CodeAgent(
|
156 |
model=model,
|
157 |
-
tools=[final_answer,visit_webpage,create_document,get_file_download_link], ## add your tools here (don't remove final answer)
|
158 |
max_steps=6,
|
159 |
verbosity_level=1,
|
160 |
prompt_templates=prompt_templates
|
|
|
7 |
import tempfile
|
8 |
from tools.final_answer import FinalAnswerTool # Assuming this exists in ./tools/final_answer.py
|
9 |
from tools.visit_webpage import VisitWebpageTool # Assuming this exists in ./tools/visit_webpage.py
|
10 |
+
from tools.web_search import DuckDuckGoSearchTool
|
11 |
from smolagents import GradioUI
|
12 |
import gradio as gr
|
13 |
import json # Not used directly in the provided snippet, but can be common
|
|
|
131 |
|
132 |
|
133 |
final_answer = FinalAnswerTool()
|
134 |
+
web_search=DuckDuckGoSearchTool() # This was commented out in original, keeping it so
|
135 |
visit_webpage=VisitWebpageTool()
|
136 |
|
137 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
|
|
155 |
|
156 |
agent = CodeAgent(
|
157 |
model=model,
|
158 |
+
tools=[final_answer,visit_webpage,create_document,get_file_download_link,web_search], ## add your tools here (don't remove final answer)
|
159 |
max_steps=6,
|
160 |
verbosity_level=1,
|
161 |
prompt_templates=prompt_templates
|