Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import os
|
|
| 2 |
import sqlite3
|
| 3 |
import json
|
| 4 |
import openai
|
| 5 |
-
from langgraph.graph import StateGraph
|
| 6 |
from typing import TypedDict, Optional
|
| 7 |
|
| 8 |
# Set your OpenAI API key from environment variable
|
|
@@ -125,6 +125,8 @@ def execution_agent(state: SQLExecutionState) -> SQLExecutionState:
|
|
| 125 |
graph.add_node("SQL Execution", execution_agent)
|
| 126 |
|
| 127 |
# ------------------ Define Execution Flow ------------------
|
|
|
|
|
|
|
| 128 |
graph.add_edge("Query Understanding", "Query Validation")
|
| 129 |
graph.add_edge("Query Validation", "Query Optimization")
|
| 130 |
graph.add_edge("Query Optimization", "SQL Execution")
|
|
|
|
| 2 |
import sqlite3
|
| 3 |
import json
|
| 4 |
import openai
|
| 5 |
+
from langgraph.graph import StateGraph, START
|
| 6 |
from typing import TypedDict, Optional
|
| 7 |
|
| 8 |
# Set your OpenAI API key from environment variable
|
|
|
|
| 125 |
graph.add_node("SQL Execution", execution_agent)
|
| 126 |
|
| 127 |
# ------------------ Define Execution Flow ------------------
|
| 128 |
+
# Adding an edge from the reserved START node to the first agent establishes the entrypoint.
|
| 129 |
+
graph.add_edge(START, "Query Understanding")
|
| 130 |
graph.add_edge("Query Understanding", "Query Validation")
|
| 131 |
graph.add_edge("Query Validation", "Query Optimization")
|
| 132 |
graph.add_edge("Query Optimization", "SQL Execution")
|