This commit is contained in:
parent
436f487171
commit
cc1bb7775a
3 changed files with 11 additions and 3 deletions
|
@ -17,11 +17,11 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"net/http"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
|
|
|
@ -24,6 +24,11 @@ import (
|
|||
)
|
||||
|
||||
func ChatGPTContinueWriteBlocks(ids []string) (ret string) {
|
||||
if "" == util.OpenAIAPIKey {
|
||||
util.PushMsg(Conf.Language(193), 5000)
|
||||
return
|
||||
}
|
||||
|
||||
sqlBlocks := sql.GetBlocks(ids)
|
||||
|
||||
buf := bytes.Buffer{}
|
||||
|
@ -37,5 +42,10 @@ func ChatGPTContinueWriteBlocks(ids []string) (ret string) {
|
|||
return
|
||||
}
|
||||
func ChatGPT(msg string) (ret string) {
|
||||
if "" == util.OpenAIAPIKey {
|
||||
util.PushMsg(Conf.Language(193), 5000)
|
||||
return
|
||||
}
|
||||
|
||||
return util.ChatGPT(msg)
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package util
|
|||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
|
@ -48,7 +47,6 @@ func ChatGPT(msg string) (ret string) {
|
|||
|
||||
func ChatGPTContinueWrite(msg string, contextMsgs []string) (ret string, retContextMsgs []string) {
|
||||
if "" == OpenAIAPIKey {
|
||||
PushMsg(model.Conf.Language(193), 5000)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue