AI SDK UIStreamData
StreamData
The StreamData
class allows you to stream additional data to the client (see Streaming Data).
Import
React
import { StreamData } from "ai"
API Signature
Constructor
const data = new StreamData();
Methods
append
Appends a value to the stream data.
data.append(value: JSONValue)
appendMessageAnnotation
Appends a message annotation to the stream data.
data.appendMessageAnnotation(annotation: JSONValue)
close
Closes the stream data.
data.close();