🎨 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
|
||||
|
||||
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)
|
||||
if nil != err {
|
||||
return
|
||||
|
@ -58,6 +64,12 @@ func chatGPT(msg string, cloud bool) (ret string) {
|
|||
|
||||
func chatGPTWithAction(msg string, action string, cloud bool) (ret string) {
|
||||
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 {
|
||||
msg = action + ":\n\n" + msg
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue