yetessam commited on
Commit
d4578f1
·
verified ·
1 Parent(s): d11beff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -7,7 +7,7 @@ import datetime
7
  import requests
8
  import yaml
9
  import os
10
- import pytz # Not allowed for some reason
11
 
12
  # Tools
13
  from tools.final_answer import FinalAnswerTool
@@ -16,7 +16,7 @@ from tools.web_search import DuckDuckGoSearchTool
16
 
17
  from Gradio_UI import GradioUI
18
 
19
- # Don't use: there's an issue with pytz and it seems like its being blocked by HF
20
  @tool
21
  def get_current_time_in_timezone(timezone: str) -> str:
22
 
@@ -75,14 +75,15 @@ combined_prompts = {**prompt_templates, **content_prompts}
75
 
76
  agent = CodeAgent(
77
  model=model,
78
- tools=[final_answer, polite_guard, web_search ], ## add your tools here (don't remove final answer)
79
  max_steps=6,
80
  verbosity_level=1,
81
  grammar=None,
82
  planning_interval=None,
83
  name="Content Moderator",
84
  description=None,
85
- prompt_templates=combined_prompts
 
86
 
87
  )
88
 
 
7
  import requests
8
  import yaml
9
  import os
10
+ import pytz # Had to give it permission in Code agent
11
 
12
  # Tools
13
  from tools.final_answer import FinalAnswerTool
 
16
 
17
  from Gradio_UI import GradioUI
18
 
19
+
20
  @tool
21
  def get_current_time_in_timezone(timezone: str) -> str:
22
 
 
75
 
76
  agent = CodeAgent(
77
  model=model,
78
+ tools=[final_answer, polite_guard, web_search, get_current_time_in_timezone ], ## add your tools here (don't remove final answer)
79
  max_steps=6,
80
  verbosity_level=1,
81
  grammar=None,
82
  planning_interval=None,
83
  name="Content Moderator",
84
  description=None,
85
+ prompt_templates=combined_prompts,
86
+ additional_authorized_imports=["pytz"]
87
 
88
  )
89