Keep travel requests in semantic dialogue
CI / test (push) Successful in 1m7s
CI / test (pull_request) Successful in 1m1s

This commit is contained in:
m
2026-08-25 04:51:52 +03:00
parent 28dfcc8aec
commit 9020100313
3 changed files with 103 additions and 2 deletions
@@ -60,6 +60,28 @@ func TestStableConversationalReplySurvivesCognitiveRewrite(t *testing.T) {
}
}
func TestStripAssistantVocative(t *testing.T) {
if got := StripAssistantVocative("Дед, какая погода в Сочи?"); got != "какая погода в Сочи?" {
t.Fatalf("unexpected cleaned query: %q", got)
}
if got := StripAssistantVocative("домовой: найди ресторан"); got != "найди ресторан" {
t.Fatalf("unexpected cleaned query: %q", got)
}
}
func TestTravelSearchClarification(t *testing.T) {
if got := TravelSearchClarification("Найди билеты", nil); got == "" {
t.Fatal("underspecified travel request must ask for missing route and date")
}
if got := TravelSearchClarification("Найди билеты из Москвы в Сочи на 12 сентября", nil); got != "" {
t.Fatalf("complete travel request must proceed, got %q", got)
}
history := []interaction.HumanUtterance{{Content: "Найди билеты"}}
if got := TravelSearchClarification("а куда летим?", history); got == "" {
t.Fatal("follow-up must remain attached to the travel goal")
}
}
func TestInterpretUtteranceDirectiveRecordsOutcomeWithoutExecution(t *testing.T) {
result := interpretForTest(t, "Поменяй базу на УПО1.", activeFocus("upo", "УПО"), "")
if result.Interpretation.SpeechAct != interaction.SpeechActDirective {