Skip to content

feat: add decision api for openai - #2819

Merged
yuzisun merged 3 commits into
theagentrouter:mainfrom
hustxiayang:openai-decision
Oct 8, 2026
Merged

yuzisun merged 3 commits into
theagentrouter:mainfrom
hustxiayang:openai-decision

Conversation

@hustxiayang

@hustxiayang hustxiayang commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Description
Implements native passthrough support for the OpenAI Decisions API at POST /v1/decisions. The endpoint accepts the OpenAI request schema, including predicate, choice, and score questions, and forwards requests to OpenAI backends while preserving the native response body.

OpenAI released this endpoint in beta on 2026-10-06 and currently support it for the gpt-6-luna model only. See the [1]. Amazon Bedrock and Microsoft Foundry both offer gpt-6-luna, but their published documentation lists only the Responses and Chat Completions APIs (plus Messages, Converse, and Invoke on Bedrock) and does not mention the Decisions API. AWS OpenAI and Azure OpenAI backends are therefore not supported.

In this pr, questions and answers use flat structs rather than the SDK's per-type unions because the gateway forwards Decisions requests and responses without branching on their type. This also keeps new question or answer types added during the beta working without a gateway change.

1: https://developers.openai.com/api/docs/guides/decisions

Signed-off-by: yxia216 <yxia216@bloomberg.net>
@hustxiayang
hustxiayang requested a review from a team as a code owner October 8, 2026 13:54
@netlify

netlify Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for theagentrouter canceled.

Name Link
🔨 Latest commit 5f61552
🔍 Latest deploy log https://app.netlify.com/projects/theagentrouter/deploys/6ac817b7f9d7390007b1e6ee

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.93939% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/translator/openai_decisions.go 87.50% 4 Missing ⚠️
internal/tracing/openinference/openai/decisions.go 93.02% 3 Missing ⚠️
internal/tracing/tracer.go 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Signed-off-by: yxia216 <yxia216@bloomberg.net>
@hustxiayang

Copy link
Copy Markdown
Contributor Author

@nacx @aabchoo Could you please help review on this? Thanks a lot!

@yuzisun
yuzisun merged commit 2e7cf2c into theagentrouter:main Oct 8, 2026
40 checks passed
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.

2 participants