Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -89,26 +89,33 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
|
|
89 |
weather_tool = load_tool("agents-course/weather-api", trust_remote_code=True)
|
90 |
wiki_tool = load_tool("agents-course/wiki-search", trust_remote_code=True)
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
with open("prompts.yaml", 'r') as stream:
|
93 |
prompt_templates = yaml.safe_load(stream)
|
94 |
|
95 |
agent = CodeAgent(
|
96 |
model=model,
|
97 |
-
tools=
|
98 |
-
max_steps=
|
99 |
verbosity_level=1,
|
100 |
grammar=None,
|
101 |
planning_interval=None,
|
102 |
name=None,
|
103 |
description=None,
|
104 |
-
prompt_templates=prompt_templates
|
105 |
-
image_generation_tool,
|
106 |
-
weather_tool,
|
107 |
-
wiki_tool,
|
108 |
-
get_current_time_in_timezone,
|
109 |
-
currency_converter,
|
110 |
-
website_availability,
|
111 |
-
text_summarizer
|
112 |
)
|
113 |
|
114 |
|
|
|
89 |
weather_tool = load_tool("agents-course/weather-api", trust_remote_code=True)
|
90 |
wiki_tool = load_tool("agents-course/wiki-search", trust_remote_code=True)
|
91 |
|
92 |
+
all_tools = [
|
93 |
+
final_answer,
|
94 |
+
DuckDuckGoSearchTool(), # Pre-made search
|
95 |
+
WebScrapingTool(), # Pre-made scraping
|
96 |
+
CalculatorTool(), # Pre-made calculator
|
97 |
+
image_generation_tool,
|
98 |
+
weather_tool,
|
99 |
+
wiki_tool,
|
100 |
+
get_current_time_in_timezone,
|
101 |
+
currency_converter,
|
102 |
+
website_availability,
|
103 |
+
text_summarizer
|
104 |
+
]
|
105 |
+
|
106 |
with open("prompts.yaml", 'r') as stream:
|
107 |
prompt_templates = yaml.safe_load(stream)
|
108 |
|
109 |
agent = CodeAgent(
|
110 |
model=model,
|
111 |
+
tools=all_tools,
|
112 |
+
max_steps=12, # Increased step limit
|
113 |
verbosity_level=1,
|
114 |
grammar=None,
|
115 |
planning_interval=None,
|
116 |
name=None,
|
117 |
description=None,
|
118 |
+
prompt_templates=prompt_templates # No comma here!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
)
|
120 |
|
121 |
|