Get messages associated with a run with filtering options.
Args: run_id: ID of the run cursor: Cursor for pagination limit: Maximum number of messages to return ascending: Sort order by creation time role: Filter by role (user/assistant/system/tool) return_message_object: Whether to return Message objects or LettaMessage objects user_id: ID of the user making the request
Returns: A list of messages associated with the run. Default is List[LettaMessage].
Cursor for pagination
Maximum number of messages to return
Sort order by creation time
Filter by role
Successful Response
A message generated by the system. Never streamed back on a response, only used for cursor pagination.
Attributes: message (str): The message sent by the system id (str): The ID of the message date (datetime): The date the message was created in ISO format
A message sent by the user. Never streamed back on a response, only used for cursor pagination.
Attributes: message (str): The message sent by the user id (str): The ID of the message date (datetime): The date the message was created in ISO format
Representation of an agent’s internal reasoning.
Attributes: reasoning (str): The internal reasoning of the agent id (str): The ID of the message date (datetime): The date the message was created in ISO format
A message representing a request to call a tool (generated by the LLM to trigger tool execution).
Attributes: tool_call (Union[ToolCall, ToolCallDelta]): The tool call id (str): The ID of the message date (datetime): The date the message was created in ISO format
A message representing the return value of a tool call (generated by Letta executing the requested tool).
Attributes: tool_return (str): The return value of the tool status (Literal[“success”, “error”]): The status of the tool call id (str): The ID of the message date (datetime): The date the message was created in ISO format tool_call_id (str): A unique identifier for the tool call that generated this message stdout (Optional[List(str)]): Captured stdout (e.g. prints, logs) from the tool invocation stderr (Optional[List(str)]): Captured stderr from the tool invocation