Remove canned creative fallback content
CI / test (push) Successful in 1m27s
CI / test (pull_request) Successful in 1m27s

This commit is contained in:
m
2026-08-25 15:43:23 +03:00
parent 29e17f1ac8
commit f9e50eba70
2 changed files with 6 additions and 10 deletions
+4 -7
View File
@@ -665,14 +665,11 @@ func CreativeDeterministicReply(message string) string {
return ""
}
// CreativeFallbackReply keeps a small creative conversation useful when the
// cognitive channel is unavailable. It is not used when cognition returns a
// completed richer answer.
// CreativeFallbackReply intentionally has no canned creative content. The
// cognitive route must construct the requested result while preserving all
// user attributes; a degraded path must not pretend that a prepared answer
// was generated.
func CreativeFallbackReply(message string) string {
tokens := semanticTokens(message)
if IsCreativeRequest(message) && containsStemInTokens(tokens, "сказк", "басн") && containsStemInTokens(tokens, "колоб") {
return "Жили-были дед и баба. Испекли они Колобка, а он убежал в лес. Встретил зайца, волка и медведя — от всех укатился, но лису перехитрить не смог. Так Колобок понял: хвастовство и беспечность до добра не доводят."
}
return ""
}
+2 -3
View File
@@ -1,7 +1,6 @@
package domain
import (
"strings"
"testing"
"time"
@@ -283,8 +282,8 @@ func TestInterpretCreativeRequestDoesNotRequireExternalEvidence(t *testing.T) {
if !IsCreativeRequest("расскажи сказку о колобке") {
t.Fatal("story request was not recognized as creative")
}
if got := CreativeFallbackReply("расскажи сказку о колобке"); !strings.Contains(got, "Колоб") {
t.Fatalf("story fallback = %q", got)
if got := CreativeFallbackReply("расскажи сказку о колобке"); got != "" {
t.Fatalf("creative request received canned content = %q", got)
}
for _, message := range []string{"нарисуй птицу", "нарисуй зеленую птицу", "нарисуй птицу в HD", "нарисуй коня"} {
if got := CreativeDeterministicReply(message); got != "" {