mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-06-19 04:25:50 +08:00
Previously, Data Explorer AI query generation used structured output for the final query payload, which conflicted with tool usage and could return SQL that had not been validated. This commit gets the required `name`, `description`, and `sql` through a final `submit_query` tool, requiring the exact SQL to pass `run_sql` before it is returned. It also gives `run_sql` representative values for declared params, including `current_user_id`, and returns a targeted error when SQL uses params that were not declared in a `-- [params]` block. |
||
|---|---|---|
| .. | ||
| data_explorer | ||
| discourse_data_explorer | ||
| tools | ||
| ai_query_generator_spec.rb | ||
| ai_query_params_spec.rb | ||
| parameter_spec.rb | ||
| query_result_cache_spec.rb | ||
| query_result_downloader_spec.rb | ||
| query_runner_spec.rb | ||