Skip to content

fix: bridge Azure Chat tools through Responses - #9

Draft
voodoohop wants to merge 2 commits into
mainfrom
codex/azure-chat-responses-bridge
Draft

fix: bridge Azure Chat tools through Responses#9
voodoohop wants to merge 2 commits into
mainfrom
codex/azure-chat-responses-bridge

Conversation

@voodoohop

@voodoohop voodoohop commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds opt-in x-portkey-chat-completions-api: responses routing for Azure Chat requests that use modern function tools with reasoning, including the model's default reasoning effort.
  • Maps the Chat Completions contract through Azure /openai/v1/responses: text/image/file messages, completed tool rounds, multiple calls, tool choice, structured output, JSON/SSE responses, refusal, errors, and usage.
  • Keeps explicit reasoning_effort: none on native Chat and rejects Chat fields without a safe Responses equivalent instead of silently dropping them.
  • Does not expose Responses-only state or features.

Why

Azure GPT-5.5/5.6 rejects function tools plus reasoning on /chat/completions; the equivalent Responses request succeeds. Keeping the bounded compatibility bridge in the gateway avoids provider-specific translation in downstream APIs.

Testing

  • Focused Jest suite passes (8/8).
  • Gateway build and pre-push application smoke test pass; existing unrelated TypeScript warnings remain.
  • Live Azure JSON, SSE, file input, function-call continuation, and multiple tool events returned 200.
  • Live Azure confirmed logprobs is incompatible with reasoning, so the bridge returns an explicit 400 for it.

Related: pollinations/pollinations#13072, pollinations/pollinations#13254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant