fix(sql-editor): encourage ai to provide short debug solutions

This commit is contained in:
Greg Richardson committed 2023-07-18 12:06:04 -06:00
1 parent 97fa480d45
commit d291f0258a
1 file changed
+2 -1
+2 -1
View File
@@ -16,7 +16,7 @@ const openAiKey = process.env.OPENAI_KEY
const debugSqlSchema = SchemaBuilder.emptySchema()
.addString('solution', {
description: 'The suggested solution for the error (as short and concise as possible).',
description: 'A short suggested solution for the error (as concise as possible).',
})
.addString('sql', {
description: 'The SQL rewritten to apply the solution. Includes all the original SQL.',
@@ -80,6 +80,7 @@ export default async function handler(req: NextRequest) {
if (!response.ok) {
const errorResponse: ErrorResponse = await response.json()
console.log({ errorResponse })
console.error(`AI SQL debugging failed: ${errorResponse.error.message}`)
return new Response(