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 stream.data method. For example:
stream.data({
    status: 'thinking'
})
And on the client side, you can receive the data you send:
const {

} = useLayercodeAgent({
  agentId: "your-agent-id",
  authorizeSessionEndpoint: "/api/authorize",
  onDataMessage: (data) => console.log("Received data:", data), //  {status: 'thinking'}
});