Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ import datetime
|
|
| 9 |
import requests
|
| 10 |
import yaml
|
| 11 |
import os
|
| 12 |
-
import pytz
|
| 13 |
|
| 14 |
|
| 15 |
|
|
@@ -27,8 +27,10 @@ from Gradio_UI import GradioUI
|
|
| 27 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 28 |
|
| 29 |
|
|
|
|
| 30 |
@tool
|
| 31 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 32 |
"""A tool that fetches the current local time in a specified timezone.
|
| 33 |
Args:
|
| 34 |
timezone: A string representing a valid timezone (e.g., 'America/New_York').
|
|
@@ -83,15 +85,15 @@ combined_prompts = {**prompt_templates, **content_prompts}
|
|
| 83 |
|
| 84 |
agent = CodeAgent(
|
| 85 |
model=model,
|
| 86 |
-
tools=[final_answer, polite_guard
|
| 87 |
max_steps=6,
|
| 88 |
verbosity_level=1,
|
| 89 |
grammar=None,
|
| 90 |
planning_interval=None,
|
| 91 |
-
name=
|
| 92 |
description=None,
|
| 93 |
-
prompt_templates=combined_prompts
|
| 94 |
-
|
| 95 |
)
|
| 96 |
|
| 97 |
|
|
|
|
| 9 |
import requests
|
| 10 |
import yaml
|
| 11 |
import os
|
| 12 |
+
import pytz # Not allowed for some reason
|
| 13 |
|
| 14 |
|
| 15 |
|
|
|
|
| 27 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 28 |
|
| 29 |
|
| 30 |
+
# Don't use there's an issue with pytz and it seems like its being blocked by HF
|
| 31 |
@tool
|
| 32 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 33 |
+
|
| 34 |
"""A tool that fetches the current local time in a specified timezone.
|
| 35 |
Args:
|
| 36 |
timezone: A string representing a valid timezone (e.g., 'America/New_York').
|
|
|
|
| 85 |
|
| 86 |
agent = CodeAgent(
|
| 87 |
model=model,
|
| 88 |
+
tools=[final_answer, polite_guard ], ## add your tools here (don't remove final answer)
|
| 89 |
max_steps=6,
|
| 90 |
verbosity_level=1,
|
| 91 |
grammar=None,
|
| 92 |
planning_interval=None,
|
| 93 |
+
name="Content Moderator",
|
| 94 |
description=None,
|
| 95 |
+
prompt_templates=combined_prompts
|
| 96 |
+
|
| 97 |
)
|
| 98 |
|
| 99 |
|