fix: route model mentions by intent
This commit is contained in:
@@ -432,10 +432,11 @@ func capabilityHintsFor(primary, secondary interaction.SpeechAct, tokens []strin
|
||||
if containsInterrogative(tokens) && containsArithmetic(tokens) {
|
||||
add("COGNITIVE_REASONING")
|
||||
}
|
||||
if containsToken(tokens, "свободно") || containsToken(tokens, "гб") || containsToken(tokens, "модель") {
|
||||
if containsToken(tokens, "свободно") || containsToken(tokens, "гб") {
|
||||
add("VERIFY_FACT")
|
||||
}
|
||||
if containsStemInTokens(tokens, "модел", "ии") && containsStemInTokens(tokens, "настро", "список", "доступ", "подключ") {
|
||||
modelIntent := containsStemInTokens(tokens, "настро", "список", "доступ", "подключ", "сравн", "выбер", "провер", "проверь", "перечисл")
|
||||
if containsStemInTokens(tokens, "модел", "ии") && modelIntent && (primary == interaction.SpeechActQuestion || primary == interaction.SpeechActDirective || primary == interaction.SpeechActRequestToInvestigate || secondary == interaction.SpeechActQuestion || secondary == interaction.SpeechActDirective || secondary == interaction.SpeechActRequestToInvestigate) {
|
||||
add("VERIFY_FACT")
|
||||
}
|
||||
values := make([]string, 0, len(seen))
|
||||
|
||||
@@ -103,6 +103,15 @@ func TestDeterministicCandidateTreatsModelRequestAsDirectiveNeedingCognition(t *
|
||||
}
|
||||
}
|
||||
|
||||
func TestAWordModelDoesNotTriggerModelInventoryOrVerification(t *testing.T) {
|
||||
candidate := BuildDeterministicCandidate("модель должна понимать смысл вопроса", "", time.Unix(10, 0).UnixMilli())
|
||||
for _, hint := range candidate.CapabilityHints {
|
||||
if hint == "VERIFY_FACT" {
|
||||
t.Fatalf("an incidental model mention must not trigger fact verification: %+v", candidate)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestInformationRequestsAreClassifiedOnceByInteraction(t *testing.T) {
|
||||
cases := []struct {
|
||||
message string
|
||||
|
||||
Reference in New Issue
Block a user