To learn how to emit streams from your tasks, see our backend streams
documentation.
useRealtimeRunWithStreams
TheuseRealtimeRunWithStreams
hook allows you to subscribe to a run by its ID and also receive any streams that are emitted by the task.
useRealtimeRunWithStreams
hook to get type-safety:
Streaming AI responses
Here’s a more complete example showing how to display streaming OpenAI responses:AI SDK with tools
When using the AI SDK with tools, you can access tool calls and results:Common options
experimental_throttleInMs
The*withStreams
variants of the Realtime hooks accept an experimental_throttleInMs
option to throttle the updates from the server. This can be useful if you are getting too many updates and want to reduce the number of updates.