Feature Request: Add Support for OpenAI/Azure Responses API
还没有人认领这个 Issue。
评估
调研方向
首先定位当前的 $client->chat()->create 集成,以及 issue 中描述的模型处理逻辑。确定现有的 Chat Completions 路径与新的 /responses 路径应如何共存,然后验证 GPT-5 Pro 使用 Responses,同时现有模型保持兼容。
由索引模型根据 Issue 内容生成。
描述
The current implementation only supports the Chat Completions API. This prevents the use of newer reasoning models such as gpt-5-pro, which are only available through the Responses API.
I would like to request support for the OpenAI/Azure Responses API, including automatic routing based on model capabilities.
⸻
Problem
When using Azure OpenAI with a GPT-5 Pro deployment, requests fail with the following error:
Invalid API request
The requested operation is unsupported.
Investigation shows that the library always sends requests to the Chat Completions endpoint:
POST /chat/completions
However, Azure GPT-5 Pro only supports the Responses API and does not support Chat Completions.
As a result, users cannot use GPT-5 Pro even though the deployment and credentials are configured correctly.
⸻
Current Behavior
The implementation assumes all chat-capable models support Chat Completions:
$client->chat()->create([
'model' => $model,
'messages' => $messages,
]);
This works for:
- GPT-4o
- GPT-4.1
- GPT-5 Mini
- GPT-5
but fails for:
- GPT-5 Pro
⸻
Expected Behavior
The library should support both APIs:
Chat Completions
POST /chat/completions
Responses API
POST /responses
The framework should be able to route requests to the appropriate API depending on model capabilities.
Example:
if ($modelCapabilities->supportsResponsesOnly()) {
$client->responses()->create(...);
} else {
$client->chat()->create(...);
}
⸻
Proposed Solution
Option 1: Native Responses API Support
Introduce a dedicated Responses API client:
$client->responses()->create([
'model' => 'gpt-5-pro',
'input' => $messages,
]);
This gives users direct access to the newer API surface.
⸻
Option 2: Automatic Capability Routing
Add model capability detection and transparently choose the correct endpoint.
Example:
$client->generate([
'model' => 'gpt-5-pro',
'messages' => $messages,
]);
Internally:
if ($model->supportsResponses()) {
return $responsesClient->create(...);
}
return $chatClient->create(...);
This provides the best developer experience and future-proofs the implementation as more models migrate to Responses API.
⸻
Additional Considerations
The Responses API introduces features that are becoming the primary interface for modern reasoning models:
- GPT-5 Pro support
- Future reasoning model compatibility
- Unified tool calling
- Structured outputs
- Multi-modal input/output
- Reasoning controls
Supporting only Chat Completions will increasingly limit compatibility with newer OpenAI and Azure OpenAI models.
⸻
Environment
Provider
Azure OpenAI
API Version
2024-12-01-preview
Working Model
gpt-5-mini
Failing Model
gpt-5-pro
Error
Invalid API request
The requested operation is unsupported.
⸻
Benefit
Adding Responses API support would enable compatibility with GPT-5 Pro and future reasoning-focused models while maintaining backward compatibility with existing Chat Completions integrations.
- 主要语言
- PHP
- 星标
- 49
- 派生
- 11
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hyperf/odin 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 25/100
-
流式chat时,tools报错未关闭
难度 2/5 1-3 小时 新手友好度 35/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 84/100
mailcow/mailcow-dockerized#7652 · 2 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 91/100
benjaminkott/bootstrap_package#1675 ·