mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 AI clear context action https://github.com/siyuan-note/siyuan/issues/10255
This commit is contained in:
parent
06e2ce29c5
commit
a85b1d84fb
1 changed files with 12 additions and 0 deletions
|
|
@ -48,6 +48,12 @@ func ChatGPTWithAction(ids []string, action string) (ret string) {
|
||||||
var cachedContextMsg []string
|
var cachedContextMsg []string
|
||||||
|
|
||||||
func chatGPT(msg string, cloud bool) (ret string) {
|
func chatGPT(msg string, cloud bool) (ret string) {
|
||||||
|
if "Clear context" == strings.TrimSpace(msg) {
|
||||||
|
// AI clear context action https://github.com/siyuan-note/siyuan/issues/10255
|
||||||
|
cachedContextMsg = nil
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
ret, retCtxMsgs, err := chatGPTContinueWrite(msg, cachedContextMsg, cloud)
|
ret, retCtxMsgs, err := chatGPTContinueWrite(msg, cachedContextMsg, cloud)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
return
|
return
|
||||||
|
|
@ -58,6 +64,12 @@ func chatGPT(msg string, cloud bool) (ret string) {
|
||||||
|
|
||||||
func chatGPTWithAction(msg string, action string, cloud bool) (ret string) {
|
func chatGPTWithAction(msg string, action string, cloud bool) (ret string) {
|
||||||
action = strings.TrimSpace(action)
|
action = strings.TrimSpace(action)
|
||||||
|
if "Clear context" == action {
|
||||||
|
// AI clear context action https://github.com/siyuan-note/siyuan/issues/10255
|
||||||
|
cachedContextMsg = nil
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if "" != action {
|
if "" != action {
|
||||||
msg = action + ":\n\n" + msg
|
msg = action + ":\n\n" + msg
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue