mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 支持应用内配置人工智能 https://github.com/siyuan-note/siyuan/issues/7714
This commit is contained in:
parent
59004a664f
commit
48b8fc536c
7 changed files with 81 additions and 17 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue