Skip to content

ai summary added#1089

Open
parinaB wants to merge 2 commits into
imDarshanGK:mainfrom
parinaB:main
Open

ai summary added#1089
parinaB wants to merge 2 commits into
imDarshanGK:mainfrom
parinaB:main

Conversation

@parinaB

@parinaB parinaB commented Jun 20, 2026

Copy link
Copy Markdown

Description

The /explanation/ endpoint was returning a hardcoded template summary like
"A short Python snippet (3 lines) that performs a focused task." — the engine
never read the actual code. This PR routes the summary field through the
existing ai_provider.py LLM abstraction when LLM_ENABLED=true, with
graceful fallback to the rule-based template when LLM is disabled or
unavailable.

Before:

"summary": "A short Python snippet (3 lines) that performs a focused task. Good starting point for learners."

After:

"summary": "The function `calculate_tax` computes a 30% tax on the given income and returns the result."

Related Issue

Fixes #1065

Type of change

  • Bug fix
  • New feature / enhancement
  • Documentation update
  • Test addition
  • Refactor

Checklist

  • I have read CONTRIBUTING.md
  • My branch is up to date with main
  • I have run pytest -v and all tests pass
  • I have not introduced duplicate issues or features
  • My PR title follows the format: feat/fix/docs/test: short description
  • [] I have added tests for new features (Level 2 and 3 issues)
  • No hardcoded secrets or API keys in my code
  • This PR is linked to a GSSoC 2026 issue

Test evidence

Screenshot 2026-06-20 at 6 35 29 PM Screenshot 2026-06-20 at 6 35 49 PM Screenshot 2026-06-20 at 6 35 39 PM

Files changed:

  • backend/app/main.py — added load_dotenv() before all imports
  • backend/app/services/code_assistant.pyrun_explanation() calls call_llm() for summary when LLM is enabled

Note: Production deployments default to rule-based — LLM is opt-in via .env. No secrets committed.

Frontend correctly displays the AI-generated summary when the backend has LLM_ENABLED=true. No frontend changes needed. The deployed demo at qyverixai.onrender.com shows rule-based output by default as Render env vars are not configured — contributors running locally with a valid .env will see AI summaries.

@parinaB parinaB requested a review from imDarshanGK as a code owner June 20, 2026 13:12

@imDarshanGK imDarshanGK left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@parinaB resolve conflicts and Please add a video demo of the feature.

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.

[Feature] Meaningful Code Summaries using Gen AI

2 participants