Remove canned creative object replies
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ""
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user