[KongchangAI]
ConcepttoUIMessageChunk 函数

toUIMessageChunk

A function in the AI SDK that converts a model output stream into UI message chunks; its output determines which content front-end components can render.

Core Facts

Timeline (last 90 days)

Dec 4

toUIMessageChunk is the adapter function that converts model-layer streaming chunks into UI message chunks consumable by the frontend, and is the protocol boundary between the server and frontend hooks such as useChat.

Unverified50%
Dec 4

The two interfaces toUIMessageChunk and createModelCallToUIChunkTransform now both accept and forward the four parameters sendReasoning, sendSources, onError, and redactToolErrors

Unverified50%
Dec 4

@ai-sdk/workflow 2.0.123 changes toUIMessageChunk's separate switch branches to directly delegate to the same-named implementation in AI SDK Core

Unverified50%
Dec 4

Both transformation functions of @ai-sdk/workflow, toUIMessageChunk and createModelCallToUIChunkTransform, now accept and forward the sendReasoning, sendSources, onError, and redactToolErrors parameters.

Unverified50%
Dec 4

In @ai-sdk/workflow version 2.0.123, toUIMessageChunk no longer maintains its own switch statement, but instead delegates standard stream chunks to the core implementation in the ai package.

Partially Verified75%
Dec 4

`@ai-sdk/workflow`'s `toUIMessageChunk` now delegates to AI SDK Core, thereby preserving the provider's `custom` parts, tool result and error metadata, `reasoning-file`, `tool-approval-response`, and citation information.

Unverified50%
Dec 4

Both functions of `@ai-sdk/workflow` now accept and forward the `sendReasoning`, `sendSources`, `onError`, and `redactToolErrors` parameters, and the default value of `sendSources` is `false`.

Unverified70%

All Facts (7)

Source Articles