Continue travel tasks from departure location
This commit is contained in:
@@ -95,6 +95,16 @@ func TestContinueLocalSearch(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestContinueTravelOrigin(t *testing.T) {
|
||||
history := []interaction.HumanUtterance{{Content: "Как можно добраться до Сочи?"}}
|
||||
if got := ContinueTravelOrigin("я в Казани", history); got != "Как можно добраться до Сочи из Казани" {
|
||||
t.Fatalf("unexpected travel continuation: %q", got)
|
||||
}
|
||||
if got := ContinueTravelOrigin("я в Казани", nil); got != "" {
|
||||
t.Fatalf("location must not create a travel task without context: %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTravelSearchClarification(t *testing.T) {
|
||||
if got := TravelSearchClarification("Найди билеты", nil); got == "" {
|
||||
t.Fatal("underspecified travel request must ask for missing route and date")
|
||||
@@ -112,6 +122,9 @@ func TestTravelSearchClarification(t *testing.T) {
|
||||
if got := TravelSearchClarification("Как можно добраться до Сочи?", nil); got != "Из какого города выезжать в Сочи? Подберу самолёт, поезд, автобус или машину." {
|
||||
t.Fatalf("general travel question should ask departure city, got %q", got)
|
||||
}
|
||||
if got := TravelSearchClarification("Как можно добраться до Сочи из Казани", nil); got != "" {
|
||||
t.Fatalf("complete general travel route must proceed, got %q", got)
|
||||
}
|
||||
contextHistory := []interaction.HumanUtterance{{Content: "Как можно добраться до Сочи?"}}
|
||||
if got := TravelSearchClarification("Найди билеты, какой ближайший самолёт", contextHistory); got != "Из какого города вылетать в Сочи и на какую дату?" {
|
||||
t.Fatalf("travel destination should be inherited from context, got %q", got)
|
||||
|
||||
Reference in New Issue
Block a user