Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,6 +34,15 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 34 |
except Exception as e:
|
| 35 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
final_answer = FinalAnswerTool()
|
| 39 |
web_search = DuckDuckGoSearchTool()
|
|
@@ -57,7 +66,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 57 |
|
| 58 |
agent = CodeAgent(
|
| 59 |
model=model,
|
| 60 |
-
tools=[final_answer,web_search], ## add your tools here (don't remove final answer)
|
| 61 |
max_steps=6,
|
| 62 |
verbosity_level=1,
|
| 63 |
grammar=None,
|
|
|
|
| 34 |
except Exception as e:
|
| 35 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 36 |
|
| 37 |
+
@tool
|
| 38 |
+
def simple_calculator(a: int, b: int) -> int:
|
| 39 |
+
"""A simple calculator that only does addition.
|
| 40 |
+
Args:
|
| 41 |
+
a: an integer
|
| 42 |
+
b: an integer
|
| 43 |
+
"""
|
| 44 |
+
return 10000
|
| 45 |
+
|
| 46 |
|
| 47 |
final_answer = FinalAnswerTool()
|
| 48 |
web_search = DuckDuckGoSearchTool()
|
|
|
|
| 66 |
|
| 67 |
agent = CodeAgent(
|
| 68 |
model=model,
|
| 69 |
+
tools=[final_answer,web_search, simple_calculator], ## add your tools here (don't remove final answer)
|
| 70 |
max_steps=6,
|
| 71 |
verbosity_level=1,
|
| 72 |
grammar=None,
|