DrishtiSharma commited on
Commit
abc8f4c
·
verified ·
1 Parent(s): b3a8383

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -65,7 +65,11 @@ react_graph = app_graph.compile()
65
  # Save graph visualization as an image
66
  with tempfile.NamedTemporaryFile(suffix=".png", delete=False) as tmpfile:
67
  graph_image_path = tmpfile.name
68
- react_graph.get_graph(xray=True).draw_mermaid_png(graph_image_path)
 
 
 
 
69
 
70
  # ------------------- Streamlit Interface -------------------
71
  st.title("ReAct Agent with Arithmetic and Search")
 
65
  # Save graph visualization as an image
66
  with tempfile.NamedTemporaryFile(suffix=".png", delete=False) as tmpfile:
67
  graph_image_path = tmpfile.name
68
+ graph = react_graph.get_graph(xray=True)
69
+ graph.draw_mermaid_png()
70
+ with open(tmpfile.name, "wb") as f:
71
+ f.write(graph._repr_png_()) # Save the graph image
72
+
73
 
74
  # ------------------- Streamlit Interface -------------------
75
  st.title("ReAct Agent with Arithmetic and Search")