Visualization
get_main_graph
get_main_graph(agent: Agent) -> str
Generates the main graph structure in DOT format for the given agent.
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
agent
|
Agent
|
The agent for which the graph is to be generated. |
必須 |
戻り値:
| 名前 | タイプ | デスクリプション |
|---|---|---|
str |
str
|
The DOT format string representing the graph. |
ソースコード位置: src/agents/extensions/visualization.py
get_all_nodes
Recursively generates the nodes for the given agent and its handoffs in DOT format.
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
agent
|
Agent
|
The agent for which the nodes are to be generated. |
必須 |
戻り値:
| 名前 | タイプ | デスクリプション |
|---|---|---|
str |
str
|
The DOT format string representing the nodes. |
ソースコード位置: src/agents/extensions/visualization.py
get_all_edges
Recursively generates the edges for the given agent and its handoffs in DOT format.
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
agent
|
Agent
|
The agent for which the edges are to be generated. |
必須 |
parent
|
Agent
|
The parent agent. Defaults to None. |
None
|
戻り値:
| 名前 | タイプ | デスクリプション |
|---|---|---|
str |
str
|
The DOT format string representing the edges. |
ソースコード位置: src/agents/extensions/visualization.py
draw_graph
draw_graph(
agent: Agent, filename: str | None = None
) -> Source
Draws the graph for the given agent and optionally saves it as a PNG file.
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
agent
|
Agent
|
The agent for which the graph is to be drawn. |
必須 |
filename
|
str
|
The name of the file to save the graph as a PNG. |
None
|
戻り値:
| タイプ | デスクリプション |
|---|---|
Source
|
graphviz.Source: The graphviz Source object representing the graph. |