---
sidebar:
  label: roboto.ai.agent_thread
  order: 1
title: roboto.ai.agent_thread
---
Threads: persistent, multi-turn conversations with Roboto's AI.

Use [`AgentThread`](/docs/reference/python-sdk/roboto/ai/agent_thread#roboto.ai.agent_thread.AgentThread) to start a thread, send it messages, and follow the AI's replies, and [`client_tool()`](/docs/reference/python-sdk/roboto/ai/agent_thread#roboto.ai.agent_thread.client_tool) or [`ClientTool`](/docs/reference/python-sdk/roboto/ai/agent_thread#roboto.ai.agent_thread.ClientTool) to give the AI tools that run in your Python process. Pass those tools 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 offer them to the AI in a thread.

## Submodules

- [roboto.ai.agent_thread.agent_thread](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread)
- [roboto.ai.agent_thread.agent_thread_goal_view](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread_goal_view)
- [roboto.ai.agent_thread.client_tool](/docs/reference/python-sdk/roboto/ai/agent_thread/client_tool)
- [roboto.ai.agent_thread.event](/docs/reference/python-sdk/roboto/ai/agent_thread/event)
- [roboto.ai.agent_thread.feedback](/docs/reference/python-sdk/roboto/ai/agent_thread/feedback)
- [roboto.ai.agent_thread.record](/docs/reference/python-sdk/roboto/ai/agent_thread/record)

## 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`.

- [AdminUpdateFeedbackRequest](/docs/reference/python-sdk/roboto/ai/agent_thread/feedback#roboto.ai.agent_thread.feedback.AdminUpdateFeedbackRequest) (class): Request body for `PUT /v1/admin/feedback/{feedback_id}`.

- [AgentArtifactRecord](/docs/reference/python-sdk/roboto/ai/core/content#roboto.ai.core.content.AgentArtifactRecord) (class): File a tool produced while it ran.

- [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.

- [AgentGoalStatus](/docs/reference/python-sdk/roboto/ai/goals/types#roboto.ai.goals.types.AgentGoalStatus) (class): Status of a goal: whether Roboto's AI has achieved it.

- [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.

- [AgentSubtask](/docs/reference/python-sdk/roboto/ai/core/task#roboto.ai.core.task.AgentSubtask) (class): Sub-task of a task: one step of its work, tracked as a checklist item.

- [AgentSubtaskStatus](/docs/reference/python-sdk/roboto/ai/core/task#roboto.ai.core.task.AgentSubtaskStatus) (class): Status of a sub-task: whether Roboto's AI has done it.

- [AgentTask](/docs/reference/python-sdk/roboto/ai/core/task#roboto.ai.core.task.AgentTask) (class): Task in a thread's task list: a unit of work Roboto's AI plans, such as a question to answer or a deliverable.

- [AgentTaskBoundary](/docs/reference/python-sdk/roboto/ai/core/task#roboto.ai.core.task.AgentTaskBoundary) (class): Position in a thread of the tool use with which Roboto's AI started or completed a task.

- [AgentTaskMinimal](/docs/reference/python-sdk/roboto/ai/core/task#roboto.ai.core.task.AgentTaskMinimal) (class): ID and resulting status of a task that one of Roboto's AI task tools changed.

- [AgentTaskStatus](/docs/reference/python-sdk/roboto/ai/core/task#roboto.ai.core.task.AgentTaskStatus) (class): Status of a task in a thread's task list: whether Roboto's AI has started or completed it.

- [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.

- [AgentThread](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread#roboto.ai.agent_thread.agent_thread.AgentThread) (class): A thread: a persistent, multi-turn conversation with Roboto's AI.

- [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.

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

- [AgentThreadGoalView](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread_goal_view#roboto.ai.agent_thread.agent_thread_goal_view.AgentThreadGoalView) (class): Goal declared on a turn of a thread, with the result the AI submitted for it found in the thread's messages.

- [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.

- [AgentThreadSubject](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.AgentThreadSubject) (class): Resource an agent thread is about, such as a dataset, file or session, recorded so the thread can be found.

- [AgentToolArtifactResponse](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.AgentToolArtifactResponse) (class): Response body of `GET /v1/ai/threads/{thread_id}/tool-use/{tool_use_id}/artifacts/{name}`.

- [AgentToolDetailResponse](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.AgentToolDetailResponse) (class): Response body of `GET /v1/ai/threads/{thread_id}/tool-use/{tool_use_id}`.

- [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.

- [AvailableSkillSpec](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.AvailableSkillSpec) (class): Skill the AI may apply on its own during one thread, at a fixed version.

- [ClientTool](/docs/reference/python-sdk/roboto/ai/agent_thread/client_tool#roboto.ai.agent_thread.client_tool.ClientTool) (class): A client tool together with the Python function that runs it when Roboto's AI requests the tool.

- [ClientToolResult](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.ClientToolResult) (class): Result of one client-side tool call: a tool your code ran when the AI called it.

- [ClientToolResultStatus](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.ClientToolResultStatus) (class): Outcome of a client-side tool call: whether the tool ran, failed, or was not run.

- [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.

- [FeedbackCategory](/docs/reference/python-sdk/roboto/ai/agent_thread/feedback#roboto.ai.agent_thread.feedback.FeedbackCategory) (class): Category of feedback on a message from Roboto's AI: what about the message was good or bad.

- [FeedbackSentiment](/docs/reference/python-sdk/roboto/ai/agent_thread/feedback#roboto.ai.agent_thread.feedback.FeedbackSentiment) (class): Sentiment of feedback on a message from Roboto's AI: whether the rating is positive or negative.

- [ForkAgentThreadRequest](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.ForkAgentThreadRequest) (class): Request body for [`fork()`](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread#roboto.ai.agent_thread.agent_thread.AgentThread.fork).

- [InvokeSkillSpec](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.InvokeSkillSpec) (class): Skill the caller chooses to apply in a turn, rather than leaving the choice to the AI.

- [NEGATIVE_CATEGORIES](/docs/reference/python-sdk/roboto/ai/agent_thread/feedback#roboto.ai.agent_thread.feedback.NEGATIVE_CATEGORIES) (data): `NEGATIVE_CATEGORIES: frozenset[FeedbackCategory]`. Categories valid only on feedback with negative sentiment. `FeedbackCategory.OTHER` is in neither set.

- [POSITIVE_CATEGORIES](/docs/reference/python-sdk/roboto/ai/agent_thread/feedback#roboto.ai.agent_thread.feedback.POSITIVE_CATEGORIES) (data): `POSITIVE_CATEGORIES: frozenset[FeedbackCategory]`. Categories valid only on feedback with positive sentiment. `FeedbackCategory.OTHER` is in neither set.

- [PinThreadRequest](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.PinThreadRequest) (class): Request body for [`set_pinned()`](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread#roboto.ai.agent_thread.agent_thread.AgentThread.set_pinned).

- [RobotoAgentGoalsFailedException](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread#roboto.ai.agent_thread.agent_thread.RobotoAgentGoalsFailedException) (exception): The AI used up its retries for a turn without achieving every goal declared for it.

- [SendMessageRequest](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.SendMessageRequest) (class): Request body for [`send()`](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread#roboto.ai.agent_thread.agent_thread.AgentThread.send).

- [StartAgentThreadRequest](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.StartAgentThreadRequest) (class): Request body for [`start()`](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread#roboto.ai.agent_thread.agent_thread.AgentThread.start).

- [SubmitFeedbackRequest](/docs/reference/python-sdk/roboto/ai/agent_thread/feedback#roboto.ai.agent_thread.feedback.SubmitFeedbackRequest) (class): Request body for [`submit_feedback()`](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread#roboto.ai.agent_thread.agent_thread.AgentThread.submit_feedback).

- [SubmitToolResultsRequest](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.SubmitToolResultsRequest) (class): Request body for [`submit_client_tool_results()`](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread#roboto.ai.agent_thread.agent_thread.AgentThread.submit_client_tool_results).

- [ThreadOrigin](/docs/reference/python-sdk/roboto/ai/core/record#roboto.ai.core.record.ThreadOrigin) (class): Origin of a thread: the surface it was started from, which owns it.

- [ThreadVisibility](/docs/reference/python-sdk/roboto/ai/core/record#roboto.ai.core.record.ThreadVisibility) (class): Visibility of a thread: who can read it.

- [UpdateThreadVisibilityRequest](/docs/reference/python-sdk/roboto/ai/agent_thread/record#roboto.ai.agent_thread.record.UpdateThreadVisibilityRequest) (class): Request body for [`set_visibility()`](/docs/reference/python-sdk/roboto/ai/agent_thread/agent_thread#roboto.ai.agent_thread.agent_thread.AgentThread.set_visibility).

- [UserFeedbackRecord](/docs/reference/python-sdk/roboto/ai/agent_thread/feedback#roboto.ai.agent_thread.feedback.UserFeedbackRecord) (class): Data record of feedback on a message in a thread, as Roboto returns it to the user who submitted it.

- [category_is_valid_for_sentiment()](/docs/reference/python-sdk/roboto/ai/agent_thread/feedback#roboto.ai.agent_thread.feedback.category_is_valid_for_sentiment) (function): Return whether feedback with `sentiment` may carry `category`.

- [client_tool()](/docs/reference/python-sdk/roboto/ai/agent_thread/client_tool#roboto.ai.agent_thread.client_tool.client_tool) (function): Build a `ClientTool` from a function, as a decorator or a direct call.
