From d291f0258abc4ff91472146c898765bc03039b5e Mon Sep 17 00:00:00 2001 From: Greg Richardson Date: Tue, 18 Jul 2023 12:06:04 -0600 Subject: [PATCH] fix(sql-editor): encourage ai to provide short debug solutions --- studio/pages/api/ai/sql/debug.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/studio/pages/api/ai/sql/debug.ts b/studio/pages/api/ai/sql/debug.ts index 004d1110168..53a86fc8973 100644 --- a/studio/pages/api/ai/sql/debug.ts +++ b/studio/pages/api/ai/sql/debug.ts @@ -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(