Spaces:
Sleeping
Sleeping
Update aux_functions/chat_sql_function.py
Browse files
aux_functions/chat_sql_function.py
CHANGED
@@ -3,8 +3,8 @@ from dotenv import load_dotenv
|
|
3 |
from langchain_community.utilities import SQLDatabase
|
4 |
from langchain_community.agent_toolkits import create_sql_agent
|
5 |
from langchain_openai import ChatOpenAI
|
6 |
-
from huggingface_hub import notebook_login
|
7 |
-
from huggingface_hub import hf_secrets
|
8 |
|
9 |
|
10 |
# Load environment variables from .env file
|
@@ -23,7 +23,7 @@ def initiate_chat(querry):
|
|
23 |
|
24 |
# Initialize the SQLDatabase object
|
25 |
db = SQLDatabase.from_uri(db_uri)
|
26 |
-
api_key =
|
27 |
|
28 |
# Initialize the ChatOpenAI object with the desired model
|
29 |
llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0, api_key=api_key)
|
|
|
3 |
from langchain_community.utilities import SQLDatabase
|
4 |
from langchain_community.agent_toolkits import create_sql_agent
|
5 |
from langchain_openai import ChatOpenAI
|
6 |
+
# from huggingface_hub import notebook_login
|
7 |
+
# from huggingface_hub import hf_secrets
|
8 |
|
9 |
|
10 |
# Load environment variables from .env file
|
|
|
23 |
|
24 |
# Initialize the SQLDatabase object
|
25 |
db = SQLDatabase.from_uri(db_uri)
|
26 |
+
api_key = os.get("open_api")
|
27 |
|
28 |
# Initialize the ChatOpenAI object with the desired model
|
29 |
llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0, api_key=api_key)
|