shukdevdattaEX commited on
Commit
82a80ce
·
verified ·
1 Parent(s): 9910f72

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -347,10 +347,10 @@ def format_schema_info(schema_data: dict) -> str:
347
  def process_query(user_query: str, groq_api_key: str):
348
  """Main processing function"""
349
  if not groq_api_key or not groq_api_key.strip():
350
- return "❌ Please enter your Groq API key", "", "", "", ""
351
 
352
  if not user_query or not user_query.strip():
353
- return "❌ Please enter a query", "", "", "", ""
354
 
355
  try:
356
  output_log = []
@@ -395,7 +395,7 @@ def process_query(user_query: str, groq_api_key: str):
395
  }
396
  }
397
 
398
- sql_output_formatted = json.dumps(sql_output, indent=2)
399
  output_log.append("✅ SQL Query Generated:\n")
400
 
401
  # Step 4: Execute query
@@ -423,7 +423,7 @@ def process_query(user_query: str, groq_api_key: str):
423
 
424
  except Exception as e:
425
  error_msg = f"❌ Error: {str(e)}"
426
- return error_msg, "", "", "", ""
427
 
428
  # Custom CSS for better table styling
429
  custom_css = """
 
347
  def process_query(user_query: str, groq_api_key: str):
348
  """Main processing function"""
349
  if not groq_api_key or not groq_api_key.strip():
350
+ return "❌ Please enter your Groq API key", None, "", "", ""
351
 
352
  if not user_query or not user_query.strip():
353
+ return "❌ Please enter a query", None, "", "", ""
354
 
355
  try:
356
  output_log = []
 
395
  }
396
  }
397
 
398
+ sql_output_formatted = sql_output
399
  output_log.append("✅ SQL Query Generated:\n")
400
 
401
  # Step 4: Execute query
 
423
 
424
  except Exception as e:
425
  error_msg = f"❌ Error: {str(e)}"
426
+ return error_msg, None, "", "", ""
427
 
428
  # Custom CSS for better table styling
429
  custom_css = """