fix: add enable max ai answer switch default disable max ai answer
This commit is contained in:
parent
9a48b97767
commit
25d823769f
7
ws/ws.go
7
ws/ws.go
@ -17,6 +17,8 @@ import (
|
||||
|
||||
const (
|
||||
MaxAIAnswerCycleTimes int = 3
|
||||
|
||||
EnableMaxAIAnswer = false
|
||||
)
|
||||
|
||||
type User struct {
|
||||
@ -152,5 +154,10 @@ func UpdateVisitorUser(visitorId string, toId string) {
|
||||
}
|
||||
|
||||
func AIAnswerAvailable(u *User) bool {
|
||||
if !EnableMaxAIAnswer {
|
||||
// 未开启最大AI回复轮次则永远不进入人工
|
||||
return true
|
||||
|
||||
}
|
||||
return u.AIAnswerCycle < MaxAIAnswerCycleTimes
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user