Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,13 +34,16 @@ 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 |
@tool
|
| 38 |
-
def
|
| 39 |
-
|
|
|
|
| 40 |
Args:
|
| 41 |
-
|
|
|
|
| 42 |
"""
|
| 43 |
-
return "
|
| 44 |
|
| 45 |
|
| 46 |
final_answer = FinalAnswerTool()
|
|
@@ -64,7 +67,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 64 |
|
| 65 |
agent = CodeAgent(
|
| 66 |
model=model,
|
| 67 |
-
tools=[final_answer,
|
| 68 |
max_steps=6,
|
| 69 |
verbosity_level=1,
|
| 70 |
grammar=None,
|
|
|
|
| 34 |
except Exception as e:
|
| 35 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 36 |
|
| 37 |
+
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 38 |
@tool
|
| 39 |
+
def my_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
| 40 |
+
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 41 |
+
"""A tool that does nothing yet
|
| 42 |
Args:
|
| 43 |
+
arg1: the first argument
|
| 44 |
+
arg2: the second argument
|
| 45 |
"""
|
| 46 |
+
return "What magic will you build ?"
|
| 47 |
|
| 48 |
|
| 49 |
final_answer = FinalAnswerTool()
|
|
|
|
| 67 |
|
| 68 |
agent = CodeAgent(
|
| 69 |
model=model,
|
| 70 |
+
tools=[final_answer, my_tool], ## add your tools here (don't remove final answer)
|
| 71 |
max_steps=6,
|
| 72 |
verbosity_level=1,
|
| 73 |
grammar=None,
|