Skip to content

feat: add AntV diagrams + Leaflet maps#83

Open
OchnikBartek wants to merge 1 commit into
mainfrom
feat/advanced-charts
Open

feat: add AntV diagrams + Leaflet maps#83
OchnikBartek wants to merge 1 commit into
mainfrom
feat/advanced-charts

Conversation

@OchnikBartek
Copy link
Copy Markdown
Member

@OchnikBartek OchnikBartek commented Jun 1, 2026

Summary

Adds AntV diagram sidecar + Leaflet map rendering to the generated template, with reliability fixes for MCP tooling across all 6 AI frameworks.

Changes

  • Add enable_antv_charts cookiecutter variable gating AntV MCP sidecar, diagram tools, and Leaflet map rendering
  • Add create_map tool with MapMarker typed schema — prevents empty-marker validation errors from weaker models (GPT-4.5 etc.)
  • Wire create_map into all 6 framework assistants with typed signatures for JSON schema fidelity
  • Add render-once prompt nudge for maps, charts, and AntV diagrams (fixes Opus re-render duplicate bug)
  • Fix MCP connection leak in CrewAI: get_antv_crewai_tools memoizes the started adapter so it's started once per process, not once per request
  • Fix per-request event-loop blocking in LangChain/LangGraph/DeepAgents: memoize tool discovery so _run_sync only blocks on first request
  • Fix antvis-chart Docker healthcheck: plain wget rejected by streamable-HTTP endpoint → replaced with node one-liner
  • Add coordinate bounds validation to MapSpec._validate_center (matches per-marker validation)
  • Remove dead parse_map_spec export
  • Add react-leaflet map renderer in frontend (MapMessage, MapLeaflet components)
  • Add AntV image renderer in tool-call-card.tsx
  • Add matrix test entries for pydantic_ai, langchain, crewai with enable_antv_charts and enable_charts
  • Add TestGeneratedTemplateAntvCharts content tests verifying typed markers, bounds check, cache variables, and absence of removed dead code

Testing

  • Matrix tests: generated pydantic_ai / langchain / crewai / pydantic_deep with --antv-charts; all render, compile, pass ruff
  • TestGeneratedTemplateAntvCharts content tests: MapMarker present, bounds check present, parse_map_spec absent, list[MapMarker] in assistant, module-level cache in antv_chart.py
  • Typed-marker fix verified via LangChain smoke test (dict markers coerced, empty markers rejected)
  • All tests pass locally: make test
  • Linting passes: make lint
  • Type checking passes: make typecheck
  • Generated projects still work: tested with at least one preset

@OchnikBartek OchnikBartek requested a review from DEENUU1 June 1, 2026 13:47
@OchnikBartek OchnikBartek self-assigned this Jun 1, 2026
@OchnikBartek OchnikBartek added the enhancement New feature or request label Jun 1, 2026
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
fastapi_gen/prompts.py 90.90% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants