Files
ai-agent/internal/ai/runtime/reply_eligibility.go
T
mlogclub 101577f163 Refactor internal services to use agent-desk package structure
- Updated import paths in multiple service files to reflect the new agent-desk module.
- Added a new configuration file for agent-desk in the Docker setup.
2026-05-31 18:43:48 +08:00

31 lines
692 B
Go

package runtime
import (
"agent-desk/internal/models"
"agent-desk/internal/pkg/enums"
"github.com/mlogclub/simple/common/strs"
)
type replyEligibility struct{}
func newReplyEligibility() *replyEligibility {
return &replyEligibility{}
}
func (e *replyEligibility) CanReply(conversation models.Conversation, message models.Message, aiAgent models.AIAgent) bool {
if message.SenderType != enums.IMSenderTypeCustomer {
return false
}
if conversation.HandoffAt != nil || conversation.CurrentAssigneeID > 0 {
return false
}
if aiAgent.ServiceMode == enums.IMConversationServiceModeHumanOnly {
return false
}
if strs.IsBlank(message.Content) {
return false
}
return true
}