maven: general-knowledge phraser routing (task 4)
- Stub.PhraseQuery: empty notes → "не знаю." (was: "no notes") - LLMPhraser.PhraseQuery: empty notes → general knowledge prompt to LLM - Voice handler: on notes RAG failure, try phraser before giving up - New router.KnowledgePrompt() pure function with test Co-Authored-By: opencode <opencode@anthropic.com>
This commit is contained in:
+6
-1
@@ -442,7 +442,12 @@ func (h *reactiveHandler) applyAction(ctx context.Context, dec router.Decision)
|
||||
// since(key)==null → don't fire. Tuned for the ONNX embedder; the Hash
|
||||
// floor scores lexically and may rarely clear it.
|
||||
if len(notes) == 0 || notes[0].Score < queryMinScore {
|
||||
return "у меня нет заметок по этому вопросу."
|
||||
// Try general knowledge from the phraser before giving up
|
||||
reply, err := h.phraser.PhraseQuery(ctx, dec.Utterance, nil)
|
||||
if err != nil || reply == "" {
|
||||
return "не знаю."
|
||||
}
|
||||
return reply
|
||||
}
|
||||
texts := make([]string, len(notes))
|
||||
for i, n := range notes {
|
||||
|
||||
Reference in New Issue
Block a user