Add xAI Grok provider preset
CI / ci (pull_request) Successful in 1m32s
Independent review Codex gpt-6-sol high: APPROVED (0 findings)
CI / ci (push) Successful in 1m29s

Preset xai builds the OpenAI-compatible adapter against the fixed base URL
https://api.x.ai/v1 with a required API key and no extra headers. It
defaults to json_schema structured output and lets the household select
json_object as a fallback; a request is never retried in another mode.

Migration 0005_ai_provider_xai rebuilds ai_settings and ai_runs the 0004
way so their provider CHECK also accepts xai, keeping every 0004 value.

Maestro task d8be638f-297f-4b7a-a545-74d193055904.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-04 09:31:49 -04:00
co-authored by Claude Opus 5.5
parent 9ace3aba9f
commit eba1e505a5
6 changed files with 217 additions and 6 deletions
+9
View File
@@ -145,6 +145,15 @@ var all = map[string]Preset{
StructuredOutputs: []openai.StructuredOutput{openai.JSONSchema, openai.JSONObject},
OmitTemperature: []*regexp.Regexp{openRouterReasoningModels},
},
"xai": {
Name: "xai",
Adapter: AdapterOpenAI,
BaseURL: "https://api.x.ai/v1",
Key: KeyRequired,
StructuredOutput: openai.JSONSchema,
FallbackStructuredOutput: openai.JSONObject,
StructuredOutputs: []openai.StructuredOutput{openai.JSONSchema, openai.JSONObject},
},
"ollama": {
Name: "ollama",
Adapter: AdapterOllama,