Skip to content

Commit

Permalink
update model authentication struct
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Oct 21, 2023
1 parent e31d69a commit cb904fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion auth/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ func ReduceDalle(db *sql.DB, user *User) bool {

func CanEnableModel(db *sql.DB, user *User, model string) bool {
switch model {
case globals.GPT3Turbo, globals.GPT3Turbo0301, globals.GPT3Turbo0613,
globals.Claude2:
return true
case globals.GPT4, globals.GPT40613, globals.GPT40314:
return user != nil && user.GetQuota(db) >= 5
case globals.GPT432k, globals.GPT432k0613, globals.GPT432k0314:
Expand All @@ -85,7 +88,7 @@ func CanEnableModel(db *sql.DB, user *User, model string) bool {
case globals.ZhiPuChatGLMPro, globals.ZhiPuChatGLMStd:
return user != nil && user.GetQuota(db) >= 1
default:
return true
return user != nil
}
}

Expand Down

0 comments on commit cb904fb

Please sign in to comment.