@cloudflare/ai-chat.
If you are on AI SDK v5 and upgrading to v6, see the v6 migration guide instead.
Message format: content to parts
The biggest change. Messages now use a parts array instead of a content string:
You do not need to migrate stored messages manually.
AIChatAgent automatically transforms legacy messages on load via autoTransformMessages(). This handles v4 content strings, tool invocations, reasoning parts, file data, and malformed formats.Import changes
Tool definitions: parameters to inputSchema
Streaming events
v5 addstext-start and text-end events around text deltas, and renames textDelta to delta:
Migration checklist
1
Update dependencies
2
Update type imports
Replace
import type { Message } with import type { UIMessage }3
Update React imports
Replace
"ai/react" imports with "@ai-sdk/react"4
Update tool definitions
Rename
parameters to inputSchema in tool definitions5
Type check
6
Test your application
Legacy stored messages are migrated automatically
Migration utilities (deprecated)
These are available but rarely needed since migration is automatic:Further reading
- Official AI SDK v5 migration guide
- v6 migration guide (if upgrading further)