feat(custom-providers): select Chat Completions, Responses, or Anthropic Messages transport - #8
Merged
Merged
Conversation
Co-authored-by: Aniket Pandey <aniket00736@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Custom providers can now declare which API they speak instead of always being treated as OpenAI Chat Completions with a Responses probe.
CustomProviderDef.api.api: "chat-completions"sends straight to/chat/completionswith no Responses probing.api: "responses"uses the existing Responses stack directly (/responses), including reasoning effort/summary payloads, encrypted reasoning replay, vision input blocks, tools, and streaming.api: "anthropic-messages"routes through the native Anthropic transport at the configured base URL, keeping streaming, vision, tools, thinking, signed-thinking replay, and Anthropic auth (x-api-key+anthropic-version) for model discovery and ping.apikeep the previous auto behavior (Responses first, Chat Completions fallback), so stored configs are unaffected.buildAnthropicBodyand the Anthropic provider accept a provider id and endpoint so results, request-plan profiles, and reasoning-artifact provenance are attributed to the custom provider rather than toanthropic.Verification
npm run typecheckpasses.vitest run test/custom-providers.test.ts test/llm/anthropic-thinking.test.ts test/llm-anthropic-thinking-replay.test.ts test/llm-system-messages.test.ts— 53 tests pass, including two new regressions:/responsesexactly once withreasoning: { effort, summary }and returnsapi: "responses";<baseUrl>/messageswithx-api-key, the custom default model, and returnsapi: "anthropic-messages".This is a terminal UI change; no browser screenshots apply.