Spaces:
Build error
Build error
Update app.py
Browse files
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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")
|