draw_ascii#
- langchain_core.runnables.graph_ascii.draw_ascii(vertices: Mapping[str, str], edges: Sequence[Edge]) str [source]#
构建一个DAG并以ASCII形式绘制它。
- Parameters:
vertices (list) – 图的顶点列表。
edges (list) – 图的边列表。
- Returns:
ASCII 表示
- Return type:
字符串
示例
>>> vertices = [1, 2, 3, 4] >>> edges = [(1, 2), (2, 3), (2, 4), (1, 4)] >>> print(draw(vertices, edges)) +---+ +---+ | 3 | | 4 | +---+ *+---+ * ** * * ** * * * * +---+ * | 2 | * +---+ * * * * * ** +---+ | 1 | +---+