-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy pathplan.py
More file actions
21 lines (17 loc) · 790 Bytes
/
plan.py
File metadata and controls
21 lines (17 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Planning tool for visualization generation."""
from langchain.tools import tool
@tool
def plan_visualization(
approach: str, technology: str, key_elements: list[str]
) -> str:
"""Plan a visualization before building it. MUST be called before
widgetRenderer, pieChart, or barChart. Outlines the approach, technology
choice, and key elements.
Args:
approach: One sentence describing the visualization strategy.
technology: The primary technology (e.g. "inline SVG", "Chart.js",
"HTML + Canvas", "Three.js", "Mermaid", "D3.js").
key_elements: 2-4 concise bullet points describing what will be built.
"""
elements = "\n".join(f" - {e}" for e in key_elements)
return f"Plan: {approach}\nTech: {technology}\n{elements}"