@ai-sdk/svelte 3.0.0 rebuilds Chat on AbstractChat from ai 5.0.0, and several names, options, methods and properties that 2.1.12 exposed are gone. A module or component needs an edit if it imports Message, CreateMessage or ChatOptions, calls append, reload or addToolResult on a Chat, or reads data from a Chat or Completion. Messages now carry parts where they used to carry a content string.
What changed
- Message types.
MessageandCreateMessageare no longer exported.UIMessageandCreateUIMessagereplace them, andmessage.contentis gone: the text of a message is its text parts joined in order. - Constructor options.
ChatOptionsis removed andChattakesChatInitfromai. The argument is required, sonew Chat()fails to compile and throws at run time.initialMessagesbecomesmessages, andapi,headers,body,credentialsandfetchmove into atransport.maxSteps,initialInput,onResponse,keepLastMessageOnErrorandsendExtraMessageFieldsno longer exist. - Renamed methods.
appendis nowsendMessage, which takes{ text }or aCreateUIMessagewith parts.reloadis nowregenerate. Neither accepts thedatarequest option any more. - The
dataproperty.ChatandCompletionno longer have it, andai5.0.0 removedStreamData. On aChat, server data now arrives as data parts on the messages, written withcreateUIMessageStream.Completionhas nothing in its place. addToolResult. It takes{ tool, toolCallId, output }where it took{ toolCallId, result }, andtoolandoutputare both required.
Before and after
The change you are most likely to meet is addToolResult inside an onToolCall handler:
chat.addToolResult({ toolCallId: toolCall.toolCallId, result: 'London' });The patch renames the key and names the tool whose call is being answered:
chat.addToolResult({ tool: toolCall.toolName, toolCallId: toolCall.toolCallId, output: 'London' });No change in this release has a deterministic patch. The other rewrites follow the same direct shape: reload becomes regenerate with headers and body kept, initialMessages becomes messages, and new Chat() becomes new Chat({}).
Migration guidance and its limits
Run emendant scan to list the affected files, then emendant fix. All six findings have assisted patches, so emendant fix writes one only when you name a model provider, on the command line or in your Emendant configuration. Each patch is checked with your typecheck and with the tests it affects. Nothing in this release is report only.
Some patches change more than the file they edit. If your server read the data request option, it has to receive that value in body instead. Replacing maxSteps means the route must stop on its own, for example with stopWhen in streamText. Moving off data means changing the route as well as the component, and a Completion has no replacement to move to. A patch may not be available where the surrounding code decides the outcome, such as an addToolResult call where the tool name cannot be read from the code around it. Review those by hand.
A clean scan covers imports of the removed names from @ai-sdk/svelte, reads of append, reload and data on instances built from it, and addToolResult calls whose argument has no output. It does not read markup, so a chat.reload() or chat.data inside a template is not reported. The managed input and handleSubmit are not among the findings either, so check any code that still uses them.
What Emendant detects, fixes and verifies
11 changes in @ai-sdk/svelte 3.0.0. 0 automatic fixes, 11 fixes requiring a model provider you choose, 0 report only. Each patch states which checks passed. Understand patch evidence.
| Change | Severity | Detects | Fix | Verified by |
|---|---|---|---|---|
Message and CreateMessage are no longer exportedai-sdk-svelte-npm-3.0.0-message-types-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
ChatOptions was removed, and Chat takes ai's ChatInitai-sdk-svelte-npm-3.0.0-chat-options-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
Chat's append was removed in favour of sendMessageai-sdk-svelte-npm-3.0.0-chat-append-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
Chat's reload was removed in favour of regenerateai-sdk-svelte-npm-3.0.0-chat-reload-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
Chat and Completion no longer have dataai-sdk-svelte-npm-3.0.0-data-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
Chat's addToolResult takes output and tool where it took resultai-sdk-svelte-npm-3.0.0-add-tool-result-output-renamed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
Chat no longer manages an input, and handleSubmit was removedai-sdk-svelte-npm-3.0.0-chat-managed-input-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
new Chat takes messages where it took initialMessagesai-sdk-svelte-npm-3.0.0-chat-initial-messages-renamed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
new Chat no longer takes api, headers, body, credentials or fetchai-sdk-svelte-npm-3.0.0-chat-request-options-moved-to-transport | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
new Chat no longer takes maxSteps, initialInput, onResponse, keepLastMessageOnError or sendExtraMessageFieldsai-sdk-svelte-npm-3.0.0-chat-options-dropped | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
new Completion no longer takes onResponseai-sdk-svelte-npm-3.0.0-completion-on-response-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
emendant explain <change-id> prints any row's entry, guidance and sources at the terminal.
The error TS lines are what TypeScript 5.9.3 printed when code that compiled against @ai-sdk/svelte 2.1.12 was compiled against 3.0.0. A row without one is a change the compiler does not report, such as a deprecation or a change in behaviour.
Coverage
Requires emendant@0.10.0 or later. Run emendant feed update to get the latest coverage.
Coverage details
- Snapshot
2026-10-22.4, sequence 58, signed 22 October 2026- Feed entry
feed/npm/@ai-sdk/svelte/3.0.0.json
emendant feed status shows the snapshot your machine holds.
Primary sources
- package.jsonvercel/ai at @ai-sdk/svelte@3.0.0
- Changelogvercel/ai at @ai-sdk/svelte@3.0.0
- Migration guidevercel/ai at ai@5.0.0
- @ai-sdk/svelte@3.0.0npm registry, the published package
- @ai-sdk/svelte@2.1.12npm registry, the published package
- ai@5.0.0npm registry, the published package
- @ai-sdk/ui-utils@1.2.11npm registry, the published package
- Chat.svelte.tsvercel/ai at @ai-sdk/svelte@3.0.0
Scan your repository
Find affected code without editing your files.
npx emendant scanThen npx emendant fix writes the patches the table says exist. The getting started guide covers the flags and the patch grades.
Related release pages
- Earlier @ai-sdk/svelte release: @ai-sdk/svelte 2.0.0: hooks move to classes
Every @ai-sdk/svelte release page is listed on one page.