From e331c82ebb79e3e3cd29d9bf81f5a8daf3ad352e Mon Sep 17 00:00:00 2001 From: centdix Date: Mon, 2 Jun 2025 14:07:18 +0200 Subject: [PATCH] add script ai chat integration --- .../src/lib/components/copilot/chat/AIChatDisplay.svelte | 9 +++++++++ .../src/lib/components/copilot/chat/navigator/core.ts | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte index 7e72e5c995..456a280ed7 100644 --- a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte +++ b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte @@ -16,6 +16,7 @@ import ChatMode from './ChatMode.svelte' import { chatMode } from '$lib/stores' import Markdown from 'svelte-exmarkdown' + import TriggerableByAi from '$lib/components/TriggerableByAI.svelte' let { allowedModes, @@ -261,6 +262,14 @@ {/if}
0}> + { + instructions = value ?? '' + sendRequest() + }} + /> {#if $chatMode === 'script'}
diff --git a/frontend/src/lib/components/copilot/chat/navigator/core.ts b/frontend/src/lib/components/copilot/chat/navigator/core.ts index 23d6d8cb63..1d8c997d3e 100644 --- a/frontend/src/lib/components/copilot/chat/navigator/core.ts +++ b/frontend/src/lib/components/copilot/chat/navigator/core.ts @@ -37,6 +37,13 @@ GENERAL PRINCIPLES: - When asked about a specific script, flow or app, first check components directly related to the mentioned entity, before checking the other components. - When you do not find what you are looking for on the current page, go to the home page by looking for the "Home" component, then scan the components again. +IMPORTANT CONSIDERATIONS: +- If you navigate to a script creation page, consider this: + - The user will need to select a language for the script. If provided, select the one he mentioned, else do not do anything. + - If he provides any other information but its script settings, do the changes. + - Close the settings once the changes are done. + - Then if the user have described what he wanted the script to do, search for the script ai chat in the page and input it's request in it. + Always use the provided tools purposefully and appropriately to achieve the user's goals. Your actions only allow you to navigate the application through the provided tools. When you complete the user's request, do not say "I created..." or "I updated..." or "I deleted...", but rather say something like "Here is where you can find what you were looking for...". Complete your response with precisions about how it works based on the documentation. Also drop a link to the relevant documentation if possible.