Remove canned creative object replies
CI / test (push) Successful in 1m25s
CI / test (pull_request) Successful in 1m24s

This commit is contained in:
m
2026-08-25 15:40:29 +03:00
parent ae8bf68d73
commit 29e17f1ac8
3 changed files with 13 additions and 33 deletions
+4 -8
View File
@@ -73,14 +73,10 @@ func TestHouseholdBearDrawingUsesCreativeLocalRoute(t *testing.T) {
t.Fatalf("bear drawing selected web research: %+v", candidate)
}
}
if got := interactiondomain.CreativeDeterministicReply("нарисуй бурого медведя"); got != "🐻" {
t.Fatalf("bear drawing fallback=%q", got)
}
if got := interactiondomain.CreativeDeterministicReply("нарисуй птицу"); got != "🐦" {
t.Fatalf("bird drawing fallback=%q", got)
}
if got := interactiondomain.CreativeDeterministicReply("нарисуй коня"); got != "🐴" {
t.Fatalf("horse drawing fallback=%q", got)
for _, message := range []string{"нарисуй бурого медведя", "нарисуй птицу", "нарисуй зеленую птицу", "нарисуй птицу в HD", "нарисуй коня"} {
if got := interactiondomain.CreativeDeterministicReply(message); got != "" {
t.Fatalf("creative request %q received a canned reply=%q", message, got)
}
}
}
+3 -15
View File
@@ -658,22 +658,10 @@ func IsCreativeRequest(message string) bool {
return isCreativeRequestTokens(tokens)
}
// CreativeDeterministicReply covers simple geometric sketches that do not
// need a model or external source. Rich creative content remains cognitive.
// CreativeDeterministicReply intentionally has no example-specific answer
// branches. Creative requests must retain their full meaning and go through
// cognition; canned object or color answers hide lost attributes.
func CreativeDeterministicReply(message string) string {
tokens := semanticTokens(message)
if containsStemInTokens(tokens, "нарис", "рису", "изобраз") && containsStemInTokens(tokens, "круг", "окруж") {
return "◯"
}
if containsStemInTokens(tokens, "нарис", "рису", "изобраз") && containsStemInTokens(tokens, "медвед", "мишк") {
return "🐻"
}
if containsStemInTokens(tokens, "нарис", "рису", "изобраз") && containsStemInTokens(tokens, "птиц", "птичк", "ворон", "голуб") {
return "🐦"
}
if containsStemInTokens(tokens, "нарис", "рису", "изобраз") && containsStemInTokens(tokens, "кон", "лошад", "жереб") {
return "🐴"
}
return ""
}
+6 -10
View File
@@ -277,8 +277,8 @@ func TestInterpretCreativeRequestDoesNotRequireExternalEvidence(t *testing.T) {
if result.Interpretation.SpeechAct == interaction.SpeechActQuestion || containsString(result.CapabilityHints, "WEB_RESEARCH") {
t.Fatalf("creative request was routed as external research: %+v", result)
}
if got := CreativeDeterministicReply("нарисуй круг"); got != "◯" {
t.Fatalf("circle reply = %q", got)
if got := CreativeDeterministicReply("нарисуй круг"); got != "" {
t.Fatalf("creative request received a canned reply = %q", got)
}
if !IsCreativeRequest("расскажи сказку о колобке") {
t.Fatal("story request was not recognized as creative")
@@ -286,14 +286,10 @@ func TestInterpretCreativeRequestDoesNotRequireExternalEvidence(t *testing.T) {
if got := CreativeFallbackReply("расскажи сказку о колобке"); !strings.Contains(got, "Колоб") {
t.Fatalf("story fallback = %q", got)
}
if got := CreativeDeterministicReply("нарисуй бурого медведя"); got != "🐻" {
t.Fatalf("bear reply = %q", got)
}
if got := CreativeDeterministicReply("нарисуй птицу"); got != "🐦" {
t.Fatalf("bird reply = %q", got)
}
if got := CreativeDeterministicReply("нарисуй коня"); got != "🐴" {
t.Fatalf("horse reply = %q", got)
for _, message := range []string{"нарисуй птицу", "нарисуй зеленую птицу", "нарисуй птицу в HD", "нарисуй коня"} {
if got := CreativeDeterministicReply(message); got != "" {
t.Fatalf("creative request %q received a canned reply = %q", message, got)
}
}
}