Route creative chat by meaning
CI / test (push) Successful in 1m8s
CI / test (pull_request) Successful in 1m9s

This commit is contained in:
m
2026-08-25 11:29:54 +03:00
parent f7200b0704
commit 5a439f7ba8
5 changed files with 138 additions and 3 deletions
+20 -1
View File
@@ -572,6 +572,20 @@ func main() {
semantic.NeedsCognition = false
semantic.Interpretation.NeedsCognition = false
}
creativeRequest := interactiondomain.IsCreativeRequest(effectiveTaskMessage)
creativeReply := interactiondomain.CreativeDeterministicReply(effectiveTaskMessage)
if creativeRequest {
semantic.CapabilityHints = interactiondomain.RemoveCapabilityHint(semantic.CapabilityHints, string(capability.CapabilityKindWebResearch))
if creativeReply != "" {
semantic.Reply = creativeReply
semantic.NeedsCognition = false
semantic.Interpretation.NeedsCognition = false
} else {
semantic.NeedsCognition = true
semantic.Interpretation.NeedsCognition = true
semantic.CapabilityHints = append(semantic.CapabilityHints, string(capability.CapabilityKindCognitiveReasoning))
}
}
locationReply := interactiondomain.LocationContextReply(utterance.Content)
if locationReply != "" {
semantic.Reply = locationReply
@@ -868,7 +882,7 @@ func main() {
ConfidenceMillis: semantic.Interpretation.ConfidenceMillis,
})
cancelReview()
stableSemanticReply := identityReply != "" || semantic.InformationRequestKind != "" || locationReply != "" || deterministicSpeechAct == interaction.SpeechActConversational || deterministicSpeechAct == interaction.SpeechActConfirmation || deterministicSpeechAct == interaction.SpeechActRejection
stableSemanticReply := identityReply != "" || creativeReply != "" || semantic.InformationRequestKind != "" || locationReply != "" || deterministicSpeechAct == interaction.SpeechActConversational || deterministicSpeechAct == interaction.SpeechActConfirmation || deterministicSpeechAct == interaction.SpeechActRejection
if reviewErr != nil {
log.Printf("cognitive response review unavailable: %v", reviewErr)
} else if !stableSemanticReply && (!researchBacked || reviewPreservesResearchEvidence(reviewedReply, planningReply)) {
@@ -890,6 +904,11 @@ func main() {
needsCognition = false
planningReply = identityReply
}
if creativeReply != "" {
semantic.Reply = creativeReply
needsCognition = false
planningReply = creativeReply
}
if strings.TrimSpace(planningReply) != "" {
semantic.Reply = planningReply
}