Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -15,15 +15,15 @@ config = {
|
|
15 |
"temperature": 0,
|
16 |
}
|
17 |
|
18 |
-
|
19 |
-
def time(text: str) -> str:
|
20 |
-
"""Returns todays date, use this for any \
|
21 |
-
questions related to knowing todays date. \
|
22 |
-
The input should always be an empty string, \
|
23 |
-
and this function will always return todays \
|
24 |
-
date - any date mathmatics should occur \
|
25 |
-
outside this function."""
|
26 |
-
return str(date.today())
|
27 |
|
28 |
def invoke(openai_api_key, prompt):
|
29 |
if (openai_api_key == ""):
|
@@ -38,14 +38,14 @@ def invoke(openai_api_key, prompt):
|
|
38 |
|
39 |
tools = load_tools(["llm-math","wikipedia"], llm=llm)
|
40 |
|
41 |
-
agent= initialize_agent(
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
|
48 |
-
result = agent(prompt)
|
49 |
|
50 |
#content = completion.choices[0].message.content
|
51 |
except Exception as e:
|
|
|
15 |
"temperature": 0,
|
16 |
}
|
17 |
|
18 |
+
#@tool
|
19 |
+
#def time(text: str) -> str:
|
20 |
+
# """Returns todays date, use this for any \
|
21 |
+
# questions related to knowing todays date. \
|
22 |
+
# The input should always be an empty string, \
|
23 |
+
# and this function will always return todays \
|
24 |
+
# date - any date mathmatics should occur \
|
25 |
+
# outside this function."""
|
26 |
+
# return str(date.today())
|
27 |
|
28 |
def invoke(openai_api_key, prompt):
|
29 |
if (openai_api_key == ""):
|
|
|
38 |
|
39 |
tools = load_tools(["llm-math","wikipedia"], llm=llm)
|
40 |
|
41 |
+
#agent= initialize_agent(
|
42 |
+
# tools + [time],
|
43 |
+
# llm,
|
44 |
+
# agent=AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,
|
45 |
+
# handle_parsing_errors=True,
|
46 |
+
# verbose = True)
|
47 |
|
48 |
+
#result = agent(prompt)
|
49 |
|
50 |
#content = completion.choices[0].message.content
|
51 |
except Exception as e:
|