add web search tool
Browse files
app.py
CHANGED
@@ -44,6 +44,8 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
44 |
|
45 |
final_answer = FinalAnswerTool()
|
46 |
|
|
|
|
|
47 |
# 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:
|
48 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
49 |
|
@@ -54,7 +56,6 @@ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may
|
|
54 |
custom_role_conversions=None,
|
55 |
)
|
56 |
|
57 |
-
|
58 |
# Import tool from Hub
|
59 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
60 |
|
@@ -63,7 +64,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
63 |
|
64 |
agent = CodeAgent(
|
65 |
model=model,
|
66 |
-
tools=[who_am_i, my_custom_tool, get_current_time_in_timezone, final_answer], ## add your tools here (don't remove final answer)
|
67 |
max_steps=6,
|
68 |
verbosity_level=1,
|
69 |
grammar=None,
|
|
|
44 |
|
45 |
final_answer = FinalAnswerTool()
|
46 |
|
47 |
+
web_search = DuckDuckGoSearchTool()
|
48 |
+
|
49 |
# 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:
|
50 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
51 |
|
|
|
56 |
custom_role_conversions=None,
|
57 |
)
|
58 |
|
|
|
59 |
# Import tool from Hub
|
60 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
61 |
|
|
|
64 |
|
65 |
agent = CodeAgent(
|
66 |
model=model,
|
67 |
+
tools=[who_am_i, my_custom_tool, web_search, get_current_time_in_timezone, final_answer], ## add your tools here (don't remove final answer)
|
68 |
max_steps=6,
|
69 |
verbosity_level=1,
|
70 |
grammar=None,
|