Desi-Kalakars / pariksha.ai

Questions generating app using GenAI.
1 stars 0 forks source link

Create generate questions route #5

Closed googleknight closed 3 months ago

googleknight commented 4 months ago

Create an API route with following API contract

API contract

Request

POST /api/generate-questions
{
  "file": "file_content_in_base64_or_binary",
  "subject": "optional_subject",
  "content": "user_provided_content",
  "question_types": {
    "mcq_single": 2,
    "mcq_multiple": 2,
    "fill_in_the_blanks": 2,
    "descriptive": 2
  }
}

Response

{
  "status": "success",
  "questions": {
    "mcq_single": ["question1", "question2"],
    "mcq_multiple": ["question1", "question2"],
    "fill_in_the_blanks": ["question1", "question2"],
    "descriptive": ["question1", "question2"]
  }
}