Delete state_graph.py
Browse files- state_graph.py +0 -61
state_graph.py
DELETED
|
@@ -1,61 +0,0 @@
|
|
| 1 |
-
from langgraph.graph import StateGraph, START, END
|
| 2 |
-
from state import QuestionState
|
| 3 |
-
from nodes import read_question, classify_question, handle_web_search, \
|
| 4 |
-
handle_reasoning, handle_other, get_file, get_final_answer, \
|
| 5 |
-
get_youtube_transcript, transcribe_audio, enter_url, excel_to_markdown, \
|
| 6 |
-
create_json_for_math
|
| 7 |
-
from routing_logic import route_question, download_file
|
| 8 |
-
|
| 9 |
-
question_graph = StateGraph(QuestionState)
|
| 10 |
-
|
| 11 |
-
question_graph.add_node("read_question", read_question)
|
| 12 |
-
question_graph.add_node("classify_question", classify_question)
|
| 13 |
-
question_graph.add_node("handle_web_search", handle_web_search)
|
| 14 |
-
question_graph.add_node("handle_reasoning", handle_reasoning)
|
| 15 |
-
question_graph.add_node("handle_other", handle_other)
|
| 16 |
-
question_graph.add_node("get_file", get_file)
|
| 17 |
-
question_graph.add_node("enter_url", enter_url)
|
| 18 |
-
question_graph.add_node("transcribe_audio", transcribe_audio)
|
| 19 |
-
question_graph.add_node("excel_to_markdown", excel_to_markdown)
|
| 20 |
-
question_graph.add_node("create_json_for_math", create_json_for_math)
|
| 21 |
-
question_graph.add_node("get_youtube_transcript", get_youtube_transcript)
|
| 22 |
-
question_graph.add_node("get_final_answer", get_final_answer)
|
| 23 |
-
|
| 24 |
-
question_graph.add_edge(START, "read_question")
|
| 25 |
-
# question_graph.add_edge("read_question", "classify_question")
|
| 26 |
-
|
| 27 |
-
question_graph.add_conditional_edges(
|
| 28 |
-
"read_question",
|
| 29 |
-
download_file,
|
| 30 |
-
{
|
| 31 |
-
"get_file": "get_file",
|
| 32 |
-
"classify_question": "classify_question"
|
| 33 |
-
}
|
| 34 |
-
)
|
| 35 |
-
|
| 36 |
-
question_graph.add_edge("get_file", "classify_question")
|
| 37 |
-
|
| 38 |
-
question_graph.add_conditional_edges(
|
| 39 |
-
"classify_question",
|
| 40 |
-
route_question,
|
| 41 |
-
{
|
| 42 |
-
"web_search": "handle_web_search",
|
| 43 |
-
"excel_to_markdown": "excel_to_markdown",
|
| 44 |
-
"text_reasoning": "handle_reasoning",
|
| 45 |
-
"transcribe_audio": "transcribe_audio",
|
| 46 |
-
"get_youtube_transcript": "get_youtube_transcript",
|
| 47 |
-
"other": "handle_other"
|
| 48 |
-
}
|
| 49 |
-
)
|
| 50 |
-
|
| 51 |
-
question_graph.add_edge("transcribe_audio", "handle_reasoning")
|
| 52 |
-
question_graph.add_edge("excel_to_markdown", "create_json_for_math")
|
| 53 |
-
question_graph.add_edge("create_json_for_math", "handle_reasoning")
|
| 54 |
-
question_graph.add_edge("get_youtube_transcript", "handle_reasoning")
|
| 55 |
-
question_graph.add_edge("handle_web_search", "enter_url")
|
| 56 |
-
question_graph.add_edge("enter_url", "handle_reasoning")
|
| 57 |
-
question_graph.add_edge("handle_reasoning", "get_final_answer")
|
| 58 |
-
question_graph.add_edge("handle_other", "get_final_answer")
|
| 59 |
-
question_graph.add_edge("get_final_answer", END)
|
| 60 |
-
|
| 61 |
-
compiled_graph = question_graph.compile()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|