The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
fix: core: draw_mermaid() would create subgroup for edges with same src and tgt (#21275)
Nuno Campos6e1e0c7d5c4f
diff --git a/libs/core/langchain_core/runnables/graph_mermaid.py b/libs/core/langchain_core/runnables/graph_mermaid.pyindex 61b922ae68..69a2d84562 100644--- a/libs/core/langchain_core/runnables/graph_mermaid.py+++ b/libs/core/langchain_core/runnables/graph_mermaid.py@@ -64,8 +64,8 @@ def draw_mermaid(subgraph = ""# Add edges to the graphfor edge in edges:- src_prefix = edge.source.split(":")[0]- tgt_prefix = edge.target.split(":")[0]+ src_prefix = edge.source.split(":")[0] if ":" in edge.source else None+ tgt_prefix = edge.target.split(":")[0] if ":" in edge.target else None# exit subgraph if source or target is not in the same subgraphif subgraph and (subgraph != src_prefix or subgraph != tgt_prefix):mermaid_graph += "\tend\n"