Artifact 7cadad4f43ef533a02c9c8801d908174743f9b413c324abf729d513ec17e8edc:
- File
test/fuzz/sse.dict
— part of check-in
[55cff08c2c]
at
2026-11-19 00:56:53
on branch stage-4
— Add the Chat Completions adapter for OpenAI, OpenRouter and compatibles
A chunk decoder following Pi: text, reasoning from reasoning_content, reasoning or reasoning_text kept under its field, OpenRouter reasoning_details verbatim, tool calls by index, usage, finish_reason, and in-stream errors. Requests follow Pi too: system or developer role, tools as functions, tool messages, stream_options, store and reasoning by dialect. The retry loop and header assembly move into a shared module both adapters use. Recorded streams, a fuzz target and fake server cases cover it, including a conversation moving between the two APIs in both directions. (user: dmestas, size: 527) [annotate] [blame] [check-ins using]
"event: " "data: " "\x0a\x0a" "\x0d\x0a" ": " "message_start" "content_block_start" "content_block_delta" "content_block_stop" "message_delta" "message_stop" "ping" "error" "text_delta" "thinking_delta" "signature_delta" "input_json_delta" "partial_json" "\"type\":" "\"index\":" "\"delta\":" "\"content_block\":" "\"message\":" "\"usage\":" "\"stop_reason\":" "tool_use" "thinking" "\"input\":{}" "[DONE]" "choices" "delta" "tool_calls" "finish_reason" "reasoning_content" "reasoning_details" "arguments" "\"index\":" "usage"