Clean search imperatives before research
This commit is contained in:
@@ -214,11 +214,17 @@ func TestDecomposeUsesRememberedAliasesAcrossWordings(t *testing.T) {
|
||||
func TestTaskLexiconFromHistoryFeedsSearchQueryWithoutCoreAlias(t *testing.T) {
|
||||
history := []interaction.HumanUtterance{{Content: "запомни: WB — это Wildberries, источник для поиска"}}
|
||||
lexicon := TaskLexiconFromHistory(history)
|
||||
if got := SearchQueryWithLexicon("найди на WB бренд marka-wear", lexicon); got != "найди на WB бренд marka-wear wildberries" {
|
||||
if got := SearchQueryWithLexicon("найди на WB бренд marka-wear", lexicon); got != "на WB бренд marka-wear wildberries" {
|
||||
t.Fatalf("learned source was not applied to search: %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSearchQueryWithoutLearnedSourceOmitsImperative(t *testing.T) {
|
||||
if got := SearchQueryWithLexicon("найди на WB бренд marka-wear", TaskLexicon{}); got != "на WB бренд marka-wear" {
|
||||
t.Fatalf("search imperative leaked into external query: %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDecomposeCreativeRequestDoesNotInventResearch(t *testing.T) {
|
||||
lexicon := TaskLexicon{ObjectAliases: []TaskLexiconEntry{{Alias: "медвед", Value: "IMAGE"}}}
|
||||
got := DecomposeTaskWithLexicon("нарисуй бурого медведя", lexicon)
|
||||
|
||||
Reference in New Issue
Block a user