Feature Request: Add Support for OpenAI/Azure Responses API
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách xác định integration $client->chat()->create hiện tại và phần xử lý model được mô tả trong issue. Xác định cách path Chat Completions hiện có và path /responses mới sẽ cùng tồn tại, sau đó kiểm tra rằng GPT-5 Pro sử dụng Responses trong khi các model hiện có vẫn tương thích.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- PHP
- Star
- 49
- Fork
- 11
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của hyperf/odin
-
createOptions好像没法自定义?Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
流式chat时,tools报错Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
benjaminkott/bootstrap_package#1675 ·
-
sync-en
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày