Repository navigation
v0.4.0
prism 0.4.0: replay provider state across turns
No breaking changes.
A stored assistant message can now be sent back exactly as the provider produced it, matching the PHP reference (particle-academy/prism). Before this, the provider state that multi-turn conversations depend on was dropped, so a resumed conversation could lose it.
- Anthropic responses carry
content_blocks,stop_reasonand, when present,thinking_blocksinadditional_content(on the response, each step and the assistant message). When that message is sent back, itscontent_blocksare replayed in order, signatures included, following the reference's rules after a model fallback. The order of preference iscontent_blocks, thenthinking_blocks, then the olderthinkingandthinking_signaturepair. Anthropic requires signed thinking blocks to come back during a tool loop with extended thinking. - OpenAI Responses carry
output_itemsinadditional_content. When the message is sent back, those items are replayed as Responses input, keeping reasoning state across turns. - Thinking signatures and encrypted reasoning are opaque. They are passed through untouched and never logged.
- Checked against the shared cross-language corpus (prism-parity), generated from the published PHP reference 0.135.0, for both the response shape and the replayed request.