yera.models.data_classes
Class representing structured LLM conversation messages.
Symbols
Message
BaseModelA single turn in an LLM conversation, optionally including thinking traces and tool metadata.
Attributes
The speaker role.
The text content of the message.
The thinking trace leading up to the content (if any)
data required for tool calls and results
whether a message is to be included back into the model context.
Methods
Message.user
user(
content: str,
) → MessageCreate a user-role message.
Parameters
The text content of the user message.
Returns
A Message instance with role set to 'user'.
Message.system
system(
content: str,
) → MessageCreate a system-role message.
Parameters
The text content of the system prompt.
Returns
A Message instance with role set to 'system'.
Message.assistant
assistant(
content: str,
thinking: str | None = None,
on_wire: bool = True,
provider_data: list[dict[str, object]] | None = None,
) → MessageCreate an assistant-role message.
Parameters
The text generated by the assistant.
Optional “thinking” trace produced while the assistant was formulating its response. Stored for later inspection if provided.
whether this line should be kept in the LLM context.
Opaque provider state required for later requests.
Returns
A Message instance with role set to "assistant", containing the supplied content and optional thinking data.
Message.tool_call
tool_call(
content: str,
tool_id: str,
call_id: str,
tool_schema: dict,
provider_data: list[dict[str, object]] | None = None,
) → MessageCreate a tool call message with metadata.
Parameters
JSON-formatted tool invocation payload.
Name of the invoked tool.
Unique identifier for this invocation.
JSON schema describing the tool input.
Opaque provider state required for later requests.
Returns
A tool-call message containing its invocation metadata.
Message.tool_result
tool_result(
content: str,
tool_id: str,
call_id: str,
tool_schema: dict,
) → MessageCreate a tool result message with metadata.
Parameters
JSON-formatted tool execution result.
Name of the tool invoked (must match original call).
Unique ID matching the original tool call.
Same schema as used in tool_call.
Returns
A Message instance with role set to "tool_result", containing the result content and tool metadata.
ToolData
BaseModelMetadata associated with a tool call or its result.
Attributes
Name of the invoked tool (usually the class name).
Unique identifier for this specific tool invocation.
JSON schema describing expected input/output structure.