fix: correct AI generation for CRON and regex (#4437)

This commit is contained in:
HugoCasa
2024-09-25 12:53:32 +02:00
committed by GitHub
parent 590321fd3c
commit aeb5b5bcd1
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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',