Artifact 8da7f7b3fec4f5b92e8e20bc7f19a3a3d88d7d441865f9fb985acda3e39f6a7b:
- File
test/pic/chat-streams/openrouter_details.want
— 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: 627) [annotate] [blame] [check-ins using] [more...]
result: ok stop: stop usage: - native: {"role":"assistant","content":"done","reasoning":"Plan.","reasoning_details":[{"type":"reasoning.text","text":"Plan.","signature":"SIG-OR","format":"anthropic-claude-v1","index":0},{"type":"reasoning.encrypted","data":"ENC==","format":"anthropic-claude-v1","index":1}]} neutral: [{"type":"thinking","thinking":"Plan.","signature":"[{\"type\":\"reasoning.text\",\"text\":\"Plan.\",\"signature\":\"SIG-OR\",\"format\":\"anthropic-claude-v1\",\"index\":0},{\"type\":\"reasoning.encrypted\",\"data\":\"ENC==\",\"format\":\"anthropic-claude-v1\",\"index\":1}]"},{"type":"text","text":"done"}]