Improve semantic travel research queries
This commit is contained in:
@@ -162,11 +162,18 @@ func TestTravelSearchQueryCarriesNearestFlightDate(t *testing.T) {
|
||||
func TestTravelResearchQueryUsesKnownOriginForDistance(t *testing.T) {
|
||||
history := []interaction.HumanUtterance{{Content: "я сейчас в Москве"}}
|
||||
got := TravelResearchQuery("сколько километров до Сочи?", history, time.Time{})
|
||||
if !strings.Contains(got, "точка отправления: Москве") || !strings.Contains(got, "расстояние по прямой и по дороге") {
|
||||
if got != "расстояние между Москве и Сочи в километрах по прямой и по дороге" {
|
||||
t.Fatalf("distance query lost route context: %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTravelRouteWithKnownOriginDoesNotAskForTicketDate(t *testing.T) {
|
||||
history := []interaction.HumanUtterance{{Content: "я сейчас в Москве"}}
|
||||
if got := TravelSearchClarification("как можно добраться до Сочи?", history); got != "" {
|
||||
t.Fatalf("general route was incorrectly reduced to ticket clarification: %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInterpretUtteranceDirectiveRecordsOutcomeWithoutExecution(t *testing.T) {
|
||||
result := interpretForTest(t, "Поменяй базу на УПО1.", activeFocus("upo", "УПО"), "")
|
||||
if result.Interpretation.SpeechAct != interaction.SpeechActDirective {
|
||||
|
||||
Reference in New Issue
Block a user