5d7c10aeab
- Updated runtime configuration to use __CS_AI_AGENT_WIDGET_CONFIG__ instead of __CS_AGENT_WIDGET_CONFIG__. - Changed message types in support host bridge from "cs-agent" to "cs-ai-agent". - Minified SDK script updated to reflect new AI agent naming conventions. - Adjusted scrollbar styles in main.scss to use .cs-ai-agent-scrollbar instead of .cs-agent-scrollbar.
31 lines
694 B
Go
31 lines
694 B
Go
package runtime
|
|
|
|
import (
|
|
"cs-ai-agent/internal/models"
|
|
"cs-ai-agent/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
|
|
}
|