mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 03:50:16 +08:00
This commit is contained in:
parent
436f487171
commit
cc1bb7775a
@ -17,11 +17,11 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/siyuan-note/siyuan/kernel/model"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/88250/gulu"
|
"github.com/88250/gulu"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/siyuan-note/siyuan/kernel/model"
|
||||||
"github.com/siyuan-note/siyuan/kernel/util"
|
"github.com/siyuan-note/siyuan/kernel/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -24,6 +24,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func ChatGPTContinueWriteBlocks(ids []string) (ret string) {
|
func ChatGPTContinueWriteBlocks(ids []string) (ret string) {
|
||||||
|
if "" == util.OpenAIAPIKey {
|
||||||
|
util.PushMsg(Conf.Language(193), 5000)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
sqlBlocks := sql.GetBlocks(ids)
|
sqlBlocks := sql.GetBlocks(ids)
|
||||||
|
|
||||||
buf := bytes.Buffer{}
|
buf := bytes.Buffer{}
|
||||||
@ -37,5 +42,10 @@ func ChatGPTContinueWriteBlocks(ids []string) (ret string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
func ChatGPT(msg string) (ret string) {
|
func ChatGPT(msg string) (ret string) {
|
||||||
|
if "" == util.OpenAIAPIKey {
|
||||||
|
util.PushMsg(Conf.Language(193), 5000)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
return util.ChatGPT(msg)
|
return util.ChatGPT(msg)
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ package util
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/siyuan-note/siyuan/kernel/model"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
@ -48,7 +47,6 @@ func ChatGPT(msg string) (ret string) {
|
|||||||
|
|
||||||
func ChatGPTContinueWrite(msg string, contextMsgs []string) (ret string, retContextMsgs []string) {
|
func ChatGPTContinueWrite(msg string, contextMsgs []string) (ret string, retContextMsgs []string) {
|
||||||
if "" == OpenAIAPIKey {
|
if "" == OpenAIAPIKey {
|
||||||
PushMsg(model.Conf.Language(193), 5000)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user