Merge pull request 'Allow research source recovery to complete' (#390) from codex/household-travel-query-fix into main
Reviewed-on: #390
This commit is contained in:
@@ -217,6 +217,15 @@ func TestNearestPlaneUsesTravelContextAndCurrentDay(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestIndependentRequestPartsKeepsCoordinatedEntitiesTogether(t *testing.T) {
|
||||
if got := IndependentRequestParts("какая разница во времени между Москвой и Шанхаем?"); len(got) != 1 {
|
||||
t.Fatalf("coordinated entities became independent requests: %#v", got)
|
||||
}
|
||||
if got := IndependentRequestParts("проверь погоду в Казани и найди кафе рядом"); len(got) != 2 {
|
||||
t.Fatalf("independent actions were not decomposed: %#v", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInterpretUtteranceDirectiveRecordsOutcomeWithoutExecution(t *testing.T) {
|
||||
result := interpretForTest(t, "Поменяй базу на УПО1.", activeFocus("upo", "УПО"), "")
|
||||
if result.Interpretation.SpeechAct != interaction.SpeechActDirective {
|
||||
|
||||
@@ -97,6 +97,9 @@ func StripAssistantVocative(message string) string {
|
||||
// conjunction; the cognitive route remains responsible for ambiguous prose.
|
||||
func IndependentRequestParts(message string) []string {
|
||||
cleaned := StripAssistantVocative(message)
|
||||
if containsToken(semanticTokens(cleaned), "между") {
|
||||
return []string{cleaned}
|
||||
}
|
||||
parts := strings.Split(cleaned, " и ")
|
||||
if len(parts) < 2 {
|
||||
return []string{cleaned}
|
||||
|
||||
Reference in New Issue
Block a user