Skip to content

Conversation

@DayuanJiang
Copy link
Owner

Summary

Enhances AI system prompts to improve diagram generation quality and reduce errors.

Changes

JSON Escaping Warnings

  • Add critical warnings about escaping double quotes in tool call JSON
  • Example: "y=\"119\"" must be escaped as "y=\\"119\\""
  • This prevents JSON parse errors from malformed tool calls

Edge Routing Rules

  • Add comprehensive rules to prevent overlapping connector lines
  • Rules for bidirectional connections (use opposite sides)
  • Rules for obstacle avoidance (route around shapes)
  • Guidelines for using waypoints properly

Planning Guidance

  • Add instruction to plan diagram layout before generating XML
  • Helps avoid element overlapping and edge crossing issues

Token Count Updates

  • Update token count estimates in comments

- Add JSON escaping warnings to help model generate valid tool calls
- Add comprehensive edge routing rules to prevent overlapping lines
- Add planning guidance for diagram creation
- Update token count estimates in comments
@vercel
Copy link

vercel bot commented Dec 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
next-ai-draw-io Error Error Dec 6, 2025 3:35pm

@DayuanJiang DayuanJiang merged commit 4be6431 into main Dec 6, 2025
3 of 4 checks passed
@DayuanJiang DayuanJiang deleted the feat/enhance-system-prompts branch December 6, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants