From aeb5b5bcd163e2e7d1413d7e4aed8bd769996f24 Mon Sep 17 00:00:00 2001 From: HugoCasa Date: Wed, 25 Sep 2024 12:53:32 +0200 Subject: [PATCH] fix: correct AI generation for CRON and regex (#4437) --- frontend/src/lib/components/copilot/CronGen.svelte | 2 +- frontend/src/lib/components/copilot/RegexGen.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/copilot/CronGen.svelte b/frontend/src/lib/components/copilot/CronGen.svelte index ae23510d30..6a1b5f9c06 100644 --- a/frontend/src/lib/components/copilot/CronGen.svelte +++ b/frontend/src/lib/components/copilot/CronGen.svelte @@ -15,7 +15,7 @@ let abortController = new AbortController() $: instructionsField && setTimeout(() => instructionsField?.focus(), 100) const SYSTEM = - "You are a helpful assitant for creating CRON schedules. The structure is 'second minute hour dayOfMonth month dayOfWeek'. Weekdays are Sunday (1), Monday (2), Tuesday (3), Wednesday (4), Thursday (5), Friday (6), Saturday (7). You only return the CRON string. If it is invalid, you will return an error message preceeded by 'ERROR:'." + "You are a helpful assitant for creating CRON schedules. The structure is 'second minute hour dayOfMonth month dayOfWeek'. Weekdays are Sunday (1), Monday (2), Tuesday (3), Wednesday (4), Thursday (5), Friday (6), Saturday (7). You only return the CRON string without any wrapping characters. If it is invalid, you will return an error message preceeded by 'ERROR:'." const USER = 'CRON schedule instructions: {instructions}' async function generateCron() { genLoading = true diff --git a/frontend/src/lib/components/copilot/RegexGen.svelte b/frontend/src/lib/components/copilot/RegexGen.svelte index cc7a4c301b..0817167bf5 100644 --- a/frontend/src/lib/components/copilot/RegexGen.svelte +++ b/frontend/src/lib/components/copilot/RegexGen.svelte @@ -31,7 +31,7 @@ { role: 'system', content: - 'Generate a regex pattern that one can use in a javascript Regex object. Output only the regex itself. The regex should match the following:' + 'Generate a regex pattern that one can use in a javascript Regex object. Output only the regex itself without any wrapping characters including the / characters. The regex should match the following:' }, { role: 'user',