quick and easy visualization of Agent flow using mermaid

this one-liner shows how to create a mermaid visualization of the workflow for beginner to start learning.
This commit is contained in:
Moshi Wei 2025-07-23 19:33:51 +08:00
parent a438acdbbd
commit 098d6193ac
1 changed files with 16 additions and 0 deletions

16
mermaid_graph_plot.py Normal file
View File

@ -0,0 +1,16 @@
from tradingagents.graph.trading_graph import TradingAgentsGraph
from tradingagents.default_config import DEFAULT_CONFIG
from dotenv import load_dotenv
load_dotenv()
# Create a custom config
config = DEFAULT_CONFIG.copy()
config["deep_think_llm"] = "gpt-4.1-nano" # Use a different model
config["quick_think_llm"] = "gpt-4.1-nano" # Use a different model
config["max_debate_rounds"] = 1 # Increase debate rounds
config["online_tools"] = True # Use online tools or cached data
# Initialize with custom config
ta = TradingAgentsGraph(debug=True, config=config)
print(ta.graph.get_graph().draw_mermaid())