diff --git a/frontend/src/lib/components/chat/GlobalChat.svelte b/frontend/src/lib/components/chat/GlobalChat.svelte index 116d6513cf..931c77a98f 100644 --- a/frontend/src/lib/components/chat/GlobalChat.svelte +++ b/frontend/src/lib/components/chat/GlobalChat.svelte @@ -24,8 +24,8 @@ // Suggested questions for the user const suggestions = [ - 'How do I create a new workflow?', - "What's the difference between scripts and flows?", + 'Where can i see my latest runs?', + 'How do i trigger a script with a webhook endpoint?', 'How can I connect to a database?', 'How do I schedule a recurring job?' ] @@ -44,21 +44,18 @@ const userMessage = inputValue const systemMessage = prepareSystemMessage() - // Add user message to chat messages = [...messages, { role: 'user', content: userMessage }] - // Create message array for API request const apiMessages = [systemMessage, ...messages] + inputValue = '' + await chatRequest(apiMessages, abortController, (token) => { currentReply = currentReply + token }) - // Add assistant's response to chat messages = [...messages, { role: 'assistant', content: currentReply }] - // Reset the input field - inputValue = '' isSubmitting = false } @@ -100,7 +97,7 @@
onSelect?.(index)} > - -
- + onSelect?.(index)} + > + +
+ - {#if trigger.isPrimary} - - {/if} -
- - -
-
- - {#if trigger.type === 'webhook' && webhookToken} - - {`${webhookToken} token${webhookToken > 1 ? 's' : ''}`} - - {:else if trigger.type === 'email' && emailToken} - - {`${emailToken} token${emailToken > 1 ? 's' : ''}`} - + {#if trigger.isPrimary} + {/if}
+ + +
+
+ + {#if trigger.type === 'webhook' && webhookToken} + + {`${webhookToken} token${webhookToken > 1 ? 's' : ''}`} + + {:else if trigger.type === 'email' && emailToken} + + {`${emailToken} token${emailToken > 1 ? 's' : ''}`} + + {/if} +
- {#if !['email', 'webhook', 'cli'].includes(trigger.type)} - {#if trigger.isDraft} - onDeleteDraft?.(index)} small /> - {:else if !!trigger.draftConfig && !trigger.isDraft} -
- +
+ +
{/each}