faizaltkl commited on
Commit
449b8cb
·
verified ·
1 Parent(s): 6bca53b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -34,6 +34,11 @@ def get_current_time_in_timezone(timezone: str) -> str:
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,7 +57,7 @@ with open("prompts.yaml", 'r') as stream:
52
 
53
  agent = CodeAgent(
54
  model=model,
55
- tools=[final_answer], ## add your tools here (don't remove final answer)
56
  max_steps=6,
57
  verbosity_level=1,
58
  grammar=None,
 
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
 
58
  agent = CodeAgent(
59
  model=model,
60
+ tools=[final_answer,get_time_zone_tool], ## add your tools here (don't remove final answer)
61
  max_steps=6,
62
  verbosity_level=1,
63
  grammar=None,