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) {