AOSSIE-Org / AOSSIE-Org/EduAid

[FEATURE]: Expose question generation metadata (requested vs generated count) in API responses

未关闭
#463 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
JavaScript
星标
171
派生
425
PR 合并指标
30 天内没有已合并 PR

描述

### Feature and its Use Cases

What is the feature?

Currently, question generation endpoints (e.g. /get_mcq) return only the generated questions.
When the input text is insufficient, the model may generate fewer questions than requested or none at all, but this information is not explicitly exposed in the API response.

This feature proposes adding generation metadata to the API response, such as:

1.number of questions requested
2.number of questions actually generated
3.a simple generation status (success / partial / insufficient)

How would users benefit from it?
Frontend applications can provide clear and accurate feedback to users instead of guessing based on array length.

Users can understand whether:
1.their input was insufficient
2.the model partially succeeded
3.the request was fully satisfied

Improves developer experience by making API behavior explicit and predictable.

What scenarios does this feature address?
User requests 10 questions but only 3 can be generated due to short input.
User provides very minimal content and no question can be generated.
Frontend needs to distinguish between:
“something went wrong”

“input needs more detail”

“partial success is expected”

This enhancement keeps model behavior unchanged while improving API clarity.

### Additional Context

Image

Requesting 5 MCQs returns only 2 questions, but the API currently does not expose structured metadata to allow the frontend to differentiate between partial success and failure.

### Code of Conduct

- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。