Fix generic creative target extraction
This commit is contained in:
@@ -67,7 +67,10 @@ func DecomposeTaskWithLexicon(message string, lexicon TaskLexicon) TaskDecomposi
|
||||
if result.Source != "" {
|
||||
result.NeedsResearch = result.Intent == TaskIntentSearch
|
||||
}
|
||||
if result.Object != "" {
|
||||
if result.Intent == TaskIntentCreate {
|
||||
result.Target = valueAfterAnyCue(lower, "нарисуй", "нарисовать", "изобрази", "создай")
|
||||
}
|
||||
if result.Target == "" && result.Object != "" {
|
||||
for _, entry := range lexicon.ObjectAliases {
|
||||
if entry.Value == result.Object {
|
||||
result.Target = valueAfterCue(lower, entry.Alias)
|
||||
@@ -75,9 +78,6 @@ func DecomposeTaskWithLexicon(message string, lexicon TaskLexicon) TaskDecomposi
|
||||
}
|
||||
}
|
||||
}
|
||||
if result.Intent == TaskIntentCreate && result.Target == "" {
|
||||
result.Target = valueAfterAnyCue(lower, "нарисуй", "нарисовать", "изобрази", "создай")
|
||||
}
|
||||
if result.Intent == TaskIntentSearch && result.Source == "" {
|
||||
result.Missing = append(result.Missing, "SOURCE_OR_SEARCH_SCOPE")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user