Response Stream

Render complete responses at a chosen pace, while asynchronously arriving AI chunks appear immediately as the model yields them.

Installation

Copy the command below and run it in your terminal.

bunx @sivir-ui/svelte add response-stream

Usage

Live responses

Pass the async iterable returned by your model. Chunks render as soon as they arrive.

import { ResponseStream } from '@sivir-ui/svelte/components/response-stream';

<ResponseStream textStream={modelResponse} />

Complete responses

For a complete string, use speed from 1 (slowest) to 100 (fastest) to control the reveal pace.

<ResponseStream textStream="Draft saved." speed={70} />