yera.models.data_classes
Class representing structured LLM conversation messages.
Symbols
Message
Inherits:
BaseModelRepresents a single message in an LLM conversation.
Attributes
role
type: Literal['user', 'system', 'assistant']
The speaker role — one of 'user', 'system', or 'assistant'.
content
type: str
The text content of the message.
Methods
Message.user
user(
content: str,
) → MessageCreate a user-role message.
Parameters
content
type: str
The text content of the user message.
Returns
type: Message
A Message instance with role set to 'user'.
Message.system
system(
content: str,
) → MessageCreate a system-role message.
Parameters
content
type: str
The text content of the system prompt.
Returns
type: Message
A Message instance with role set to 'system'.
Message.assistant
assistant(
content: str,
) → MessageCreate an assistant-role message.
Parameters
content
type: str
The text content of the assistant response.
Returns
type: Message
A Message instance with role set to 'assistant'.