This commit is contained in:
Daniel 2024-01-25 19:57:38 +08:00
parent 06e2ce29c5
commit a85b1d84fb
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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
}