Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,7 +33,14 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
|
| 39 |
final_answer = FinalAnswerTool()
|
|
@@ -54,7 +61,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 54 |
|
| 55 |
agent = CodeAgent(
|
| 56 |
model=model,
|
| 57 |
-
tools=[final_answer, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove final answer)
|
| 58 |
max_steps=6,
|
| 59 |
verbosity_level=1,
|
| 60 |
grammar=None,
|
|
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
+
def my_ai_joke(arg1:str)-> str: #it's import to specify the return type
|
| 37 |
+
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 38 |
+
"""A tool that tells an AI joke about agents and humans working together
|
| 39 |
+
Args:
|
| 40 |
+
arg1: the first argument
|
| 41 |
+
arg2:
|
| 42 |
+
"""
|
| 43 |
+
return "What magic will you build ?"
|
| 44 |
|
| 45 |
|
| 46 |
final_answer = FinalAnswerTool()
|
|
|
|
| 61 |
|
| 62 |
agent = CodeAgent(
|
| 63 |
model=model,
|
| 64 |
+
tools=[final_answer, get_current_time_in_timezone, image_generation_tool, my_ai_joke], ## add your tools here (don't remove final answer)
|
| 65 |
max_steps=6,
|
| 66 |
verbosity_level=1,
|
| 67 |
grammar=None,
|