mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
✨ 桌面端接入 OpenAI Chat API https://github.com/siyuan-note/siyuan/issues/7560
This commit is contained in:
parent
1a0f176a05
commit
9a67ec3c09
7 changed files with 21 additions and 6 deletions
|
|
@ -17,6 +17,7 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"net/http"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
|
|
@ -34,5 +35,10 @@ func chatGPT(c *gin.Context) {
|
|||
}
|
||||
|
||||
msg := arg["msg"].(string)
|
||||
if "" == util.OpenAIAPIKey {
|
||||
util.PushMsg(model.Conf.Language(193), 5000)
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = util.ChatGPT(msg)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue