Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2024-01-25 21:53:18 +08:00
commit 5a4959a6af
4 changed files with 11 additions and 11 deletions

File diff suppressed because one or more lines are too long

View file

@ -9,7 +9,7 @@ require (
github.com/88250/clipboard v0.1.5
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
github.com/88250/gulu v1.2.3-0.20231209020950-b7b6994e395c
github.com/88250/lute v1.7.6-0.20240118143020-c72dc89ddf40
github.com/88250/lute v1.7.6-0.20240125132009-df17802c9921
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4

View file

@ -10,8 +10,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20231209020950-b7b6994e395c h1:Fas3hxqP33xA9KKDV50jUmppiiOukk5bdV00Hk5VSSk=
github.com/88250/gulu v1.2.3-0.20231209020950-b7b6994e395c/go.mod h1:pTWnjt+6qUqNnP9xltswsJxgCBVu3C7eW09u48LWX0k=
github.com/88250/lute v1.7.6-0.20240118143020-c72dc89ddf40 h1:Jw3H+kMC23WetSHc90EqhQHbtDf7tV0p3HSzuYoV3xc=
github.com/88250/lute v1.7.6-0.20240118143020-c72dc89ddf40/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
github.com/88250/lute v1.7.6-0.20240125132009-df17802c9921 h1:tD18OxLTUa3by+BXKORWUiS2qx6RdMfIP0xRdG3+ZxY=
github.com/88250/lute v1.7.6-0.20240125132009-df17802c9921/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

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
}