Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3ad1fd5bb | ||
|
|
e1802aef12 |
@@ -811,9 +811,13 @@ func main() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
learnedLexicon := interactiondomain.TaskLexiconFromHistory(conversationHistory)
|
learnedLexicon := interactiondomain.TaskLexiconFromHistory(conversationHistory)
|
||||||
searchQuery := interactiondomain.SearchQueryWithLexicon(part, learnedLexicon)
|
// Preserve the original utterance for semantic route compilation
|
||||||
|
// before removing a search imperative. Distance and route skills
|
||||||
|
// need the user's relation words (for example "до") to bind a
|
||||||
|
// remembered current location to the requested destination.
|
||||||
|
searchQuery := interactiondomain.TravelResearchQuery(part, conversationHistory, now)
|
||||||
|
searchQuery = interactiondomain.SearchQueryWithLexicon(searchQuery, learnedLexicon)
|
||||||
searchQuery = interactiondomain.TimeDifferenceResearchQuery(searchQuery)
|
searchQuery = interactiondomain.TimeDifferenceResearchQuery(searchQuery)
|
||||||
searchQuery = interactiondomain.TravelResearchQuery(searchQuery, conversationHistory, now)
|
|
||||||
// The research capability may try its configured source and a
|
// The research capability may try its configured source and a
|
||||||
// source-recovery fallback. Its caller must leave enough budget for
|
// source-recovery fallback. Its caller must leave enough budget for
|
||||||
// both attempts and evidence evaluation.
|
// both attempts and evidence evaluation.
|
||||||
|
|||||||
@@ -101,6 +101,15 @@ func TestResearchIdentifiersExcludeSearchDate(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestResearchQueryKeepsDistanceRelationBeforeSearchNormalization(t *testing.T) {
|
||||||
|
history := []interaction.HumanUtterance{{Content: "я сейчас в Москве"}}
|
||||||
|
query := interactiondomain.TravelResearchQuery("сколько километров до Сочи?", history, time.Time{})
|
||||||
|
query = interactiondomain.SearchQueryWithLexicon(query, interactiondomain.TaskLexicon{})
|
||||||
|
if query != "расстояние между Москве и Сочи в километрах по прямой и по дороге" {
|
||||||
|
t.Fatalf("distance query lost remembered origin: %q", query)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestResponseReviewPreservesAttemptedResearchOutcome(t *testing.T) {
|
func TestResponseReviewPreservesAttemptedResearchOutcome(t *testing.T) {
|
||||||
if reviewMayReplacePlanningReply(false, false, true, false, "Уточните аэропорт.", "Пока не смог получить проверяемый ответ.") {
|
if reviewMayReplacePlanningReply(false, false, true, false, "Уточните аэропорт.", "Пока не смог получить проверяемый ответ.") {
|
||||||
t.Fatal("review replaced an honest unbacked research outcome")
|
t.Fatal("review replaced an honest unbacked research outcome")
|
||||||
|
|||||||
Reference in New Issue
Block a user