Skip to content

Support Azure AI Foundry OpenAI models via the Responses API (Fixes #47)#48

Merged
Izzetee merged 3 commits into
mainfrom
fix/az-foundry-responses-api-47
Jul 10, 2026
Merged

Support Azure AI Foundry OpenAI models via the Responses API (Fixes #47)#48
Izzetee merged 3 commits into
mainfrom
fix/az-foundry-responses-api-47

Conversation

@Izzetee

@Izzetee Izzetee commented Jul 10, 2026

Copy link
Copy Markdown
Owner

What

Adds support for Azure AI Foundry OpenAI models served through the OpenAI Responses API (/openai/v1/responses).

Fixes #47.

Why

Azure AI Foundry now serves OpenAI deployments (e.g. gpt-5.x) via the Responses API, which replaces the Chat Completions messages field with input and returns an output array instead of choices. PiPiMink only spoke Chat Completions, so tagging/chat/routing/benchmarking failed with:

HTTP 400: Unsupported parameter: 'messages'. In the Responses API, this parameter has moved to 'input'.
tag: error tagging model gpt-5.6-terra (az-foundry): missing or empty choices in response

…and the model was auto-disabled.

How

Backend

  • New provider type openai-responses, plus auto-detection when a chat_path targets /responses (so existing path-only overrides work and future migrations keep working).
  • New ProviderConfig.UsesResponsesAPI() and ResponsesURL() helpers.
  • New internal/llm/responses.go: request builder (input) and a robust response parser (outputmessageoutput_text, with error and incomplete_details handling).
  • Wired into tagging, chat, model selection, and the benchmark judge.
  • temperature and max_output_tokens are omitted by default so reasoning models (o-series, gpt-5.x) are not rejected and manage their own output budget.

Frontend

  • openai-responses added to the type union, the provider and per-model type selectors, a provider-list badge, and a chat-path hint.

Docs & config

  • README, SETUP (new endpoint pattern + diagram/table/example), CHANGELOG, AGENTS, copilot-instructions, providers.example.json, .env.example.

Testing

  • go build ./..., go test -short ./... — all pass.
  • New unit tests: UsesResponsesAPI/ResponsesURL/ForModel override; buildResponsesInput/buildResponsesPayload/extractResponsesContent; an end-to-end chat test asserting the /responses endpoint is hit and the body uses input (not messages).
  • Frontend: tsc --noEmit, vitest run (22 passed), npm run build — all pass.
  • markdownlint-cli2 — 0 errors.

How to configure

{
  "name": "gpt-5",
  "type": "openai-responses",
  "chat_path": "/openai/v1/responses",
  "api_key_env": "AZURE_FOUNDRY_GPT5_API_KEY"
}

Izzetee added 3 commits July 10, 2026 16:34
Azure AI Foundry now serves OpenAI deployments (e.g. gpt-5.x) through the
OpenAI Responses API at /openai/v1/responses. That API replaces the Chat
Completions "messages" field with "input" and returns an "output" array
instead of "choices", so PiPiMink's Chat Completions path failed with
HTTP 400 "Unsupported parameter: 'messages'" and auto-disabled the model.

Backend:
- New provider type "openai-responses" plus auto-detection when a chat_path
  targets "/responses" (forward compatibility with future migrations).
- New ProviderConfig helpers UsesResponsesAPI() and ResponsesURL().
- New internal/llm/responses.go: buildResponsesInput/buildResponsesPayload,
  extractResponsesContent (output->message->output_text, with error and
  incomplete_details handling), and a shared send helper.
- Wired the Responses path into tagging, chat, model selection, and the
  benchmark judge. temperature and max_output_tokens are omitted by default
  so reasoning models are not rejected.

Frontend:
- Added "openai-responses" to the ProviderType union, the provider and
  per-model type selectors, a provider-list badge, and a chat-path hint.

Docs & config:
- README, SETUP (new endpoint pattern), CHANGELOG, AGENTS,
  copilot-instructions, providers.example.json, and .env.example.

Tests:
- config: UsesResponsesAPI/ResponsesURL/ForModel override.
- llm: buildResponsesInput/Payload and extractResponsesContent cases;
  end-to-end chat test asserting the /responses endpoint and "input" body.

Fixes #47
@Izzetee
Izzetee merged commit 0e43250 into main Jul 10, 2026
8 checks passed
@Izzetee
Izzetee deleted the fix/az-foundry-responses-api-47 branch July 10, 2026 15:20
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.

Azure AI Foundry OpenAI models fail: Responses API (input/output) not supported

1 participant