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:
apeltekci
2026-02-15 11:47:55 +07:00
committed by decolua
co-authored by Claude Sonnet 4.5 Cursor
parent 202fee714b
commit ac7cedd27e
7 changed files with 263 additions and 26 deletions
+3 -2
View File
@@ -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";
}