Continue travel tasks from departure location
CI / test (push) Successful in 1m22s
CI / test (pull_request) Successful in 1m18s

This commit is contained in:
m
2026-08-25 10:04:05 +03:00
parent 05cbd8adc7
commit 3d0bca1d9b
3 changed files with 56 additions and 1 deletions
@@ -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)