Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -344,6 +344,11 @@ graph.add_edge("Query Optimization", "SQL Execution")
|
|
| 344 |
|
| 345 |
compiled_pipeline = graph.compile()
|
| 346 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 347 |
# ------------------ Gradio Interface ------------------
|
| 348 |
schema_description = """
|
| 349 |
**Database Schema:**
|
|
@@ -364,9 +369,5 @@ iface = gr.Interface(
|
|
| 364 |
description="Enter a natural language query to generate and execute a SQL query.\n\n" + schema_description
|
| 365 |
)
|
| 366 |
|
| 367 |
-
def run_multi_agent_query(natural_language_query):
|
| 368 |
-
result = compiled_pipeline.invoke({"sql_query": natural_language_query})
|
| 369 |
-
return json.dumps(result.get("execution_result", {}), indent=2)
|
| 370 |
-
|
| 371 |
if __name__ == "__main__":
|
| 372 |
-
iface.launch()
|
|
|
|
| 344 |
|
| 345 |
compiled_pipeline = graph.compile()
|
| 346 |
|
| 347 |
+
# ------------------ Function to Run the Multi-Agent Query ------------------
|
| 348 |
+
def run_multi_agent_query(natural_language_query):
|
| 349 |
+
result = compiled_pipeline.invoke({"sql_query": natural_language_query})
|
| 350 |
+
return json.dumps(result.get("execution_result", {}), indent=2)
|
| 351 |
+
|
| 352 |
# ------------------ Gradio Interface ------------------
|
| 353 |
schema_description = """
|
| 354 |
**Database Schema:**
|
|
|
|
| 369 |
description="Enter a natural language query to generate and execute a SQL query.\n\n" + schema_description
|
| 370 |
)
|
| 371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 372 |
if __name__ == "__main__":
|
| 373 |
+
iface.launch()
|