From 5c88261067a39cb79b5926e6004f21e07b42dc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Cojocaru?= Date: Thu, 19 Dec 2024 17:33:58 +0200 Subject: [PATCH] fix explainQuery code doc --- content/docs/02-guides/06-natural-language-postgres.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/docs/02-guides/06-natural-language-postgres.mdx b/content/docs/02-guides/06-natural-language-postgres.mdx index 45f219009f24..4431a8be20f9 100644 --- a/content/docs/02-guides/06-natural-language-postgres.mdx +++ b/content/docs/02-guides/06-natural-language-postgres.mdx @@ -410,6 +410,7 @@ export const explainQuery = async (input: string, sqlQuery: string) => { try { const result = await generateObject({ model: openai('gpt-4o'), + schema: explanationSchema, system: `You are a SQL (postgres) expert. ...`, // SYSTEM PROMPT AS ABOVE - OMITTED FOR BREVITY prompt: `Explain the SQL query you generated to retrieve the data the user wanted. Assume the user is not an expert in SQL. Break down the query into steps. Be concise. @@ -418,8 +419,6 @@ export const explainQuery = async (input: string, sqlQuery: string) => { Generated SQL Query: ${sqlQuery}`, - schema: explanationSchema, - output: 'array', }); return result.object; } catch (e) {