Repository navigation
feat(chat): thumbs up or down on answers - #702
Merged
Merged
Conversation
Saved on the answer, shown when the conversation opens, carried in its JSON
export, and given by agents with PUT .../messages/{mid}/rating or the MCP tool
rate_answer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YUXoQ6nuvTZdkDZn3xUoaj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: there was no way to say an answer was good or bad, so nothing recorded which answers worked.
After: a finished answer in chat has a thumbs up and a thumbs down. Pressing one saves it, pressing it again takes it back (no confirm). The rating is saved on the answer, shown when the conversation opens on any device, and carried in the conversation's JSON export (
lens.rating). Agents rate the same way withPUT /api/v1/chats/{cid}/messages/{mid}/rating(up,downornull) or the new MCP toolrate_answer(up,down,clear), and read it back fromGET /chats/{cid}andread_chat.How: an optional
rating(andrated_at) on the schemalesschat_messagetable, set bychat.rate(), which only accepts the owner's assistant messages.Answershows the buttons with an optimistic update that rolls back on error.Motivation and Context
Planned in the fine-tuning design (§3.2, "thumbs up/down on assistant answers"): it is the label the dataset builder's
sftrecipe keeps good answers by. Listed in whats-left section D.Types of changes
Checklist:
tests/api/test_chat_ratings.py,__tests__/chat-rating.test.tsx, MCP write-tool list).docs/assistant.md#rating-answers,docs/api.md,docs/mcp.md, README built list,docs/requirements.md.changelog.d/rate-answers.md.Done questions (AGENTS.md)
PUT .../ratingand MCPrate_answer;read_chatreturns it.make openapi)._own_chat, andIconButton'sactivestate.Generated by Claude Code