Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 24 Oct 15:49
· 17 commits to main since this release
5b8d92d

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_reason and, when present, thinking_blocks in additional_content (on the response, each step and the assistant message). When that message is sent back, its content_blocks are replayed in order, signatures included, following the reference's rules after a model fallback. The order of preference is content_blocks, then thinking_blocks, then the older thinking and thinking_signature pair. Anthropic requires signed thinking blocks to come back during a tool loop with extended thinking.
  • OpenAI Responses carry output_items in additional_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.