feat(chat): stop active llm responses

This commit is contained in:
2026-05-02 16:26:10 -04:00
parent b5e60ff0e2
commit f359471a27
11 changed files with 130 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import {
getModels,
sendMessage,
streamChatUpdates,
stopChatGeneration,
getChatMessages,
listChats,
deleteChat,
@@ -87,6 +88,18 @@ Alpine.data('chatManager', () => ({
}
},
async stopResponse() {
if (!this.activeStreamChatID) return;
// Stop Active Generation
try {
await stopChatGeneration(this.activeStreamChatID);
} catch (err) {
console.error('Error stopping response:', err);
this.error = parseError(err);
}
},
async sendMessage() {
const message = this.inputMessage.trim();
if ((!message && this.selectedImages.length === 0) || this.loading) return;