From c35a5bb14048457a2fd4fb9ad4ecb8139e51e5ad Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Mon, 2 Sep 2024 00:24:26 +0530 Subject: [PATCH] autosql: log prompts and results --- db-tabulator/autosql/web-endpoint.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db-tabulator/autosql/web-endpoint.ts b/db-tabulator/autosql/web-endpoint.ts index 15907b1..d0f67d2 100644 --- a/db-tabulator/autosql/web-endpoint.ts +++ b/db-tabulator/autosql/web-endpoint.ts @@ -31,9 +31,9 @@ router.post('/generate', async function (req, res, next) { const sql = response.choices[0].message.content const logEntry = { prompt: req.query.prompt, - response: sql - + response: sql.replace(/\s+/g, ' ') } + log(`[S] AutoSQL result ${JSON.stringify(logEntry, null, 2)}`); return res.render('db-tabulator/autosql/result', { sql: sql, warnOnField: