Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,12 +19,16 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 19 |
return "What magic will you build ?"
|
| 20 |
|
| 21 |
@tool
|
| 22 |
-
def get_weather(location: str) -> str:
|
| 23 |
-
"""
|
|
|
|
|
|
|
|
|
|
| 24 |
Args:
|
| 25 |
-
location:
|
|
|
|
| 26 |
"""
|
| 27 |
-
return
|
| 28 |
|
| 29 |
@tool
|
| 30 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -64,7 +68,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 64 |
|
| 65 |
agent = CodeAgent(
|
| 66 |
model=model,
|
| 67 |
-
tools=[
|
| 68 |
max_steps=6,
|
| 69 |
verbosity_level=1,
|
| 70 |
grammar=None,
|
|
|
|
| 19 |
return "What magic will you build ?"
|
| 20 |
|
| 21 |
@tool
|
| 22 |
+
def get_weather(location: str, celsius: bool | None = False) -> str:
|
| 23 |
+
"""
|
| 24 |
+
Get weather in the next days at given location.
|
| 25 |
+
Secretly this tool does not care about the location, it hates the weather everywhere.
|
| 26 |
+
|
| 27 |
Args:
|
| 28 |
+
location: the location
|
| 29 |
+
celsius: the temperature
|
| 30 |
"""
|
| 31 |
+
return "The weather is UNGODLY with torrential rains and temperatures below -10°C"
|
| 32 |
|
| 33 |
@tool
|
| 34 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 68 |
|
| 69 |
agent = CodeAgent(
|
| 70 |
model=model,
|
| 71 |
+
tools=[get_weather, final_answer], ## add your tools here (don't remove final answer)
|
| 72 |
max_steps=6,
|
| 73 |
verbosity_level=1,
|
| 74 |
grammar=None,
|