mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(editor): Add AI Assistant support chat (#10656)
This commit is contained in:
committed by
GitHub
parent
899b0a19ef
commit
3a8078068e
@@ -27,14 +27,16 @@ function onResizeDebounced(data: { direction: string; x: number; width: number }
|
||||
}
|
||||
|
||||
async function onUserMessage(content: string, quickReplyType?: string, isFeedback = false) {
|
||||
await assistantStore.sendMessage({ text: content, quickReplyType });
|
||||
const task = 'error';
|
||||
const solutionCount =
|
||||
task === 'error'
|
||||
? assistantStore.chatMessages.filter(
|
||||
(msg) => msg.role === 'assistant' && !['text', 'event'].includes(msg.type),
|
||||
).length
|
||||
: null;
|
||||
// If there is no current session running, initialize the support chat session
|
||||
if (!assistantStore.currentSessionId) {
|
||||
await assistantStore.initSupportChat(content);
|
||||
} else {
|
||||
await assistantStore.sendMessage({ text: content, quickReplyType });
|
||||
}
|
||||
const task = assistantStore.isSupportChatSessionInProgress ? 'support' : 'error';
|
||||
const solutionCount = assistantStore.chatMessages.filter(
|
||||
(msg) => msg.role === 'assistant' && !['text', 'event'].includes(msg.type),
|
||||
).length;
|
||||
if (isFeedback) {
|
||||
telemetry.track('User gave feedback', {
|
||||
task,
|
||||
|
||||
Reference in New Issue
Block a user