---
sidebar:
  label: roboto.ai.core
  order: 2
title: roboto.ai.core
---
Data models of threads with Roboto's AI: messages, their content blocks, and the events a thread yields.

[`messages`](/docs/reference/python-sdk/roboto/ai/agent_thread#roboto.ai.agent_thread.AgentThread.messages) returns [`AgentMessage`](/docs/reference/python-sdk/roboto/ai/core#roboto.ai.core.AgentMessage) items, and [`events()`](/docs/reference/python-sdk/roboto/ai/agent_thread#roboto.ai.agent_thread.AgentThread.events) yields [`AgentEvent`](/docs/reference/python-sdk/roboto/ai/core#roboto.ai.core.AgentEvent) items as the AI responds. Pass [`ClientViewingContext`](/docs/reference/python-sdk/roboto/ai/core#roboto.ai.core.ClientViewingContext) to [`start()`](/docs/reference/python-sdk/roboto/ai/agent_thread#roboto.ai.agent_thread.AgentThread.start) or [`send()`](/docs/reference/python-sdk/roboto/ai/agent_thread#roboto.ai.agent_thread.AgentThread.send) to tell the AI what the user is looking at, and [`AnalysisScope`](/docs/reference/python-sdk/roboto/ai/core#roboto.ai.core.AnalysisScope) to set the time range the AI should analyze.

## Submodules

- [roboto.ai.core.content](/docs/reference/python-sdk/roboto/ai/core/content)
- [roboto.ai.core.context](/docs/reference/python-sdk/roboto/ai/core/context)
- [roboto.ai.core.event](/docs/reference/python-sdk/roboto/ai/core/event)
- [roboto.ai.core.record](/docs/reference/python-sdk/roboto/ai/core/record)
- [roboto.ai.core.task](/docs/reference/python-sdk/roboto/ai/core/task)

## Package Contents

- [AGENT_CONTENT_MODEL_BY_TYPE](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.AGENT_CONTENT_MODEL_BY_TYPE) (data): `AGENT_CONTENT_MODEL_BY_TYPE: dict[AgentContentType, type[AgentContent]]`. Model of each kind of content block other than text, keyed by its `content_type`.

- [AgentClientContextEntry](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.AgentClientContextEntry) (class): What the caller had open when they sent a message, carried as a block on that message.

- [AgentCompressionFillerContent](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.AgentCompressionFillerContent) (class): Stand-in for the content of a message Roboto emptied in the copy of a thread it sends to the AI model.

- [AgentContent](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.AgentContent) (type alias): `type AgentContent = AgentTextContent | AgentToolUseContent | AgentToolResultContent | AgentErrorContent | AgentDeletedContent | AgentCompressionFillerContent | AgentClientContextEntry`. Content block of any kind: one of the content block models.

- [AgentContentType](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.AgentContentType) (class): Kind of a content block in a message.

- [AgentDeletedContent](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.AgentDeletedContent) (class): Placeholder for a content block Roboto removed from the shortened copy of a thread it sends to the AI model.

- [AgentErrorContent](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.AgentErrorContent) (class): Error block of a message: why Roboto's AI failed to generate the message, or that it was cancelled.

- [AgentErrorEvent](/docs/reference/python-sdk/roboto/ai/core/event#roboto.ai.core.event.AgentErrorEvent) (class): Event reporting an error in a message, such as when its generation failed or was cancelled.

- [AgentEvent](/docs/reference/python-sdk/roboto/ai/core/event#roboto.ai.core.event.AgentEvent) (type alias): `type AgentEvent = typing.Union[AgentStartTextEvent, AgentTextDeltaEvent, AgentTextEndEvent, AgentToolUseEvent, AgentToolResultEvent, AgentErrorEvent]`. Event of any kind that [`events()`](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread#roboto.ai.agent_thread.agent_thread.AgentThread.events) yields.

- [AgentMessage](/docs/reference/python-sdk/roboto/ai/core/record#roboto.ai.core.record.AgentMessage) (class): Message in a thread from one sender, made of content blocks such as text, tool uses, and tool results.

- [AgentMessageStatus](/docs/reference/python-sdk/roboto/ai/core/record#roboto.ai.core.record.AgentMessageStatus) (class): Status of a message's generation.

- [AgentRole](/docs/reference/python-sdk/roboto/ai/core/record#roboto.ai.core.record.AgentRole) (class): Role of a message's sender in a thread.

- [AgentStartTextEvent](/docs/reference/python-sdk/roboto/ai/core/event#roboto.ai.core.event.AgentStartTextEvent) (class): Event marking the start of a run of text in a message.

- [AgentTextContent](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.AgentTextContent) (class): Text block of a message, from the caller or from Roboto's AI.

- [AgentTextDeltaEvent](/docs/reference/python-sdk/roboto/ai/core/event#roboto.ai.core.event.AgentTextDeltaEvent) (class): Event carrying the next piece of a run of text, as Roboto's AI generates it.

- [AgentTextEndEvent](/docs/reference/python-sdk/roboto/ai/core/event#roboto.ai.core.event.AgentTextEndEvent) (class): Event marking the end of a run of text in a message.

- [AgentThreadDelta](/docs/reference/python-sdk/roboto/ai/core/record#roboto.ai.core.record.AgentThreadDelta) (class): Response body of `GET /v1/ai/threads/{thread_id}/delta`: a thread's changes since a continuation token.

- [AgentThreadRecord](/docs/reference/python-sdk/roboto/ai/core/record#roboto.ai.core.record.AgentThreadRecord) (class): Data record of a thread, as the Roboto API returns it.

- [AgentThreadStatus](/docs/reference/python-sdk/roboto/ai/core/record#roboto.ai.core.record.AgentThreadStatus) (class): Status of a thread: whose turn it is, or why the thread stopped.

- [AgentToolResultContent](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.AgentToolResultContent) (class): Tool result block of a message: what a tool returned when it ran for a tool use.

- [AgentToolResultEvent](/docs/reference/python-sdk/roboto/ai/core/event#roboto.ai.core.event.AgentToolResultEvent) (class): Event reporting the result of a tool the AI asked to run.

- [AgentToolUseContent](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.AgentToolUseContent) (class): Tool use block of a message: a request from Roboto's AI to run a tool.

- [AgentToolUseEvent](/docs/reference/python-sdk/roboto/ai/core/event#roboto.ai.core.event.AgentToolUseEvent) (class): Event reporting that Roboto's AI asked to run a tool.

- [AnalysisScope](/docs/reference/python-sdk/roboto/ai/core/context#roboto.ai.core.context.AnalysisScope) (class): Time window of the data Roboto's AI analyzes in a thread.

- [ClientToolSpec](/docs/reference/python-sdk/roboto/ai/core/record#roboto.ai.core.record.ClientToolSpec) (class): Specification of a client tool: a tool Roboto's AI can ask the caller to run, whose result the caller submits.

- [ClientViewingContext](/docs/reference/python-sdk/roboto/ai/core/context#roboto.ai.core.context.ClientViewingContext) (class): What the caller had open in their client, such as the Roboto web app, when they wrote a message to Roboto's AI.

- [ModelProfileResponse](/docs/reference/python-sdk/roboto/ai/core/record#roboto.ai.core.record.ModelProfileResponse) (class): Item of the response body of `GET /v1/ai/model-profiles`: a model profile the organization can pick.

- [synthesize_tool_result_payload()](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.synthesize_tool_result_payload) (function): Build a tool result's text or JSON output from its `raw_response`.
