Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,15 +14,15 @@ config = {
|
|
14 |
"temperature": 0,
|
15 |
}
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
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,
|
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,
|