Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,11 +34,6 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
|
| 37 |
-
def get_time_zone_tool(inputs: Dict[str, Any]) -> str:
|
| 38 |
-
"""Wrapper for the get_time_zone function."""
|
| 39 |
-
timezone = inputs.get("timezone", "UTC") # Default to UTC if not provided
|
| 40 |
-
return get_time_zone(timezone)
|
| 41 |
-
|
| 42 |
final_answer = FinalAnswerTool()
|
| 43 |
model = HfApiModel(
|
| 44 |
max_tokens=2096,
|
|
@@ -57,7 +52,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 57 |
|
| 58 |
agent = CodeAgent(
|
| 59 |
model=model,
|
| 60 |
-
tools=[final_answer,
|
| 61 |
max_steps=6,
|
| 62 |
verbosity_level=1,
|
| 63 |
grammar=None,
|
|
|
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
final_answer = FinalAnswerTool()
|
| 38 |
model = HfApiModel(
|
| 39 |
max_tokens=2096,
|
|
|
|
| 52 |
|
| 53 |
agent = CodeAgent(
|
| 54 |
model=model,
|
| 55 |
+
tools=[final_answer,get_current_time_in_timezone], ## add your tools here (don't remove final answer)
|
| 56 |
max_steps=6,
|
| 57 |
verbosity_level=1,
|
| 58 |
grammar=None,
|