Guides
Streaming
You can stream messages, intermediate steps, and other data back to the user using the ChatResponseStream object. You can access this object from your Chat
function’s input.
Basic Usage
You can then use the Client SDK to read the stream from other services such as an API or NextJS application.
Learn more about Client SDK.
Stream Intermediate Steps
For agent-based application, you can stream intermediate steps back to the client. This can be useful for debugging, or for providing more context to the user. Here’s an example of an agent streaming intermediate step when a new tool is called:
The IntermediateStep
object contains the following fields:
A name or description of the intermediate step.
Data associated with the intermediate step.