Message class is designed to send, stream, update or remove messages.
Parameters
Language of the code if the content is code. See
https://react-code-blocks-rajinwonderland.vercel.app/?path=/story/codeblock—supported-languages
for a list of supported languages.
Custom metadata dictionary to attach to the message. Persisted with the message in the data layer.
The command selected by the user for this message. Set automatically by the UI when the user picks a command. Access this value in the on_message handler via
msg.command.Since version 2.1.0.
The modes selected by the user for this message, as a dict of
{mode_id: option_id}. Set automatically by the UI when the user configures mode pickers. Access this value in the on_message handler via msg.modes.Since version 2.9.4.
ID of the parent step or message. Automatically resolved from the current step context if not provided.
The message type (
assistant_message or user_message). Automatically set based on the message direction.ISO 8601 timestamp for the message creation. Automatically set to the current UTC time when
.send() is called.