Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,15 +99,26 @@ custom_role_conversions=None,
|
|
| 99 |
)
|
| 100 |
|
| 101 |
|
|
|
|
|
|
|
|
|
|
| 102 |
# Import tool from Hub
|
| 103 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
with open("prompts.yaml", 'r') as stream:
|
| 106 |
prompt_templates = yaml.safe_load(stream)
|
| 107 |
|
| 108 |
agent = CodeAgent(
|
| 109 |
model=model,
|
| 110 |
-
tools=
|
| 111 |
max_steps=6,
|
| 112 |
verbosity_level=1,
|
| 113 |
grammar=None,
|
|
|
|
| 99 |
)
|
| 100 |
|
| 101 |
|
| 102 |
+
GradioUI(agent).launch()
|
| 103 |
+
|
| 104 |
+
|
| 105 |
# Import tool from Hub
|
| 106 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 107 |
|
| 108 |
+
tools = [
|
| 109 |
+
final_answer,
|
| 110 |
+
get_approximate_integral,
|
| 111 |
+
get_current_time_in_timezone,
|
| 112 |
+
image_generation_tool, # the hub‑loaded tool
|
| 113 |
+
DuckDuckGoSearchTool(), # plain class → instantiate
|
| 114 |
+
]
|
| 115 |
+
|
| 116 |
with open("prompts.yaml", 'r') as stream:
|
| 117 |
prompt_templates = yaml.safe_load(stream)
|
| 118 |
|
| 119 |
agent = CodeAgent(
|
| 120 |
model=model,
|
| 121 |
+
tools=tools,
|
| 122 |
max_steps=6,
|
| 123 |
verbosity_level=1,
|
| 124 |
grammar=None,
|