mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
feat(responses): respect client streaming preference + string input support (#121)
- Remove forced stream=true from responsesHandler - Add stream-to-JSON converter for non-streaming clients (Codex) - Accept string input in Responses API (normalize to array) - Codex SSE header fallback for missing Content-Type - Refactor: extract shared normalizeResponsesInput() Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
decolua
co-authored by
Claude Sonnet 4.5
Cursor
parent
202fee714b
commit
ac7cedd27e
@@ -36,8 +36,9 @@ function buildAnthropicCompatibleUrl(baseUrl) {
|
||||
|
||||
// Detect request format from body structure
|
||||
export function detectFormat(body) {
|
||||
// OpenAI Responses API: has input[] array instead of messages[]
|
||||
if (body.input && Array.isArray(body.input)) {
|
||||
// OpenAI Responses API: has input (array or string) instead of messages[]
|
||||
// The Responses API accepts both input as array and input as a plain string
|
||||
if (body.input && (Array.isArray(body.input) || typeof body.input === "string") && !body.messages) {
|
||||
return "openai-responses";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user