Jeremy Live
commited on
Commit
路
98aba2a
1
Parent(s):
e5e3372
Let's fix the SQLDatabaseToolkit import issue
Browse files
app.py
CHANGED
@@ -8,15 +8,17 @@ import logging
|
|
8 |
try:
|
9 |
# Intentar importar dependencias opcionales
|
10 |
from langchain_community.agent_toolkits import create_sql_agent
|
|
|
11 |
from langchain_community.utilities import SQLDatabase
|
12 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
13 |
from langchain.agents.agent_types import AgentType
|
|
|
14 |
import pymysql
|
15 |
from dotenv import load_dotenv
|
16 |
|
17 |
DEPENDENCIES_AVAILABLE = True
|
18 |
-
except ImportError:
|
19 |
-
|
20 |
DEPENDENCIES_AVAILABLE = False
|
21 |
|
22 |
# Configuraci贸n de logging
|
|
|
8 |
try:
|
9 |
# Intentar importar dependencias opcionales
|
10 |
from langchain_community.agent_toolkits import create_sql_agent
|
11 |
+
from langchain_community.agent_toolkits.sql.toolkit import SQLDatabaseToolkit
|
12 |
from langchain_community.utilities import SQLDatabase
|
13 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
14 |
from langchain.agents.agent_types import AgentType
|
15 |
+
from langchain_core.messages import AIMessage, HumanMessage, SystemMessage
|
16 |
import pymysql
|
17 |
from dotenv import load_dotenv
|
18 |
|
19 |
DEPENDENCIES_AVAILABLE = True
|
20 |
+
except ImportError as e:
|
21 |
+
logger.warning(f"Some dependencies are not available: {e}")
|
22 |
DEPENDENCIES_AVAILABLE = False
|
23 |
|
24 |
# Configuraci贸n de logging
|