Skip to content

Commit

Permalink
Add caveats to AI-generated SQL (#23035)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikermcneil authored Oct 19, 2024
1 parent 49f22b2 commit 2edbcb3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions website/scripts/test-llm-generated-sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ module.exports = {
Provided context:
\`\`\`
${JSON.stringify(prunedTables.map((table)=>{
let lighterTable = _.pick(table, ['name','description']);
lighterTable.columns = _.pluck(table.columns, 'name');
let lighterTable = _.pick(table, ['name','description','platforms']);

Check warning on line 34 in website/scripts/test-llm-generated-sql.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 4 spaces but found 6
lighterTable.columns = table.columns.map((column)=>{

Check warning on line 35 in website/scripts/test-llm-generated-sql.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 4 spaces but found 6
let lighterColumn = _.pick(column, ['name', 'description', 'platforms']);

Check warning on line 36 in website/scripts/test-llm-generated-sql.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 6 spaces but found 8
return lighterColumn;

Check warning on line 37 in website/scripts/test-llm-generated-sql.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 6 spaces but found 8
});

Check warning on line 38 in website/scripts/test-llm-generated-sql.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 4 spaces but found 6
return lighterTable;

Check warning on line 39 in website/scripts/test-llm-generated-sql.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 4 spaces but found 6
}))}

Check warning on line 40 in website/scripts/test-llm-generated-sql.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 2 spaces but found 4
\`\`\`
Expand Down Expand Up @@ -69,9 +72,13 @@ Please give me all of the above in JSON, with this data shape:
"macOSQuery": "TODO",
"windowsQuery": "TODO",
"linuxQuery": "TODO",
"chromeOSQuery": "TODO"
"chromeOSQuery": "TODO",
"macOSCaveats": "TODO",
"windowsCaveats": "TODO",
"linuxCaveats": "TODO",
"chromeOSCaveats": "TODO",
}`;
let sqlReport = await sails.helpers.ai.prompt(sqlPrompt, 'gpt-4o', true);
let sqlReport = await sails.helpers.ai.prompt(sqlPrompt, 'o1-preview', true);


// Which of my computers dont have filevault enabled?
Expand Down

0 comments on commit 2edbcb3

Please sign in to comment.