Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website: update query generator #26926

Merged
merged 4 commits into from
Mar 7, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions website/api/controllers/query-generator/get-llm-generated-sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,12 @@ module.exports = {

When generating the SQL:
1. Please do not use the SQL "AS" operator, nor alias tables. Always reference tables by their full name.
2. If this question is related to an application or program, consider using LIKE instead of something verbatim.
3. If this question is not possible to ask given the tables and columns available in the provided context (the osquery schema) for a particular operating system, then use empty string.
4. If this question is a "yes" or "no" question, or a "how many people" question, or a "how many hosts" question, then build the query such that a "yes" returns exactly one row and a "no" returns zero rows. In other words, if this question is about finding out which hosts match a "yes" or "no" question, then if a host does not match, do not include any rows for it.
5. Use only tables that are supported for each target platform, as documented in the provided context, considering the examples if they exist, and the available columns.
6. For each table that you use, only use columns that are documented for that table, as documented in the provided context.
2. When generating a query that uses the "LIKE" operator, you should include wildcard characters.
3. If this question is related to an application or program, consider using LIKE instead of something verbatim.
4. If this question is not possible to ask given the tables and columns available in the provided context (the osquery schema) for a particular operating system, then use empty string.
5. If this question is a "yes" or "no" question, or a "how many people" question, or a "how many hosts" question, then build the query such that a "yes" returns exactly one row and a "no" returns zero rows. In other words, if this question is about finding out which hosts match a "yes" or "no" question, then if a host does not match, do not include any rows for it.
6. Use only tables that are supported for each target platform, as documented in the provided context, considering the examples if they exist, and the available columns.
7. For each table that you use, only use columns that are documented for that table, as documented in the provided context.

Provided context:
\`\`\`
Expand Down
Loading