Route local recovery by semantic intent
This commit is contained in:
@@ -103,6 +103,27 @@ func TestDeterministicCandidateTreatsModelRequestAsDirectiveNeedingCognition(t *
|
||||
}
|
||||
}
|
||||
|
||||
func TestInformationRequestsAreClassifiedOnceByInteraction(t *testing.T) {
|
||||
cases := []struct {
|
||||
message string
|
||||
kind interaction.InformationRequestKind
|
||||
}{
|
||||
{"какие модели доступны?", interaction.InformationRequestCognitiveModelInventory},
|
||||
{"что ты умеешь?", interaction.InformationRequestCapabilityInventory},
|
||||
{"проверь состояние локального канала", interaction.InformationRequestCognitiveChannelStatus},
|
||||
{"нет связи с ИИ, восстанови канал", interaction.InformationRequestCognitiveRecovery},
|
||||
}
|
||||
for _, test := range cases {
|
||||
result, err := InterpretUtterance(interaction.HumanUtterance{Content: test.message}, nil, nil, time.Unix(10, 0))
|
||||
if err != nil {
|
||||
t.Fatalf("interpret %q: %v", test.message, err)
|
||||
}
|
||||
if result.InformationRequestKind != test.kind {
|
||||
t.Fatalf("message=%q kind=%q want=%q", test.message, result.InformationRequestKind, test.kind)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeterministicCandidateKeepsFirstPersonCompletedWorkAsAssertion(t *testing.T) {
|
||||
candidate := BuildDeterministicCandidate("Я всё уже настроил.", "", time.Unix(10, 0).UnixMilli())
|
||||
if candidate.PrimarySpeechAct != interaction.SpeechActAssertion {
|
||||
|
||||
Reference in New Issue
Block a user