37 lines
1.2 KiB
Go
37 lines
1.2 KiB
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.cin.su/m/Assistant/contracts/interaction"
|
|
interactiondomain "git.cin.su/m/Assistant/modules/interaction/domain"
|
|
)
|
|
|
|
func TestSimpleQuestionUsesBuiltInAdvisoryWithoutStrictInterpretation(t *testing.T) {
|
|
result := interactiondomain.SemanticResult{
|
|
Interpretation: interaction.UtteranceInterpretation{
|
|
SpeechAct: interaction.SpeechActQuestion,
|
|
Applicability: interaction.SemanticNeedsBroaderInterpret,
|
|
Clarification: interaction.ClarificationNotRequired,
|
|
},
|
|
CapabilityHints: []string{"COGNITIVE_REASONING", "VERIFY_FACT"},
|
|
}
|
|
if shouldRequestBroaderInterpretation(result) {
|
|
t.Fatal("simple question must go directly to the built-in advisory path")
|
|
}
|
|
}
|
|
|
|
func TestOperationalQuestionStillUsesStrictInterpretation(t *testing.T) {
|
|
result := interactiondomain.SemanticResult{
|
|
Interpretation: interaction.UtteranceInterpretation{
|
|
SpeechAct: interaction.SpeechActQuestion,
|
|
Applicability: interaction.SemanticNeedsBroaderInterpret,
|
|
Clarification: interaction.ClarificationNotRequired,
|
|
},
|
|
CapabilityHints: []string{"MODIFY_CODE", "RUN_TESTS"},
|
|
}
|
|
if !shouldRequestBroaderInterpretation(result) {
|
|
t.Fatal("operational question must retain strict interpretation routing")
|
|
}
|
|
}
|