letschemaFiltrationPrompt=`Given this question from an IT admin, and using the provided context (the osquery schema), return the subset of tables that might be relevant for designing an osquery SQL query to answer this question for computers running macOS, Windows, Linux, and/or ChromeOS.
returnnewError(`When trying to get a subset of tables to use to generate a query for an Admin user, the Open AI API returned an error. Full error: ${require('util').inspect(err,{depth:2})}`);
});
// Now generate the SQL.
letsqlPrompt=`Given this question from an IT admin, return osquery SQL I could run on a computer (or fleet of computers) to answer this question.
4.Ifthisquestionisa"yes"or"no"question,ora"how many people"question,ora"how many hosts"question,thenbuildthequerysuchthata"yes"returnsexactlyonerowanda"no"returnszerorows.Inotherwords,ifthisquestionisaboutfindingoutwhichhostsmatcha"yes"or"no"question,thenifahostdoesnotmatch,donotincludeanyrowsforit.
returnnewError(`When trying to generate a query for an Admin user, the Open AI API returned an error. Full error: ${require('util').inspect(err,{depth:2})}`);