Skip to content

🤖 Integrate LLM API for Verbal Ability Evaluation #50

Description

@kumar-veerendra

Summary

Integrate an LLM (Gemini/OpenAI or other supported provider) to evaluate subjective responses in the Verbal Ability module.

The LLM will be responsible for assessing user responses, generating scores, providing constructive feedback, and suggesting improvements for AI-powered verbal practice sections.


Current Behavior

The platform currently supports objective questions but does not have an evaluation engine for subjective Verbal Ability tasks.

The following modules require AI evaluation:

  • Passage Recall
  • Email Writing
  • Future subjective verbal assessments

Proposed Implementation

LLM Integration

  • Integrate a configurable LLM provider (Gemini/OpenAI).
  • Create a reusable AI evaluation service.
  • Support easy switching between LLM providers.

Prompt Engineering

Design optimized prompts that instruct the LLM to evaluate responses based on:

  • Grammar
  • Vocabulary
  • Sentence Structure
  • Relevance
  • Completeness
  • Clarity
  • Professional Tone (Email Writing)
  • Accuracy (Passage Recall)

Response Parsing

Standardize the AI response into a structured format.

Example:

{
  "score": 8.5,
  "grammar": 9,
  "clarity": 8,
  "relevance": 9,
  "feedback": "...",
  "suggestions": [
    "...",
    "..."
  ]
}

Error Handling

  • Handle API failures.
  • Retry failed requests.
  • Show user-friendly error messages.
  • Implement request timeout handling.

Cost Optimization

  • Optimize prompts to reduce token usage.
  • Avoid unnecessary API calls.
  • Reuse prompts where possible.

Caching

  • Cache repeated evaluation requests when appropriate.
  • Prevent duplicate API calls.
  • Improve response time.

Rate Limiting

  • Protect the API from abuse.
  • Limit evaluation requests per user.
  • Prevent accidental excessive LLM usage.

Proposed Flow

User submits response
        │
        ▼
Validate Input
        │
        ▼
Generate Evaluation Prompt
        │
        ▼
Send Request to LLM
        │
        ▼
Receive AI Response
        │
        ▼
Parse Structured Result
        │
        ▼
Store Evaluation
        │
        ▼
Display Score & Feedback

Benefits

  • AI-powered evaluation
  • Detailed personalized feedback
  • Reusable evaluation service
  • Easy integration with future verbal modules
  • Scalable architecture
  • Support for multiple LLM providers

Acceptance Criteria

  • LLM API integrated successfully.
  • Configurable provider (Gemini/OpenAI).
  • Reusable evaluation service implemented.
  • Optimized prompts for different verbal tasks.
  • Structured response parsing.
  • Error handling implemented.
  • Rate limiting added.
  • Basic caching implemented.
  • Evaluation results stored successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    aiAI/LLM related features and integrationsbackendBackend workfeatureRequest for a completely new feature.frontendFrontend work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions