feat(chat): stop active llm responses
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user