Parents and children of check-in [3ff8346a3f]
|
2026-11-19
| ||
| 00:56 |
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. check-in: 55cff08c2c user: dmestas tags: stage-4 | |
| 00:38 |
Journal every reply in two forms and convert across models
Assistant entries keep the provider content verbatim with its origin (provider, api, model) and Pi neutral form; tool calls come from the neutral form, the same for every provider. A turn goes back verbatim to the model that wrote it and is otherwise rebuilt from the neutral form, without thinking and with tool-call ids normalised identically in calls and results. --model resolves through the registry, keys come from the model, and schema 3 journals migrate in place on open. check-in: 3ff8346a3f user: dmestas tags: stage-4 | |
| 00:24 |
Add the model registry: provider/model names, Pi compat, models.json
Built-in providers carry the base URL, wire API and key variable Pi uses for them; OpenAI-compatible dialects are detected from provider and base URL as Pi does; ~/.pic/models.json, or an existing Pi models file, adds providers such as a local server and overrides any field. check-in: 42a80c44fd user: dmestas tags: stage-4 | |