Skip to main content
Base for a typed message from the model to its clients. Subclass it and declare fields like a dataclass:
The client receives {"type": "progress", "data": {"chunk": 3, "total": 100}}. The wire type is the snake_case form of the class name. The class docstring documents the message in the published schema. A message with no fields is valid and is the right shape for a pure signal. Send one to every connected client with await self.send(message), or to a single client with await client.send(message). Returning one from an @event handler makes it that command’s correlated reply. See Events & Messages.