mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
## Summary Closes #41466 - Adds Anthropic Claude API support to the `prompt.js` AI helper, detecting `claude-*` model names and routing to the Anthropic Messages API (`https://api.anthropic.com/v1/messages`) with proper authentication headers - Switches both LLM calls in the query generator (`get-llm-generated-sql.js`) from OpenAI models (`gpt-4o-mini-2024-07-18` for schema filtration, `o3-mini-2025-01-31` for SQL generation) to `claude-sonnet-4-6-20260218` - Adds `anthropicSecret` config placeholder in `custom.js` (set via `sails_custom__anthropicSecret` env var in production) - Updates the query generator UI to reference "Anthropic" instead of "OpenAI" ### Changes | File | What changed | |------|-------------| | `website/api/helpers/ai/prompt.js` | Added Anthropic API branch alongside existing OpenAI logic; system prompts use Anthropic's top-level `system` parameter | | `website/api/controllers/query-generator/get-llm-generated-sql.js` | Both model references changed to `claude-sonnet-4-6-20260218` | | `website/config/custom.js` | Added `anthropicSecret` config placeholder | | `website/views/pages/admin/query-generator.ejs` | Updated copy from "OpenAI" to "Anthropic" | ### Deployment notes The `sails_custom__anthropicSecret` environment variable must be set with an Anthropic API key before deploying this change. --- Built for [mikermcneil](https://fleetdm.slack.com/archives/D0AFASLRHNU/p1773278374183489?thread_ts=1773271495.702919&cid=D0AFASLRHNU) by [Kilo for Slack](https://kilo.ai/features/slack-integration) --------- Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com> Co-authored-by: Eric <eashaw@sailsjs.com> |
||
|---|---|---|
| .. | ||
| get-llm-generated-sql.js | ||
| view-query-generator.js | ||