Skip to content

PyVizAST Prerelease 1.0.0-beta

Pre-release
Pre-release

Choose a tag to compare

@ChidcGithub ChidcGithub released this 21 Mar 13:47
· 2 commits to main since this release

LLM AI Refactoring & Bug Fixes

LLM Explanation Panel Refactoring:

  • Redesigned AI explanation panel with premium black/white minimalist theme
  • Added unavailable state UI with helpful messages when LLM not configured
  • Added fullscreen modal for detailed reading
  • Improved loading states and error handling
  • Auto-retry on failure (up to 2 times)

Backend LLM Service Refactoring:

  • Improved prompt templates with clearer JSON output format requirements
  • Multi-strategy JSON parsing with fallback mechanisms
  • Thread-safe caching with TTL for explanation caching
  • Case-insensitive model name matching (codeLlama:7b vs codellama:7b)
  • Separated error handling for availability check and model listing
  • Added shorter timeouts to avoid UI hanging

Frontend LLM Integration Improvements:

  • Added custom event system (llmConfigChanged) for cross-component communication
  • Fixed React Hooks order issue (useMemo before early return)
  • Fixed incorrect default status value ('ready''unavailable')
  • Improved SSE parsing with type annotations
  • Better error feedback and loading states

Files Added:

  • frontend/src/components/LLMExplanationPanel.js - AI explanation panel component
  • frontend/src/components/LLMExplanationPanel.css - Black/white minimalist styles

Files Modified:

  • backend/llm/prompts.py - Improved prompt templates
  • backend/llm/service.py - Multi-strategy parsing, caching, status handling
  • backend/llm/ollama_client.py - Shorter timeouts
  • backend/routers/llm.py - Unified error responses, detailed logging
  • frontend/src/api.js - SSE parsing, shorter timeouts
  • frontend/src/components/LLMSettings.js - Event dispatching, improved status handling
  • frontend/src/components/ASTVisualizer.js - Event listeners, fixed default status
  • frontend/src/components/ASTVisualizer3D.js - Event listeners, fixed default status
  • frontend/src/components/components.css - LLM explanation panel styles

Bug Fixes:

  • Fixed model not loading when clicking Load button
  • Fixed UI stuck at loading state (timeout optimization)
  • Fixed false "loaded" display when model not actually loaded
  • Fixed React Hooks error (useMemo called after early return)
  • Fixed model name case sensitivity matching