Jeremy Live
commited on
Commit
·
71b2232
1
Parent(s):
2c7cbe3
d1
Browse files
app.py
CHANGED
@@ -196,9 +196,30 @@ def create_agent():
|
|
196 |
return None, error_msg
|
197 |
|
198 |
# Inicializar el agente
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
agent, agent_error = create_agent()
|
200 |
db_connected = agent is not None
|
201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
def extract_sql_query(text):
|
203 |
"""Extrae consultas SQL del texto usando expresiones regulares."""
|
204 |
if not text:
|
|
|
196 |
return None, error_msg
|
197 |
|
198 |
# Inicializar el agente
|
199 |
+
logger.info("="*50)
|
200 |
+
logger.info("Starting application initialization...")
|
201 |
+
logger.info(f"Python version: {sys.version}")
|
202 |
+
logger.info(f"Current working directory: {os.getcwd()}")
|
203 |
+
logger.info(f"Files in working directory: {os.listdir('.')}")
|
204 |
+
|
205 |
+
# Check environment variables
|
206 |
+
logger.info("Checking environment variables...")
|
207 |
+
required_vars = ["DB_USER", "DB_HOST", "DB_NAME", "GOOGLE_API_KEY"]
|
208 |
+
for var in required_vars:
|
209 |
+
logger.info(f"{var}: {'*' * 8 if os.getenv(var) else 'NOT SET'}")
|
210 |
+
|
211 |
+
# Initialize agent
|
212 |
+
logger.info("Initializing agent...")
|
213 |
agent, agent_error = create_agent()
|
214 |
db_connected = agent is not None
|
215 |
|
216 |
+
if agent:
|
217 |
+
logger.info("Agent initialized successfully")
|
218 |
+
else:
|
219 |
+
logger.error(f"Failed to initialize agent: {agent_error}")
|
220 |
+
|
221 |
+
logger.info("="*50)
|
222 |
+
|
223 |
def extract_sql_query(text):
|
224 |
"""Extrae consultas SQL del texto usando expresiones regulares."""
|
225 |
if not text:
|