Closes #67 — new PromptFeedback model (unique on (prompt, user)) with rating (up|down), optional reason / comment, and timestamps via TimeInfoBase.
POST /api/prompt_feedback upserts { prompt_id, rating, reason?, comment? }; DELETE /api/prompt_feedback?prompt_id= clears the caller's vote.
GET conversation_details now nests the caller's feedback: { rating, reason, comment } (or null) on each prompt so chat_web_app#101 can rehydrate thumbs UI.
Auth required; users can only rate assistant prompts in their own non-deleted conversations. Distinct from app-wide POST /feedbacks/.
Joinable to PromptMetric via prompt_id for per-model accuracy slices.
Test plan
uv run python manage.py test chat_backend.tests.test_views_prompt_feedback
Upsert thumbs up, then down with reason/comment — one row updated
DELETE clears vote; second DELETE → 404
Rating another user's prompt → 404; rating a user message → 400
Reload conversation details → assistant prompts show caller feedback only
Companion FE chat_web_app#101 thumbs + reason popover against this API
## Summary
- Closes [#67](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/67) — new `PromptFeedback` model (unique on `(prompt, user)`) with `rating` (`up`|`down`), optional `reason` / `comment`, and timestamps via `TimeInfoBase`.
- `POST /api/prompt_feedback` upserts `{ prompt_id, rating, reason?, comment? }`; `DELETE /api/prompt_feedback?prompt_id=` clears the caller's vote.
- `GET conversation_details` now nests the caller's `feedback: { rating, reason, comment }` (or `null`) on each prompt so [chat_web_app#101](https://git.aimloperations.com/ai_ml_operations/chat_web_app/pulls/101) can rehydrate thumbs UI.
- Auth required; users can only rate assistant prompts in their own non-deleted conversations. Distinct from app-wide `POST /feedbacks/`.
- Joinable to `PromptMetric` via `prompt_id` for per-model accuracy slices.
## Test plan
- [ ] `uv run python manage.py test chat_backend.tests.test_views_prompt_feedback`
- [ ] Upsert thumbs up, then down with reason/comment — one row updated
- [ ] DELETE clears vote; second DELETE → 404
- [ ] Rating another user's prompt → 404; rating a user message → 400
- [ ] Reload conversation details → assistant prompts show caller feedback only
- [ ] Companion FE [chat_web_app#101](https://git.aimloperations.com/ai_ml_operations/chat_web_app/pulls/101) thumbs + reason popover against this API
Companion FE: chat_web_app#101 already posts/deletes prompt_feedback and hydrates from conversation_details.feedback — shapes match this PR.
Companion FE: [chat_web_app#101](https://git.aimloperations.com/ai_ml_operations/chat_web_app/pulls/101) already posts/deletes `prompt_feedback` and hydrates from `conversation_details.feedback` — shapes match this PR.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
PromptFeedbackmodel (unique on(prompt, user)) withrating(up|down), optionalreason/comment, and timestamps viaTimeInfoBase.POST /api/prompt_feedbackupserts{ prompt_id, rating, reason?, comment? };DELETE /api/prompt_feedback?prompt_id=clears the caller's vote.GET conversation_detailsnow nests the caller'sfeedback: { rating, reason, comment }(ornull) on each prompt so chat_web_app#101 can rehydrate thumbs UI.POST /feedbacks/.PromptMetricviaprompt_idfor per-model accuracy slices.Test plan
uv run python manage.py test chat_backend.tests.test_views_prompt_feedbackCompanion FE: chat_web_app#101 already posts/deletes
prompt_feedbackand hydrates fromconversation_details.feedback— shapes match this PR.