What problem does it solve?
This Skill helps you implement reliable, resource-safe streaming from Effect-based AI models while keeping conversation history consistent and concurrency under control.
Core Features & Use Cases
- Stream protocol handling (start/delta/end): Normalize text, reasoning, tool-parameter, file, source, metadata, error, and finish parts into a predictable lifecycle.
- Incremental accumulation + checkpointed history: Efficiently merge streamed parts into prompt history using Prompt.concat and SubscriptionRef to avoid reprocessing everything on each chunk.
- Concurrency-safe streaming: Prevent overlapping stream runs using Semaphore and acquire/use/release patterns with Channel.acquireUseRelease.
- Deterministic consumption strategies: Process parts with runForEach, drain, or fold, while correctly matching by part.type.
- Operational guidance for safe matching: Use Match.when({ type: ... }) and avoid incorrect tag-based matching for StreamPart objects.
Quick Start
Implement Effect AI streaming by accumulating streamed StreamPart chunks, updating a SubscriptionRef-backed history checkpoint incrementally, and consuming parts using Match.when checks on part.type.