Skip to content

enhancements: Modified the AI Generate Logic to be more robust and generate 2D figures.#164

Merged
Koyandechirag merged 1 commit into
FOSSEE:mainfrom
Vaibhav-Kumar10:ai-feature
May 5, 2026
Merged

enhancements: Modified the AI Generate Logic to be more robust and generate 2D figures.#164
Koyandechirag merged 1 commit into
FOSSEE:mainfrom
Vaibhav-Kumar10:ai-feature

Conversation

@Vaibhav-Kumar10

Copy link
Copy Markdown
Contributor
  1. Accept an available_components whitelist and strengthen AI diagram generation and validation.
  2. Backend:
  • api/views now forwards optional available_components to core/gemini_service; gemini_service accepts the list,
  • builds a stricter system prompt, falls back to defaults, parses and validates AI JSON (component ids/types, connection references) and
  • returns structured errors.
  1. Frontend:
  • projectApi signature updated to send available_components;
  • Editor collects and normalizes existing component types, sends them to the API, pre-validates AI-generated components, uses AI coordinates when provided, maps IDs to added items, and
  • robustly creates connections (dynamic grip selection).
  1. aiMatcher:
  • added normalizeType mapping, explicit types, and generic-safe matchComponent improvements.
Screenshot 2026-05-04 143046 Screenshot 2026-05-04 143300 Screenshot 2026-05-04 143021 Screenshot 2026-05-04 143340 Screenshot 2026-05-04 142953 Screenshot 2026-05-04 143319

…nerate 2D figures.

Accept an available_components whitelist and strengthen AI diagram generation and validation.
Backend: api/views now forwards optional available_components to core/gemini_service; gemini_service accepts the list, builds a stricter system prompt, falls back to defaults, parses and validates AI JSON (component ids/types, connection references) and returns structured errors.
Frontend: projectApi signature updated to send available_components; Editor collects and normalizes existing component types, sends them to the API, pre-validates AI-generated components, uses AI coordinates when provided, maps IDs to added items, and robustly creates connections (dynamic grip selection).
aiMatcher: added normalizeType mapping, explicit types, and generic-safe matchComponent improvements.
@Koyandechirag Koyandechirag merged commit 22eb7c4 into FOSSEE:main May 5, 2026
2 checks passed
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