Gaykar commited on
Commit
76a007c
·
1 Parent(s): feceb7f

check compliation

Browse files
Files changed (3) hide show
  1. app/graph.py +20 -1
  2. graph.png +0 -0
  3. requirements.txt +2 -2
app/graph.py CHANGED
@@ -61,7 +61,6 @@ builder.add_node("archive_node", archive_node,retry=db_retry_policy)
61
  builder.add_node("parse_node", parse_response_node)
62
  builder.add_node("tools", ToolNode(email_writing_agent_tools), retry_policy=tool_node_retry_policy)
63
 
64
- # Edges (Same as your original logic)
65
  builder.add_edge(START, "safety_check_node")
66
 
67
  builder.add_conditional_edges(
@@ -124,3 +123,23 @@ builder.add_edge("parse_node", "store_memory_and_data_node")
124
  builder.add_edge("store_memory_and_data_node", END)
125
  builder.add_edge("unsafe_emails_node", END)
126
  builder.add_edge("archive_node", END)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  builder.add_node("parse_node", parse_response_node)
62
  builder.add_node("tools", ToolNode(email_writing_agent_tools), retry_policy=tool_node_retry_policy)
63
 
 
64
  builder.add_edge(START, "safety_check_node")
65
 
66
  builder.add_conditional_edges(
 
123
  builder.add_edge("store_memory_and_data_node", END)
124
  builder.add_edge("unsafe_emails_node", END)
125
  builder.add_edge("archive_node", END)
126
+
127
+
128
+
129
+ graph=builder.compile()
130
+
131
+ print("--- Graph compiled successfully ---"
132
+ )
133
+
134
+ display(graph)
135
+
136
+
137
+ try:
138
+ # This creates a PNG and saves it to your project folder
139
+ graph_png = graph.get_graph().draw_mermaid_png()
140
+ with open("graph.png", "wb") as f:
141
+ f.write(graph_png)
142
+ print("--- Graph image saved as 'graph.png' ---")
143
+ except Exception as e:
144
+ # This happens if you don't have the 'pypydot' or 'graphviz' dependencies
145
+ print(f"Could not generate graph image: {e}")
graph.png ADDED
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
- langchain==1.2.10
2
- langgraph==1.0.9
3
  pydantic==2.11.7
4
  langchain_huggingface
5
  langchain-groq==1.1.1
 
1
+ langchain==1.2.15
2
+ langgraph==1.1.6
3
  pydantic==2.11.7
4
  langchain_huggingface
5
  langchain-groq==1.1.1