fix: route model inventory by semantic intent
This commit is contained in:
@@ -394,7 +394,7 @@ func main() {
|
||||
}
|
||||
needsCognition = false
|
||||
}
|
||||
if isModelInventoryQuestion(utterance.Content) {
|
||||
if isModelInventoryQuestion(semantic) {
|
||||
candidates, inventoryErr := capabilityRepository.LoadCognitiveCandidates(r.Context(), capability.CapabilityID("creator-advisory"), session.PrincipalID)
|
||||
planningReply = humanCognitiveModelInventory(candidates, inventoryErr)
|
||||
needsCognition = false
|
||||
@@ -1158,14 +1158,8 @@ func isCapabilityQuestion(message string) bool {
|
||||
return strings.Contains(lower, "что ты умеешь") || strings.Contains(lower, "что умеешь") || strings.Contains(lower, "какие возможности")
|
||||
}
|
||||
|
||||
func isModelInventoryQuestion(message string) bool {
|
||||
lower := strings.ToLower(strings.TrimSpace(message))
|
||||
if lower == "" {
|
||||
return false
|
||||
}
|
||||
asksAboutModels := strings.Contains(lower, "модел") || strings.Contains(lower, "ии") && (strings.Contains(lower, "внешн") || strings.Contains(lower, "настро") || strings.Contains(lower, "подключ"))
|
||||
asksForInventory := strings.Contains(lower, "какие") || strings.Contains(lower, "какая") || strings.Contains(lower, "список") || strings.Contains(lower, "доступ") || strings.Contains(lower, "настро")
|
||||
return asksAboutModels && asksForInventory
|
||||
func isModelInventoryQuestion(result interactiondomain.SemanticResult) bool {
|
||||
return result.InformationRequestKind == interactiondomain.InformationRequestCognitiveModelInventory
|
||||
}
|
||||
|
||||
func humanCognitiveModelInventory(candidates []capability.ResolvedCognitiveBinding, inventoryErr error) string {
|
||||
|
||||
Reference in New Issue
Block a user