@quidgest/chatbot 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -414,11 +414,16 @@
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
async function clearChat() {
|
|
417
|
+
// Get sessionId from the last message for contextual memory cleanup
|
|
418
|
+
const lastMessage = getLastMessage()
|
|
419
|
+
const sessionId = lastMessage?.sessionID
|
|
420
|
+
|
|
417
421
|
const { data, error } = await clearChatData(
|
|
418
422
|
props.username,
|
|
419
423
|
props.projectPath,
|
|
420
424
|
currentAgentId.value,
|
|
421
|
-
currentFormId.value
|
|
425
|
+
currentFormId.value,
|
|
426
|
+
sessionId
|
|
422
427
|
)
|
|
423
428
|
if (error || !data || !data.success) {
|
|
424
429
|
setDisabledState(true)
|
|
@@ -133,8 +133,9 @@ export function useChatApi(apiEndpoint: string) {
|
|
|
133
133
|
async function clearChatData(
|
|
134
134
|
username: string,
|
|
135
135
|
project: string,
|
|
136
|
-
|
|
137
|
-
formId: string
|
|
136
|
+
agentId: string,
|
|
137
|
+
formId: string,
|
|
138
|
+
sessionId?: string
|
|
138
139
|
) {
|
|
139
140
|
return await baseRequest<{ success: boolean }>({
|
|
140
141
|
method: 'POST',
|
|
@@ -142,8 +143,9 @@ export function useChatApi(apiEndpoint: string) {
|
|
|
142
143
|
data: {
|
|
143
144
|
username,
|
|
144
145
|
project,
|
|
145
|
-
|
|
146
|
-
formId
|
|
146
|
+
agentId,
|
|
147
|
+
formId,
|
|
148
|
+
sessionId
|
|
147
149
|
}
|
|
148
150
|
})
|
|
149
151
|
}
|