Repository navigation
feat(core,server): record whether each reply answered the question - #585
Merged
Merged
Conversation
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.
Part of P3 (O1): an answer rate is one of the cloud beta's exit checks, and the dashboard lists questions the knowledge doesn't cover. This is F-11's unanswered detector in its minimal form: the free signals only, no judge.
checkAnswered({ reply, retrieval?, cited?, phrases? })in@chatcops/corereturns{ answered, reason? }. A reply isn't answered when:refusal: it says it doesn't know near its start. The phrases cover English, Spanish, French, German and Portuguese, and are only checked in the first 300 characters, so a hedge late in a real answer doesn't count.no_retrieval: a retrieving knowledge source ran and found nothing, or its top score is under an optionalminScore.no_citation: retrieval found pages, but a reply longer than 20 words cited none of them.metadata.answeredandmetadata.unansweredReason. Nothing goes on the wire, and the stream doesn't change.core/analytics.mdxhas a short "Whether a reply answered" section.How I tested this
tests/analytics/unanswered.test.ts: 14 cases. Each language's refusal phrases, the start-only window, custom phrases, no chunks,minScore, uncited long replies, and short and cited replies that pass.tests/handler-answered.test.ts: what's saved for a cited reply, an uncited long reply, empty retrieval, a refusal, and a plain reply.pnpm -r build, typecheck, lint (38),docs:check,api(snapshot updated) and coverage for core and server pass.