Keep travel requests in semantic dialogue
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user