Spaces:
Build error
Build error
remove docstring
Browse files- planning_ai/graph.py +5 -11
planning_ai/graph.py
CHANGED
@@ -19,17 +19,6 @@ from planning_ai.states import OverallState
|
|
19 |
|
20 |
|
21 |
def create_graph():
|
22 |
-
"""Creates and compiles a state graph for document processing.
|
23 |
-
|
24 |
-
This function sets up a state graph using the `StateGraph` class, defining nodes
|
25 |
-
and edges for processing documents. It includes nodes for generating summaries,
|
26 |
-
checking and fixing hallucinations, and generating a final summary. Conditional
|
27 |
-
edges are added to manage the flow of data between nodes based on the processing
|
28 |
-
state.
|
29 |
-
|
30 |
-
Returns:
|
31 |
-
StateGraph: The compiled state graph ready for execution.
|
32 |
-
"""
|
33 |
graph = StateGraph(OverallState)
|
34 |
graph.add_node("add_entities", add_entities)
|
35 |
graph.add_node("retrieve_themes", retrieve_themes)
|
@@ -69,3 +58,8 @@ def create_graph():
|
|
69 |
graph.add_edge("generate_final_summary", END)
|
70 |
|
71 |
return graph.compile()
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
|
21 |
def create_graph():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
graph = StateGraph(OverallState)
|
23 |
graph.add_node("add_entities", add_entities)
|
24 |
graph.add_node("retrieve_themes", retrieve_themes)
|
|
|
58 |
graph.add_edge("generate_final_summary", END)
|
59 |
|
60 |
return graph.compile()
|
61 |
+
|
62 |
+
|
63 |
+
def plot_mermaid():
|
64 |
+
graph = create_graph()
|
65 |
+
print(graph.get_graph().draw_mermaid())
|