Spaces:
Build error
Build error
Update myagent_langraph.py
Browse files- myagent_langraph.py +5 -5
myagent_langraph.py
CHANGED
|
@@ -5,7 +5,7 @@ from langchain_core.messages import AnyMessage, SystemMessage, HumanMessage
|
|
| 5 |
from langgraph.graph.message import add_messages
|
| 6 |
from langgraph.graph import START, StateGraph
|
| 7 |
from langgraph.prebuilt import ToolNode, tools_condition
|
| 8 |
-
from IPython.display import Image, display
|
| 9 |
from langchain_community.document_loaders import WikipediaLoader
|
| 10 |
from langchain_community.tools.tavily_search import TavilySearchResults
|
| 11 |
|
|
@@ -215,10 +215,10 @@ if __name__ == "__main__":
|
|
| 215 |
react_graph = build_graph()
|
| 216 |
# Show the butler's thought process
|
| 217 |
# Save the graph visualization to disk
|
| 218 |
-
graph_image = react_graph.get_graph(xray=True).draw_mermaid_png()
|
| 219 |
-
with open("graph_visualization.png", "wb") as f:
|
| 220 |
-
|
| 221 |
-
print("Graph visualization saved to 'graph_visualization.png'")
|
| 222 |
|
| 223 |
# Also display it if in an environment that supports display
|
| 224 |
#display(Image(graph_image))
|
|
|
|
| 5 |
from langgraph.graph.message import add_messages
|
| 6 |
from langgraph.graph import START, StateGraph
|
| 7 |
from langgraph.prebuilt import ToolNode, tools_condition
|
| 8 |
+
#from IPython.display import Image, display
|
| 9 |
from langchain_community.document_loaders import WikipediaLoader
|
| 10 |
from langchain_community.tools.tavily_search import TavilySearchResults
|
| 11 |
|
|
|
|
| 215 |
react_graph = build_graph()
|
| 216 |
# Show the butler's thought process
|
| 217 |
# Save the graph visualization to disk
|
| 218 |
+
#graph_image = react_graph.get_graph(xray=True).draw_mermaid_png()
|
| 219 |
+
#with open("graph_visualization.png", "wb") as f:
|
| 220 |
+
# f.write(graph_image)
|
| 221 |
+
#print("Graph visualization saved to 'graph_visualization.png'")
|
| 222 |
|
| 223 |
# Also display it if in an environment that supports display
|
| 224 |
#display(Image(graph_image))
|