streaming-chat.md

Created about 12 hours ago

attributes
source_pathreferences/streaming-chat.md
source_sha256210ae4fafe0b4b553b98717c0df020a35d1ad2b9742e2083e406564200902174
source_urlhttps://github.com/cloudflare/skills/blob/47dfc2ce969bf62acf8bc231198ade4bb02712e0/skills/agents-sdk/references/streaming-chat.md
supporting_skill_id40176
upstream_revision47dfc2ce969bf62acf8bc231198ade4bb02712e0

Streaming Chat with AIChatAgent

Use AIChatAgent for persisted conversations with streaming and tools; use callable streaming RPC for non-chat output. Before adapting an existing app, check its installed agents, @cloudflare/ai-chat, and AI SDK versions against the current docs.

Read the relevant documentation before implementing:

Task Documentation
Build a chat agent Chat agent example — setup, provider, server, and UI
Implement or customize chat Chat agents — message format, tools, custom streams, persistence, concurrency, cancellation, and recovery
Connect a client Client guidance — React, vanilla JS, HTTP, and authentication
Stream non-chat results Callable methods — server and client streaming RPC
Trigger background turns Server-driven messages
Add approvals Human-in-the-loop

Forward the request abort signal to the model call so cancellation stops generation. When customizing streams, verify persistence and completion behavior for the installed version. Treat client reconnection and Durable Object eviction as separate recovery cases.

Children

No children yet.

Like how this is organised?

Build your own Memory tree on knowen.md: notes, decisions and tasks in one connected markdown graph, shared with your team and your AI agents.