mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-15 23:31:04 +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 |
||
|---|---|---|
| .. | ||
| __mocks__ | ||
| __tests__ | ||
| activate | ||
| api | ||
| assets | ||
| core | ||
| extension | ||
| i18n | ||
| integrations | ||
| services | ||
| shared | ||
| types | ||
| utils | ||
| workers | ||
| .gitignore | ||
| .prettierignore | ||
| .vscodeignore | ||
| esbuild.mjs | ||
| eslint.config.mjs | ||
| extension.ts | ||
| package.json | ||
| package.nls.ca.json | ||
| package.nls.de.json | ||
| package.nls.es.json | ||
| package.nls.fr.json | ||
| package.nls.hi.json | ||
| package.nls.id.json | ||
| package.nls.it.json | ||
| package.nls.ja.json | ||
| package.nls.json | ||
| package.nls.ko.json | ||
| package.nls.nl.json | ||
| package.nls.pl.json | ||
| package.nls.pt-BR.json | ||
| package.nls.ru.json | ||
| package.nls.tr.json | ||
| package.nls.vi.json | ||
| package.nls.zh-CN.json | ||
| package.nls.zh-TW.json | ||
| tsconfig.json | ||
| turbo.json | ||
| vitest.config.ts | ||
| vitest.setup.ts | ||