This commit is contained in:
Liang Ding 2023-03-22 09:23:58 +08:00
parent 59004a664f
commit 48b8fc536c
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 81 additions and 17 deletions

View file

@ -52,6 +52,20 @@ func setAI(c *gin.Context) {
return
}
if 5 > ai.OpenAI.APITimeout {
ai.OpenAI.APITimeout = 5
}
if 600 < ai.OpenAI.APITimeout {
ai.OpenAI.APITimeout = 600
}
if 0 > ai.OpenAI.APIMaxTokens {
ai.OpenAI.APIMaxTokens = 0
}
if 4096 < ai.OpenAI.APIMaxTokens {
ai.OpenAI.APIMaxTokens = 4096
}
model.Conf.AI = ai
model.Conf.Save()