Handle memory identity and travel follow-ups
CI / test (push) Successful in 1m12s
CI / test (pull_request) Successful in 1m14s

This commit is contained in:
m
2026-08-25 10:17:39 +03:00
parent 81fbc9926f
commit ed18abef1b
6 changed files with 78 additions and 9 deletions
+7 -1
View File
@@ -103,12 +103,18 @@ func TestContinueTravelOrigin(t *testing.T) {
if got := ContinueTravelOrigin("я в Казани", nil); got != "" {
t.Fatalf("location must not create a travel task without context: %q", got)
}
if got := ContinueTravelOrigin("Москва", history); got != "Как можно добраться до Сочи из города Москва" {
t.Fatalf("bare city should complete travel origin: %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("Покажи ближайшие рейсы до Сочи", nil); got != "Из какого города вылетать?" {
t.Fatalf("nearest-flight request should default date to now, got %q", got)
}
if got := TravelSearchClarification("Найди билеты из Москвы в Сочи на 12 сентября", nil); got != "" {
t.Fatalf("complete travel request must proceed, got %q", got)
}
@@ -126,7 +132,7 @@ func TestTravelSearchClarification(t *testing.T) {
t.Fatalf("complete general travel route must proceed, got %q", got)
}
contextHistory := []interaction.HumanUtterance{{Content: "Как можно добраться до Сочи?"}}
if got := TravelSearchClarification("Найди билеты, какой ближайший самолёт", contextHistory); got != "Из какого города вылетать в Сочи и на какую дату?" {
if got := TravelSearchClarification("Найди билеты, какой ближайший самолёт", contextHistory); got != "Из какого города вылетать в Сочи?" {
t.Fatalf("travel destination should be inherited from context, got %q", got)
}
noisyContext := []interaction.HumanUtterance{