mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Migrate the xAI provider from the deprecated Chat Completions API to the Responses API, add grok-4.20 as the new default model, and introduce shared transform utilities for Responses API that other providers can adopt. New shared utilities (src/api/transform/): - responses-api-stream.ts: processResponsesApiStream() handles core Responses API stream events (text, reasoning, tool calls, usage) and createUsageNormalizer() provides configurable token/cost extraction. Designed for reuse by openai-native, openai-codex, or any future Responses API provider. - responses-api-input.ts: convertToResponsesApiInput() converts directly from Anthropic message format to Responses API input format, avoiding the intermediate Chat Completions conversion step. Handles input_text, input_image, function_call, and function_call_output mappings. xAI provider (src/api/providers/xai.ts): - Switch from client.chat.completions.create() to client.responses.create() - Use shared transform utilities for stream handling and input conversion - Enable reasoning traces via include: ["reasoning.encrypted_content"] - System prompt via instructions field, store: false for privacy - completePrompt() also migrated to Responses API Model updates (packages/types/src/providers/xai.ts): - Add grok-4.20 as the new default model (2M context, $2/$6 pricing) - Remove grok-4.20-beta-0309-reasoning and grok-4.20-beta-0309-non-reasoning |
||
|---|---|---|
| .. | ||
| build | ||
| cloud | ||
| config-eslint | ||
| config-typescript | ||
| core | ||
| evals | ||
| ipc | ||
| telemetry | ||
| types | ||
| vscode-shim | ||