stream.data method. For example:
How-to guides
Sending data to your client from Layercode stream
How to send data to your client via the Layercode stream
Sometimes you will want your Layercode stream to include additional data.
For example, you might want to update the user that the LLM is thinking or looking something up.
To do this, you can use the
And on the client side, you can receive the data you send: