Integrate AI-Powered Plan Analysis & Tuning Recommendations - #923
Open
shane-borden wants to merge 12 commits into
Open
Integrate AI-Powered Plan Analysis & Tuning Recommendations#923shane-borden wants to merge 12 commits into
shane-borden wants to merge 12 commits into
Conversation
…storage functionality
Integrate AI-Powered Plan Analysis & Tuning Recommendations
refactor: improve error handling and type safety in AiAnalysis component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrate AI-Powered Plan Analysis & Tuning Recommendations
This pull request introduces a new AI Plan Analyzer feature to PEV2. It allows users to get automated query tuning advice, index suggestions, and bottleneck analysis from Google Gemini, OpenAI, Anthropic, or local Ollama instances directly in their browser.
🚀 Key Features
ai-service.ts) parses the markdown response returned by the AI into styled HTML with custom classes.🛠️ Detailed Code Changes
1. New Components & Services
src/components/AiAnalysis.vue:src/services/ai-service.ts:hashString(): Generates a stable base-36 hash of the execution plan source to organize local history.parseMarkdown(): Safely converts standard markdown (headers, code blocks, lists, bold/italics) to styled HTML.2. Integration with Main UI
src/components/Plan.vue:src/components/index.ts:AiAnalysiscomponent.3. Security & Policy Configurations
index.html:Content-Security-Policy(connect-src) to allow browser requests to:https://generativelanguage.googleapis.com)https://api.openai.com)https://api.anthropic.com)http://localhost:11434)src/services/ai-service.ts:4. Tests & Documentation
src/services/__tests__/ai-service.spec.ts:hashStringandparseMarkdown(testing escaping, headers, bold/italic rendering, list structures, and paragraph wrapper logics).README.md: