Commit bbc26a5
committed
Refactor Chat History to Store Full Conversations Instead of Prompts
Replace the simple prompt history with a full conversation history that
preserves the entire chat context including both user and assistant
messages. This enables restoring previous chat sessions with their
complete message history.
The configuration now serializes conversations as structured JSON arrays
with role and content fields under the "chat_history" key, replacing the
flat "history" string array. The ChatHistoryDialog has been updated to
work with Conversation objects instead of raw prompt strings.
When starting a new session or closing the window, the current
conversation is automatically saved. Selecting a history entry now
restores the full conversation to both the display and the LLM client
context.
* Plugin/ai/Config - Add Conversation/ChatHistory types and new
serialization format
* Plugin/ai/LLMManager - Add GetConversation/LoadConversation methods
* Plugin/ai/ChatHistoryDialog - Update to handle Conversation objects
* Plugin/ai/ChatAIWindow - Save conversations on close and session
change, restore full history on selection
* submodules/assistant - Update submodule reference
** Generated by CodeLite. **
Signed-off-by: Eran Ifrah <eran@codelite.org>1 parent bca0a52 commit bbc26a5
File tree
9 files changed
+213
-127
lines changed- Plugin/ai
- submodules
9 files changed
+213
-127
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
99 | | - | |
| 98 | + | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
| 106 | + | |
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
| |||
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
171 | 175 | | |
172 | 176 | | |
173 | 177 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 178 | | |
181 | 179 | | |
182 | 180 | | |
| |||
304 | 302 | | |
305 | 303 | | |
306 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
307 | 309 | | |
308 | 310 | | |
309 | 311 | | |
| |||
481 | 483 | | |
482 | 484 | | |
483 | 485 | | |
484 | | - | |
485 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
486 | 499 | | |
487 | 500 | | |
488 | 501 | | |
489 | 502 | | |
490 | 503 | | |
491 | 504 | | |
492 | | - | |
| 505 | + | |
493 | 506 | | |
494 | 507 | | |
495 | 508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 5 | | |
32 | 6 | | |
33 | 7 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
38 | 15 | | |
39 | 16 | | |
| 17 | + | |
| 18 | + | |
40 | 19 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 20 | | |
45 | | - | |
| 21 | + | |
46 | 22 | | |
47 | | - | |
| 23 | + | |
48 | 24 | | |
49 | 25 | | |
50 | 26 | | |
| |||
83 | 59 | | |
84 | 60 | | |
85 | 61 | | |
86 | | - | |
| 62 | + | |
87 | 63 | | |
88 | 64 | | |
89 | 65 | | |
| |||
117 | 93 | | |
118 | 94 | | |
119 | 95 | | |
120 | | - | |
| 96 | + | |
121 | 97 | | |
122 | 98 | | |
123 | 99 | | |
| |||
128 | 104 | | |
129 | 105 | | |
130 | 106 | | |
131 | | - | |
| 107 | + | |
132 | 108 | | |
133 | | - | |
134 | | - | |
| 109 | + | |
| 110 | + | |
135 | 111 | | |
136 | | - | |
137 | | - | |
| 112 | + | |
| 113 | + | |
138 | 114 | | |
139 | | - | |
| 115 | + | |
140 | 116 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
32 | | - | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
52 | 68 | | |
53 | 69 | | |
54 | 70 | | |
| |||
72 | 88 | | |
73 | 89 | | |
74 | 90 | | |
75 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
76 | 104 | | |
77 | 105 | | |
78 | 106 | | |
79 | 107 | | |
80 | 108 | | |
81 | | - | |
| 109 | + | |
82 | 110 | | |
83 | 111 | | |
84 | | - | |
85 | | - | |
86 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
87 | 124 | | |
88 | 125 | | |
89 | 126 | | |
90 | 127 | | |
91 | 128 | | |
92 | | - | |
| 129 | + | |
93 | 130 | | |
94 | 131 | | |
95 | 132 | | |
| |||
0 commit comments