428af3f3c6
- 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>
21 lines
466 B
Go
21 lines
466 B
Go
package router
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestKnowledgePrompt(t *testing.T) {
|
|
prompt := KnowledgePrompt()
|
|
if prompt == "" {
|
|
t.Fatal("KnowledgePrompt returned empty string")
|
|
}
|
|
// Must contain key instructions
|
|
checks := []string{"Мавена", "не знаю", "не выдумывай"}
|
|
for _, c := range checks {
|
|
if !strings.Contains(strings.ToLower(prompt), strings.ToLower(c)) {
|
|
t.Errorf("KnowledgePrompt should mention %q", c)
|
|
}
|
|
}
|
|
}
|