Cedar enables streaming responses by default in your chat interface. Responses appear in real-time as they’re generated. You can disable streaming by setting the stream prop to false on any chat component or ChatInput.
Partial Object Streaming Not Supported: Cedar currently doesn’t support partial object streaming. For structured data to be handled via Cedar’s automatic handlers, only complete objects should be streamed or streaming should be turned off.

Quick Start

With Pre-built Components

Streaming is enabled by default for all pre-built chat components:
import { FloatingCedarChat } from 'cedar-os-components';

function App() {
	return (
		<FloatingCedarChat
			// Streaming is enabled by default
			side='right'
			title='Streaming Assistant'
		/>
	);
}
To disable streaming, set stream={false}:
<FloatingCedarChat
	stream={false} // Disable streaming
	side='right'
	title='Non-Streaming Assistant'
/>

With Individual Components

The ChatInput component has streaming enabled by default, but you can override it:
import { ChatInput, ChatBubbles } from 'cedar-os';

function CustomChat() {
	return (
		<div className='flex flex-col h-full'>
			<div className='flex-1'>
				<ChatBubbles />
			</div>
			<ChatInput
				stream={false} // Override to disable streaming
				position='embedded'
			/>
		</div>
	);
}

How It Works

When streaming is enabled:
  1. Real-time Updates: Text streams in character by character as it’s generated
  2. Out of the box support for streaming flexible objects: Handle structured objects and custom events (see Custom Message Rendering)
  3. Smooth Animation: Built-in typewriter effect for natural reading experience
  4. Error Handling: Graceful fallbacks if streaming fails

Additional Configuration necessary by provider

  • OpenAI and AI SDK: Streaming is supported out of the box
  • Mastra and Custom backend: The backend is required to send a data-only SSE stream of information in either streamed text or entire objects

Next Steps