This commit is contained in:
Daniel 2024-01-25 21:13:16 +08:00
parent a2ebdbdc2f
commit b375208ab8
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -40,6 +40,12 @@ func ChatGPTWithAction(ids []string, action string) (ret string) {
return
}
if "Clear context" == action {
// AI clear context action https://github.com/siyuan-note/siyuan/issues/10255
cachedContextMsg = nil
return
}
msg := getBlocksContent(ids)
ret = chatGPTWithAction(msg, action, false)
return
@ -64,12 +70,6 @@ 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
}