Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from datetime import datetime
|
|
5 |
from langchain.agents import AgentType, initialize_agent, load_tools, tool
|
6 |
from langchain.chat_models import ChatOpenAI
|
7 |
from openai import OpenAI
|
|
|
8 |
|
9 |
from dotenv import load_dotenv, find_dotenv
|
10 |
_ = load_dotenv(find_dotenv())
|
@@ -25,7 +26,7 @@ def time(text: str) -> str:
|
|
25 |
The input should always be an empty string, and this function will always return current datetime.
|
26 |
Any date and time mathematics should occur outside this function."""
|
27 |
dt = datetime.now()
|
28 |
-
dt_local = dt.astimezone()
|
29 |
return dt_local.strftime("%d/%m/%Y %H:%M:%S")
|
30 |
|
31 |
def invoke(openai_api_key, prompt, agent_option):
|
|
|
5 |
from langchain.agents import AgentType, initialize_agent, load_tools, tool
|
6 |
from langchain.chat_models import ChatOpenAI
|
7 |
from openai import OpenAI
|
8 |
+
from tzlocal import get_localzone
|
9 |
|
10 |
from dotenv import load_dotenv, find_dotenv
|
11 |
_ = load_dotenv(find_dotenv())
|
|
|
26 |
The input should always be an empty string, and this function will always return current datetime.
|
27 |
Any date and time mathematics should occur outside this function."""
|
28 |
dt = datetime.now()
|
29 |
+
dt_local = dt.astimezone(get_localzone())
|
30 |
return dt_local.strftime("%d/%m/%Y %H:%M:%S")
|
31 |
|
32 |
def invoke(openai_api_key, prompt, agent_option):
|