This commit is contained in:
Liang Ding 2023-03-06 14:07:32 +08:00
parent dd3c011736
commit 3446462184
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 11 additions and 138 deletions

View file

@ -25,53 +25,13 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func ChatGPTFixGrammarSpell(ids []string) (ret string) {
func ChatGPTWithAction(ids []string, action string) (ret string) {
if !isOpenAIAPIEnabled() {
return
}
msg := getBlocksContent(ids)
ret = util.ChatGPTFixGrammarSpell(msg, Conf.Lang)
return
}
func ChatGPTBrainStorm(ids []string) (ret string) {
if !isOpenAIAPIEnabled() {
return
}
msg := getBlocksContent(ids)
ret = util.ChatGPTBrainStorm(msg, Conf.Lang)
return
}
func ChatGPTSummary(ids []string) (ret string) {
if !isOpenAIAPIEnabled() {
return
}
msg := getBlocksContent(ids)
ret = util.ChatGPTSummary(msg, Conf.Lang)
return
}
func ChatGPTTranslate(ids []string, lang string) (ret string) {
if !isOpenAIAPIEnabled() {
return
}
msg := getBlocksContent(ids)
ret = util.ChatGPTTranslate(msg, lang)
return
}
func ChatGPTContinueWriteBlocks(ids []string) (ret string) {
if !isOpenAIAPIEnabled() {
return
}
msg := getBlocksContent(ids)
ret, _ = util.ChatGPTContinueWrite(msg, nil)
ret = util.ChatGPTWithAction(msg, action, Conf.Lang)
return
}