bstraehle commited on
Commit
3f5302d
·
1 Parent(s): 1bdaa3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -14,15 +14,15 @@ config = {
14
  "temperature": 0,
15
  }
16
 
17
- #@tool
18
- #def time(text: str) -> str:
19
- # """Returns todays date, use this for any \
20
- # questions related to knowing todays date. \
21
- # The input should always be an empty string, \
22
- # and this function will always return todays \
23
- # date - any date mathmatics should occur \
24
- # outside this function."""
25
- # return str(date.today())
26
 
27
  def invoke(openai_api_key, prompt):
28
  if (openai_api_key == ""):
@@ -43,7 +43,7 @@ def invoke(openai_api_key, prompt):
43
 
44
  print("333")
45
  agent = initialize_agent(
46
- tools, # + [time],
47
  llm,
48
  agent = AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,
49
  handle_parsing_errors = True,
 
14
  "temperature": 0,
15
  }
16
 
17
+ @tool
18
+ def time(text: str) -> str:
19
+ """Returns todays date, use this for any \
20
+ questions related to knowing todays date. \
21
+ The input should always be an empty string, \
22
+ and this function will always return todays \
23
+ date - any date mathmatics should occur \
24
+ outside this function."""
25
+ return str(date.today())
26
 
27
  def invoke(openai_api_key, prompt):
28
  if (openai_api_key == ""):
 
43
 
44
  print("333")
45
  agent = initialize_agent(
46
+ tools, + [time],
47
  llm,
48
  agent = AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,
49
  handle_parsing_errors = True,