Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.ai.agent_thread.record

Module Contents

AGENT_CONTENT_MODEL_BY_TYPE

roboto.ai.agent_thread.record.AGENT_CONTENT_MODEL_BY_TYPE: dict[AgentContentType, type[AgentContent]]#View Source

The model class for each JSON-serialized content type, keyed by discriminator.

Excludes AgentContentType.TEXT, whose payload is persisted as raw text rather than a serialized model. Every other member of AgentContent carries a content_type discriminator and round-trips through model_dump_json / model_validate_json; driving both serialization directions off this one map keeps them symmetric, so a member added to the union without a home here fails loudly instead of being silently dropped on write or reconstructed without its payload on read.

AgentClientContextEntry

class roboto.ai.agent_thread.record.AgentClientContextEntry(/, **data)#View Source

Bases: pydantic.BaseModel

The caller’s attached viewing context, carried on their own message.

Replaces a <ctx>{json}</ctx> marker persisted as a separate ROBOTO-role message. That shape made every consumer regex a JSON blob back out of prose it had serialized itself – four parsers across two languages – and relied on the ROBOTO role to keep the marker out of the chat view. It also put the context on a non-USER message, which the compression deletion pass collapses wholesale inside a resolved task’s interior, so the context silently disappeared from compressed history.

As a block on the user’s own message it is a typed field, invisible to text renderers (no text field), and safe from that collapse – USER turns are never dropped.

Parameters

data Any

Attributes

AgentClientContextEntry.content_type

content_type Literal[AgentContentType] #

AgentClientContextEntry.context

What the caller had open: attached datasets, files, and visualizer state.

AgentCompressionFillerContent

class roboto.ai.agent_thread.record.AgentCompressionFillerContent(/, **data)#View Source

Bases: pydantic.BaseModel

Filler standing in for a message the compression deletion pass emptied.

Carries no payload. A message reduced to nothing but tombstones keeps this single block instead of an empty content list, so it stays in the Bedrock payload at its original role and turn alternation survives without relocating content. The Bedrock boundary renders it as <Deleted in compression>. Produced only by the compression deletion pass and stored only at the DELETED tier; the verbatim original thread (what the SDK and UI render) never contains one.

Parameters

data Any

Attributes

AgentCompressionFillerContent.content_type

content_type Literal[AgentContentType] #

AgentContent

Type alias for all possible content types within agent messages.

AgentContentType

class roboto.ai.agent_thread.record.AgentContentType#View Source

Bases: roboto.compat.StrEnum

Enumeration of different types of content within agent messages.

Defines the various content types that can be included in agent messages.

Attributes

AgentContentType.CLIENT_CONTEXT

CLIENT_CONTEXT = 'client_context' #

What the caller was looking at when they composed the message this block sits on.

Superseded shape: the same payload used to be persisted as a whole ROBOTO-role message whose text was a <ctx>...</ctx> marker (ENG-2185). Readers still accept that form for threads written before this type existed; nothing emits it any more.

AgentContentType.COMPRESSION_FILLER

COMPRESSION_FILLER = 'compression_filler' #

Stand-in block kept in a message the deletion pass emptied entirely.

A message reduced to nothing but tombstones would break user/assistant alternation if it dropped from the payload. Replacing its content with this single filler keeps the message — and its role — in place. The model sees it as <Deleted in compression>. Only the cross-message deletion pass produces it, so it appears only inside a DELETED-tier compressed variant, never in the verbatim original thread the SDK and UI read.

AgentContentType.DELETED

DELETED = 'deleted' #

Tombstone marking a content block elided by compression.

Appears only inside a DELETED-tier compressed variant. Both producers — message-tier compression dropping a pure-filler text run, and the cross-message deletion pass dropping a whole tool exchange — store their output at the DELETED tier, so a message carrying one is always a DELETED-tier variant. Never in the verbatim original thread the SDK and UI read.

AgentContentType.ERROR

ERROR = 'error' #

Error information when message generation fails.

AgentContentType.TEXT

TEXT = 'text' #

Plain text content from users or AI responses.

AgentContentType.TOOL_RESULT

TOOL_RESULT = 'tool_result' #

Results returned from tool executions.

AgentContentType.TOOL_USE

TOOL_USE = 'tool_use' #

Tool invocation requests from the AI assistant.

AgentDeletedContent

class roboto.ai.agent_thread.record.AgentDeletedContent(/, **data)#View Source

Bases: pydantic.BaseModel

Tombstone for a content block removed by compression.

Carries no payload — its presence records that a block once occupied this slot, and it converts to None at the Bedrock boundary so the block drops from the LLM payload. Produced when compression drops a block — a pure-filler text run at message compression, or a whole redundant tool exchange in the cross-message deletion pass — and stored only at the DELETED tier, so a message carrying one is always a DELETED-tier variant. A message reduced to nothing but tombstones does not drop: it is replaced with a single AgentCompressionFillerContent so it keeps its role and turn. The verbatim original thread (what the SDK and UI render) never contains one.

Parameters

data Any

Attributes

AgentDeletedContent.content_type

content_type Literal[AgentContentType] #

AgentErrorContent

class roboto.ai.agent_thread.record.AgentErrorContent(/, **data)#View Source

Bases: pydantic.BaseModel

Error content within an agent message.

Used when message generation fails due to an error or is cancelled by the user.

Parameters

data Any

Attributes

AgentErrorContent.content_type

content_type Literal[AgentContentType] #

AgentErrorContent.error_code

error_code str | None = None #

Optional error code for programmatic handling.

AgentErrorContent.error_message

error_message str #

User-friendly error message describing what went wrong.

AgentGoalStatus

class roboto.ai.agent_thread.record.AgentGoalStatus#View Source

Bases: roboto.compat.StrEnum

Lifecycle of a per-turn declared goal.

Goals begin PENDING when registered. They transition to ACHIEVED when the corresponding achieve-tool reports success, or to FAILED when the runner’s corrective re-prompt budget for the turn is exhausted (or when the worker cannot construct an achieve-tool for the goal).

Attributes

AgentGoalStatus.ACHIEVED

ACHIEVED = 'achieved' #

Goal’s corresponding achieve-tool was invoked successfully.

AgentGoalStatus.FAILED

FAILED = 'failed' #

Goal could not be achieved within the turn’s retry budget.

AgentGoalStatus.PENDING

PENDING = 'pending' #

Goal has been registered but not yet completed.

AgentMessage

class roboto.ai.agent_thread.record.AgentMessage(/, **data)#View Source

Bases: pydantic.BaseModel

A single message within an agent thread.

Represents one message in the conversation, containing the sender role, content blocks, and generation status. Messages can contain multiple content blocks of different types (text, tool use, tool results).

Parameters

data Any

Attributes

AgentMessage.content

List of content blocks that make up this message.

AgentMessage.created

created datetime.datetime = None #

Timestamp when this message was created.

AgentMessage.is_complete()

is_complete()#View Source

Check if message generation is complete.

Returns

bool

True if the message status is COMPLETED, False otherwise.

AgentMessage.is_unsuccessful()

is_unsuccessful()#View Source

Check if message generation failed or was cancelled.

Returns

bool

True if the message status is FAILED or CANCELLED, False otherwise.

Attributes

AgentMessage.role

The role of the message sender (user, assistant, or roboto).

AgentMessage.status

Current generation status of this message.

AgentMessage.text()

classmethod text(text, role=AgentRole.USER)#View Source

Create a simple text message.

Convenience method for creating a message containing only text content.

Parameters

text str

The text content for the message.

The role of the message sender. Defaults to USER.

Returns

AgentMessage instance containing the text content.

AgentMessageStatus

class roboto.ai.agent_thread.record.AgentMessageStatus#View Source

Bases: roboto.compat.StrEnum

Enumeration of possible message generation states.

Tracks the lifecycle of message generation from initiation to completion.

Attributes

AgentMessageStatus.CANCELLED

CANCELLED = 'cancelled' #

Message generation was cancelled by the user.

AgentMessageStatus.COMPLETED

COMPLETED = 'completed' #

Message generation has finished and content is complete.

AgentMessageStatus.FAILED

FAILED = 'failed' #

Message generation failed due to an error.

AgentMessageStatus.GENERATING

GENERATING = 'generating' #

Message content is currently being generated.

AgentMessageStatus.NOT_STARTED

NOT_STARTED = 'not_started' #

Message has been queued but generation has not begun.

AgentMessageStatus.is_terminal()

is_terminal()#View Source

Check if the message generation is in a terminal state.

Returns

bool

True if the message is in a terminal state, False otherwise.

AgentRole

class roboto.ai.agent_thread.record.AgentRole#View Source

Bases: roboto.compat.StrEnum

Enumeration of possible roles in an agent thread.

Defines the different participants that can send messages in a thread.

Attributes

AgentRole.ASSISTANT

ASSISTANT = 'assistant' #

AI agent responding to user queries and requests.

AgentRole.ROBOTO

ROBOTO = 'roboto' #

Roboto system providing tool results and system information.

AgentRole.USER

USER = 'user' #

Human user sending messages to the agent.

AgentSubtask

class roboto.ai.agent_thread.record.AgentSubtask(/, **data)#View Source

Bases: pydantic.BaseModel

A lightweight checklist item under a top-level task.

Parameters

data Any

Attributes

AgentSubtask.status

Whether the sub-task is done.

AgentSubtask.title

title str #

Human-readable description of the sub-task.

AgentSubtaskStatus

class roboto.ai.agent_thread.record.AgentSubtaskStatus#View Source

Bases: roboto.compat.StrEnum

Lifecycle state of a sub-task.

Sub-tasks are never activated independently — they are implicitly active with their parent task — so they have no in_progress state.

Attributes

AgentSubtaskStatus.DONE

DONE = 'done' #

Completed.

AgentSubtaskStatus.PENDING

PENDING = 'pending' #

Not done yet.

AgentTask

class roboto.ai.agent_thread.record.AgentTask(/, **data)#View Source

Bases: pydantic.BaseModel

A top-level task the agent is tracking within a thread.

Parameters

data Any

Attributes

AgentTask.conclusion

conclusion str | None = None #

Outcome recorded when the task was completed. None until then.

AgentTask.description

description str | None = None #

Longer description delimiting the task’s scope and intent.

AgentTask.end

end AgentTaskBoundary | None = None #

Where the task was completed. None until then.

AgentTask.position

position int #

Display order among the thread’s top-level tasks.

AgentTask.start

start AgentTaskBoundary | None = None #

Where the task most recently became in_progress. None if never started.

AgentTask.status

Current lifecycle state.

AgentTask.subtasks

subtasks list[AgentSubtask] = None #

Ordered sub-tasks. A task cannot be completed until all of these are done.

AgentTask.task_id

task_id int #

Thread-monotonic id, stable for the life of the thread. The model references this id to start or complete the task.

AgentTask.title

title str #

Short title of the task.

AgentTaskBoundary

class roboto.ai.agent_thread.record.AgentTaskBoundary(/, **data)#View Source

Bases: pydantic.BaseModel

Position in the conversation where a top-level task’s active span begins or ends.

Identifies the assistant message and the content block within it whose tool call drove the transition, so callers can anchor a task to the part of the thread that worked on it.

Parameters

data Any

Attributes

AgentTaskBoundary.content_sequence_num

content_sequence_num int #

Index of the tool-call content block within that message.

AgentTaskBoundary.message_sequence_num

message_sequence_num int #

Index of the assistant message whose tool call stamped this boundary.

AgentTaskMinimal

class roboto.ai.agent_thread.record.AgentTaskMinimal(/, **data)#View Source

Bases: pydantic.BaseModel

Minimal acknowledgement returned by the task mutation tools.

The full list reaches the model through the per-turn injected context, so the mutation tools echo only the affected task’s id and resulting status.

Parameters

data Any

Attributes

AgentTaskMinimal.status

Resulting status of the affected task.

AgentTaskMinimal.task_id

task_id int #

Id of the affected task.

AgentTaskStatus

class roboto.ai.agent_thread.record.AgentTaskStatus#View Source

Bases: roboto.compat.StrEnum

Lifecycle state of a top-level agent task.

Attributes

AgentTaskStatus.COMPLETED

COMPLETED = 'completed' #

Finished; carries a AgentTask.conclusion.

AgentTaskStatus.IN_PROGRESS

IN_PROGRESS = 'in_progress' #

The single active task. At most one task per thread is in this state.

AgentTaskStatus.PENDING

PENDING = 'pending' #

Not started yet.

AgentTextContent

class roboto.ai.agent_thread.record.AgentTextContent(/, **data)#View Source

Bases: pydantic.BaseModel

Text content within an agent message.

Parameters

data Any

Attributes

AgentTextContent.text

text str #

The actual text content of the message.

AgentThreadDelta

class roboto.ai.agent_thread.record.AgentThreadDelta(/, **data)#View Source

Bases: pydantic.BaseModel

Incremental update to an agent thread.

Contains only the changes since the last synchronization, used for efficient real-time updates without transferring the entire thread history.

Parameters

data Any

Attributes

AgentThreadDelta.continuation_token

continuation_token str #

Updated token for the next incremental synchronization.

AgentThreadDelta.goals

goals list[AgentThreadGoalRecord] | None = None #

Latest snapshot of every goal declared in the thread, ordered by allocation. None means there has been no change since the previous delta — clients should retain the snapshot they already hold. An empty list means the thread has no declared goals. A non-empty list is the authoritative current snapshot and replaces any prior value.

AgentThreadDelta.messages_by_idx

messages_by_idx dict[int, AgentMessage] #

New or updated messages indexed by their position in the conversation.

AgentThreadDelta.reset_from_message_sequence_num

reset_from_message_sequence_num int | None = None #

Discard held messages from this index onward before applying this delta.

A delta’s messages normally extend what a client already holds, because the server sends only content the client has not seen. That breaks when a turn is abandoned partway and regenerated: the replacement message reuses the same index, so what the client holds at that index is text from an attempt that no longer exists, and appending to it would splice the real reply onto a discarded draft.

When this field is set, the client must truncate its held messages to indices strictly below it, then apply messages_by_idx and adopt continuation_token as usual — the server has rewound the stream to that point and will resend it. None (the common case) means append as normal.

AgentThreadDelta.status

status AgentThreadStatus | None = None #

Updated status of the agent thread.

AgentThreadDelta.tasks

tasks list[roboto.ai.core.task.AgentTask] | None = None #

Latest snapshot of the thread’s task list, ordered by position. None means no change since the previous delta — clients should retain the snapshot they already hold. An empty list means the thread has no tasks. A non-empty list is the authoritative current snapshot and replaces any prior value.

AgentThreadDelta.title

title str | None = None #

Updated title of the agent thread.

AgentThreadGoalRecord

class roboto.ai.agent_thread.record.AgentThreadGoalRecord(/, **data)#View Source

Bases: pydantic.BaseModel

Customer-visible read shape of a goal declared on an agent thread.

Parameters

data Any

Attributes

AgentThreadGoalRecord.achieve_tool_use_id

achieve_tool_use_id str | None = None #

tool_use_id of the achieve-tool invocation associated with this goal. Populated by the turn runner on every achieve-tool attempt, so its final value depends on the goal’s terminal status:

  • ACHIEVED: the tool_use_id of the successful invocation.
  • FAILED: the tool_use_id of the last attempted invocation, or None if the LLM never invoked the achieve-tool before the retry budget exhausted.
  • PENDING: None (or the most recent attempt so far).

Use with AgentThread.goals and the GoalResult accessor on the SDK wrapper to locate the exact AgentToolUseContent / AgentToolResultContent pair without scanning by tool name.

AgentThreadGoalRecord.concluded_at

concluded_at datetime.datetime | None = None #

Timestamp when the goal transitioned to a terminal state (ACHIEVED or FAILED). None while the goal is still PENDING.

AgentThreadGoalRecord.created

created datetime.datetime #

Timestamp when the goal was registered.

AgentThreadGoalRecord.goal_data

goal_data dict[str, Any] #

The validated goal payload as JSON. Use to_agent_goal() to recover the typed model the caller declared.

AgentThreadGoalRecord.goal_type

goal_type str #

Discriminator selecting which AgentGoal model the goal_data payload conforms to (e.g. "dataset_summary").

AgentThreadGoalRecord.message_sequence_num

message_sequence_num int #

Index in the thread’s full messages list of the AgentRole.USER message that declared this goal. Use to render goals adjacent to the turn they were attached to.

AgentThreadGoalRecord.status

Current lifecycle state of the goal.

AgentThreadGoalRecord.to_agent_goal()

to_agent_goal()#View Source

Re-hydrate goal_data into the typed AgentGoal the caller declared.

Returns

The validated, discriminated AgentGoal instance — for "dataset_summary" rows, a DatasetSummaryAgentGoal; for "dataset_triage" rows, a DatasetTriageGoal; etc.

AgentThreadRecord

class roboto.ai.agent_thread.record.AgentThreadRecord(/, **data)#View Source

Bases: pydantic.BaseModel

Complete record of an agent thread.

Contains all the persistent data for a thread including metadata, message history, and synchronization state.

Parameters

data Any

Attributes

AgentThreadRecord.continuation_token

continuation_token str #

Token used for incremental updates and synchronization.

AgentThreadRecord.created

created datetime.datetime #

Timestamp when this agent thread was created.

AgentThreadRecord.created_by

created_by str #

User ID of the person who created this agent thread.

AgentThreadRecord.created_by_principal

created_by_principal str | None = None #

Serialized RobotoPrincipal ("ptype:id") that started this thread, e.g. "user:jo@example.com" or "invocation:iv_123". Unlike created_by, this preserves whether the thread was driven by a person, a device, or an action invocation. None on threads created before this field existed.

AgentThreadRecord.created_from_agent_id

created_from_agent_id str | None = None #

If this thread was started via the agent launch flow, the id of the agent that produced it. None for threads started directly through POST /v1/ai/threads. Forks do not inherit this field — a fork is its own thread.

AgentThreadRecord.created_from_trigger_id

created_from_trigger_id str | None = None #

If a trigger’s start_agent target launched this thread, the id of that trigger. None for every other thread, including one launched from the same agent by a person. Set alongside created_from_agent_id, which names the agent; this names what decided to run it. Forks do not inherit this field — a fork is its own thread.

AgentThreadRecord.forked_from_message_sequence_num

forked_from_message_sequence_num int | None = None #

Message sequence number in the source thread that this fork was taken from.

Populated in tandem with forked_from_thread_id; both are None for threads that were not created as a fork.

AgentThreadRecord.forked_from_thread_id

forked_from_thread_id str | None = None #

If this thread was forked, the id of the source thread. None otherwise.

Deserialization also accepts the legacy forked_from_session_id spelling for backward compatibility.

AgentThreadRecord.goals

goals list[AgentThreadGoalRecord] | None = None #

Goals declared across this thread’s turns, ordered by the turn that declared them. None means goals were not loaded for this record; an empty list means they were loaded but the thread never declared any.

AgentThreadRecord.messages

messages list[AgentMessage] = None #

Complete list of messages in the conversation.

AgentThreadRecord.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

AgentThreadRecord.model_profile

model_profile str | None = None #

Model profile used for this agent thread (e.g., ‘standard’, ‘advanced’).

AgentThreadRecord.org_id

org_id str #

Organization ID that owns this agent thread.

AgentThreadRecord.origin

origin ThreadOrigin | None = None #

The surface that owns this thread.

Set by Roboto when the thread is created; it cannot be supplied by a caller. A thread owned by a surface outside Roboto refuses new messages over the API, raising RobotoThreadReadOnlyException; reading, cancelling, and rating it stay open, and a fork does not inherit the origin, so the copy is writable.

None on threads created before this field existed, and equivalent to ThreadOrigin.API — every surface that predates the field was Roboto’s own. It stays nullable until those rows are backfilled.

AgentThreadRecord.pinned_at

pinned_at datetime.datetime | None = None #

When the calling user pinned this thread, or None if they have not.

A pin is a personal bookmark, so two users reading the same thread see different values here. Pin and unpin through roboto.ai.agent_thread.AgentThread.set_pinned(). Only GET /v1/ai/threads and POST /v1/ai/threads/search report it; reads of a single thread leave it None whatever the pin state.

AgentThreadRecord.status

Current status of this agent thread.

AgentThreadRecord.tasks

tasks list[roboto.ai.core.task.AgentTask] | None = None #

The thread’s task list, ordered by AgentTask.position. None means tasks were not loaded for this record; an empty list means they were loaded but the thread has none.

AgentThreadRecord.thread_id

thread_id str = None #

Unique identifier for this agent thread.

Deserialization also accepts the legacy session_id and chat_id spellings for backward compatibility; the canonical attribute name is thread_id.

AgentThreadRecord.title

title str | None = None #

Title of this agent thread.

AgentThreadRecord.visibility

visibility ThreadVisibility #

Who can read this thread. PRIVATE (the default) restricts reads to the created_by user and Roboto admins; ORG opens the thread to every member of org_id.

AgentThreadStatus

class roboto.ai.agent_thread.record.AgentThreadStatus#View Source

Bases: roboto.compat.StrEnum

Enumeration of possible agent thread states.

Tracks the overall status of an agent thread from creation to termination.

Attributes

AgentThreadStatus.CLIENT_TOOL_TURN

CLIENT_TOOL_TURN = 'client_tool_turn' #

Client must execute pending tool uses and submit results.

AgentThreadStatus.GOALS_FAILED

GOALS_FAILED = 'goals_failed' #

The agent runner exhausted its corrective re-prompt budget without achieving every declared goal for the most-recent turn. Signals to clients that the thread needs human intervention before it can continue.

AgentThreadStatus.NOT_STARTED

NOT_STARTED = 'not_started' #

Thread has been created but no messages have been sent.

AgentThreadStatus.ROBOTO_TURN

ROBOTO_TURN = 'roboto_turn' #

Roboto is generating a message.

AgentThreadStatus.USER_TURN

USER_TURN = 'user_turn' #

User has the turn to send a message.

AgentThreadSubject

class roboto.ai.agent_thread.record.AgentThreadSubject(/, **data)#View Source

Bases: pydantic.BaseModel

Canonical record of an entity an AgentThread applies to.

Used to answer “which agent threads are about this dataset / file?” — the dataset detail page’s Agent Threads tab is one consumer; future surfaces that want to discover threads by entity will use the same record.

Parameters

data Any

Attributes

AgentThreadSubject.association_id

association_id str #

Identifier of the entity the thread applies to — e.g. a dataset id or file id.

AgentThreadSubject.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

AgentThreadSubject.note

note str #

Short, free-form explanation of how the subject came to be attached (e.g. why this thread applies to that entity).

AgentToolDetailResponse

class roboto.ai.agent_thread.record.AgentToolDetailResponse(/, **data)#View Source

Bases: pydantic.BaseModel

Unsanitized tool request and response details for an agent tool invocation.

Parameters

data Any

Attributes

AgentToolDetailResponse.tool_result

AgentToolDetailResponse.tool_use

AgentToolResultContent

class roboto.ai.agent_thread.record.AgentToolResultContent(/, **data)#View Source

Bases: pydantic.BaseModel

Tool execution result content within an agent message.

Parameters

data Any

Attributes

AgentToolResultContent.content_type

content_type Literal[AgentContentType] #

AgentToolResultContent.payload

payload str | dict[str, Any] | list[Any] | None = None #

What the tool returned: free-form text, or a JSON object or array of structured data.

Independent of any model provider’s wire format (provider-agnostic, like AgentToolUseContent.input). None on results written before this field existed; use resolve_payload() to read old and new results uniformly.

AgentToolResultContent.raw_response

raw_response dict[str, Any] | None = None #

Legacy provider-formatted response envelope (Bedrock toolResult shape).

Kept so results written before payload existed remain readable; deprecated for new readers, who should call resolve_payload() instead of parsing this field.

Populated only where the server-side envelope is in scope: threads read over the API arrive with this field stripped (and, for legacy rows, with payload synthesized from it server-side before the strip), so API/SDK readers should not expect it.

AgentToolResultContent.resolve_payload()

resolve_payload()#View Source

Return what the tool returned, whichever field carries it.

Prefers payload. Results written before that field existed carry only the legacy envelope, from which the equivalent value is reconstructed via synthesize_tool_result_payload().

Returns

Optional[Union[str, dict[str, Any], list[Any]]]

The tool’s text or JSON output, or None when neither field carries a recognizable value.

Attributes

AgentToolResultContent.runtime_ms

runtime_ms int #

Wall-clock execution time of the tool in milliseconds.

AgentToolResultContent.status

status str #

Outcome of the tool execution (e.g. ‘success’, ‘error’).

AgentToolResultContent.tool_name

tool_name str #

Name of the tool that was executed.

AgentToolResultContent.tool_use_id

tool_use_id str #

Identifier of the tool invocation this result corresponds to.

AgentToolUseContent

class roboto.ai.agent_thread.record.AgentToolUseContent(/, **data)#View Source

Bases: pydantic.BaseModel

Tool usage request content within an agent message.

Parameters

data Any

Attributes

AgentToolUseContent.content_type

content_type Literal[AgentContentType] #

AgentToolUseContent.input

input dict[str, Any] | None = None #

Parsed tool input parameters chosen by the LLM (provider-agnostic).

AgentToolUseContent.raw_request

raw_request dict[str, Any] | None = None #

Raw, unparsed request payload for this tool invocation.

AgentToolUseContent.tool_name

tool_name str #

Name of the tool the LLM is requesting to invoke.

AgentToolUseContent.tool_use_id

tool_use_id str #

Unique identifier for this tool invocation, used to correlate with its result.

AvailableSkillSpec

class roboto.ai.agent_thread.record.AvailableSkillSpec(/, **data)#View Source

Bases: pydantic.BaseModel

One entry in a thread’s explicit AI-invokable skill set.

Embedded in StartAgentThreadRequest.available_skills. Unlike InvokeSkillSpec — which seeds a skill into the opening transcript as a turn trigger — this struct only declares that a skill version is available for the AI to auto-invoke via its load_skill tool during the thread. The route layer resolves access (org visibility, private gating) and version selection; this struct only carries the caller’s choice.

Defined locally to avoid the roboto.ai <-> roboto.domain.skills import cycle.

Parameters

data Any

Attributes

AvailableSkillSpec.skill_id

skill_id str #

Target skill’s ID. Must be visible to the caller — an org-shared skill, or the caller’s own private skill. A subscription is not required; the per-thread set bypasses subscription state entirely.

AvailableSkillSpec.version

version int | None = None #

Optional. If omitted, resolves to the skill’s latest (MAX(version)) row.

Pins the exact version exposed to the AI for this thread. Subscriptions and their per-user ai_version pins are ignored when a thread carries an explicit available_skills set.

ClientToolResult

class roboto.ai.agent_thread.record.ClientToolResult(/, **data)#View Source

Bases: pydantic.BaseModel

Result of executing a client-side tool.

Parameters

data Any

Attributes

ClientToolResult.output

output dict[str, Any] | None = None #

Structured output returned by the tool.

ClientToolResult.runtime_ms

runtime_ms int #

Wall-clock execution time of the tool in milliseconds.

ClientToolResult.status

Outcome of the tool execution.

ClientToolResult.tool_name

tool_name str #

Name of the tool that was executed.

ClientToolResult.tool_use_id

tool_use_id str #

Identifier of the tool invocation this result corresponds to.

ClientToolResultStatus

class roboto.ai.agent_thread.record.ClientToolResultStatus#View Source

Bases: roboto.compat.StrEnum

Outcome of executing a client-side tool.

Attributes

ClientToolResultStatus.DECLINED

DECLINED = 'declined' #

ClientToolResultStatus.ERROR

ERROR = 'error' #

ClientToolResultStatus.SUCCESS

SUCCESS = 'success' #

ClientToolSpec

class roboto.ai.agent_thread.record.ClientToolSpec(/, **data)#View Source

Bases: pydantic.BaseModel

Declarative specification for a client-side tool.

Unlike AgentTool (which is an ABC with a __call__ method for server-side execution), ClientToolSpec is a plain data model. The backend includes it in the LLM’s tool list but never executes it — the client is responsible for execution and submitting the result.

Parameters

data Any

Attributes

ClientToolSpec.description

description str #

ClientToolSpec.input_schema

input_schema dict[str, Any] #

ClientToolSpec.name

name str #

ForkAgentThreadRequest

class roboto.ai.agent_thread.record.ForkAgentThreadRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload for forking an agent thread at a specific message.

Parameters

data Any

Attributes

ForkAgentThreadRequest.message_sequence_num

message_sequence_num int #

Highest message sequence number (inclusive) to copy into the new thread.

InvokeSkillSpec

class roboto.ai.agent_thread.record.InvokeSkillSpec(/, **data)#View Source

Bases: pydantic.BaseModel

Spec for invoking a skill as part of a turn trigger.

Embedded in SendMessageRequest and StartAgentThreadRequest. The route layer resolves access (org visibility, private gating) and version selection; this struct only carries the caller’s choice.

Defined locally to avoid the roboto.ai ↔ roboto.domain.skills import cycle.

Parameters

data Any

Attributes

InvokeSkillSpec.skill_id

skill_id str #

Target skill’s ID. Must be visible to the caller (own private skill or an org-shared skill); the route layer rejects unauthorized invocations before the spec reaches the service.

InvokeSkillSpec.version

version int | None = None #

Optional. If omitted, resolves to the skill’s latest (MAX(version)) row.

Note this is the structural latest, not the caller’s pinned ai_version: a manually-invoked chip runs MAX(version) regardless of what the caller’s AI auto-invoke is pinned to. Use Skill.set_ai_version() to control the pin separately.

PinThreadRequest

class roboto.ai.agent_thread.record.PinThreadRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request body for POST /v1/ai/threads/<thread_id>/pin, which pins or unpins a thread for the caller.

Parameters

data Any

Attributes

PinThreadRequest.pinned

pinned bool #

Pin state the thread should have for the calling user after the call.

SendMessageRequest

class roboto.ai.agent_thread.record.SendMessageRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload for sending a message to an agent thread.

Contains the message content and optional context for the AI assistant.

Parameters

data Any

Attributes

SendMessageRequest.analysis_scope

analysis_scope roboto.ai.core.AnalysisScope | None = None #

Optional replacement analysis scope. When provided, overwrites the thread’s current analysis scope; the new scope takes effect for this turn’s tool invocations and every turn thereafter. When None, the thread’s existing analysis scope is left untouched (there is currently no wire-format way to clear a scope via send).

SendMessageRequest.client_context

client_context roboto.ai.core.ClientViewingContext | None = None #

Optional ClientViewingContext describing what the client was viewing when this message was composed. Wire field is client_context; the legacy context alias is accepted during the migration window and will be dropped in a future release.

SendMessageRequest.client_tools

client_tools list[roboto.ai.core.record.ClientToolSpec] | None = None #

Optional client-side tools available for this invocation.

SendMessageRequest.goals

goals list[roboto.ai.goals.AgentGoal] | None = None #

Goals declared for this turn. The agent runner enforces achievement: it gates a per-turn achieve-tool against each goal and re-prompts until every goal is satisfied or a per-turn retry budget is exhausted. May be omitted; when present, message becomes optional. Capped at MAX_GOALS_PER_TURN entries (see the constant for rationale).

SendMessageRequest.invoke_skills

invoke_skills list[InvokeSkillSpec] = None #

Skills to invoke as part of this turn, in order. The server fabricates one LoadSkillTool tool_use + tool_result pair per entry and appends them to the transcript after message (if any). When message is empty and no goals are declared, the fabricated pairs become the turn trigger themselves — useful for chip-only invocations that don’t carry a typed prompt. Pass a single-element list for the common “invoke one skill” case.

SendMessageRequest.message

Message content to send. May be omitted when at least one goal is declared in goals; in that case the server synthesizes a minimal user message so the LLM has a turn-initiating prompt.

StartAgentThreadRequest

class roboto.ai.agent_thread.record.StartAgentThreadRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload for starting a new agent thread.

Contains the initial messages and configuration for creating a new conversation.

Parameters

data Any

Attributes

StartAgentThreadRequest.analysis_scope

analysis_scope roboto.ai.core.AnalysisScope | None = None #

Optional analysis scope for the thread. Delivered to every tool invocation on the server side; individual tools opt in to honoring it. None means no scope.

StartAgentThreadRequest.available_skills

available_skills list[AvailableSkillSpec] | None = None #

Explicit set of skills the AI may auto-invoke during this thread, replacing the subscription-derived load_skill registry.

Tri-state:

  • None (the default) — the AI’s load_skill registry is derived per turn from the caller’s skill subscriptions, as usual.
  • [] — the AI has no auto-invokable skills for this thread.
  • a non-empty list — exactly these skill versions are auto-invokable; the caller’s subscriptions and per-user ai_version pins are ignored.

Each entry may reference any org-shared skill or the caller’s own private skill (visibility only — no subscription required), at any version. One version per skill: duplicate skill_id entries are rejected. Resolved once at thread start and frozen onto the thread; later subscription changes and skill-body edits do not propagate into it. Capped at MAX_AVAILABLE_SKILLS entries.

Distinct from invoke_skills: available_skills configures what the AI can reach for, while invoke_skills seeds skill bodies into the opening transcript as a turn trigger. It is configuration, not a trigger — a request carrying only available_skills and no messages / goals / invoke_skills is still rejected.

StartAgentThreadRequest.client_context

client_context roboto.ai.core.ClientViewingContext | None = None #

Optional ClientViewingContext describing what the client was viewing when this thread was started. Wire field is client_context; the legacy context alias is accepted during the migration window and will be dropped in a future release.

StartAgentThreadRequest.client_tools

client_tools list[roboto.ai.core.record.ClientToolSpec] | None = None #

Optional client-side tools available for this invocation.

StartAgentThreadRequest.goals

goals list[roboto.ai.goals.AgentGoal] | None = None #

Goals declared for the first turn. The agent runner enforces achievement: it gates a per-turn achieve-tool against each goal and re-prompts until every goal is satisfied or a per-turn retry budget is exhausted. May be omitted; when present, messages may be empty. Capped at MAX_GOALS_PER_TURN entries (see the constant for rationale).

StartAgentThreadRequest.invoke_skills

invoke_skills list[InvokeSkillSpec] = None #

Skills to invoke at thread start, in order. The server fabricates one LoadSkillTool tool_use + tool_result pair per entry and appends them to the transcript after any seeded messages. When messages is empty and no goals are declared, the fabricated pairs become the thread seed. Pass a single-element list for the common “invoke one skill” case.

StartAgentThreadRequest.messages

Initial messages to start the conversation with. May be empty when at least one goal is declared in goals; in that case the server synthesizes a minimal user message so the LLM has a turn-initiating prompt.

StartAgentThreadRequest.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

StartAgentThreadRequest.model_profile

model_profile str | None = None #

Optional model profile ID for the thread (e.g. ‘standard’, ‘advanced’).

StartAgentThreadRequest.system_prompt

system_prompt str | None = None #

Optional system prompt to customize AI assistant behavior.

StartAgentThreadRequest.visibility

Who may read the resulting thread after it is created. PRIVATE (the default) restricts reads to the creator and Roboto admins; ORG lets any member of the thread’s org read it and makes the thread visible to org members on POST /v1/ai/threads/search. The default is PRIVATE so that a thread started via POST /v1/ai/threads does not leak to the rest of the org until the caller opts in; threads created through the agent launch flow default to ORG instead, since agents exist to share workflows across teammates.

SubmitToolResultsRequest

class roboto.ai.agent_thread.record.SubmitToolResultsRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload for submitting client-side tool execution results.

Parameters

data Any

Attributes

SubmitToolResultsRequest.client_tools

client_tools list[roboto.ai.core.record.ClientToolSpec] | None = None #

Optional updated client-side tools for the next invocation.

SubmitToolResultsRequest.tool_results

tool_results list[ClientToolResult] #

Tool results from client-side execution.

ThreadOrigin

class roboto.ai.agent_thread.record.ThreadOrigin#View Source

Bases: roboto.compat.StrEnum

The surface an AgentThreadRecord was started from, and the one that owns it.

Distinct from AgentThreadRecord.created_by_principal, which records who started a thread. This records where the conversation lives, which is what decides whether it can be added to over the API.

Import as roboto.ai.agent_thread.ThreadOrigin.

Attributes

ThreadOrigin.API

API = 'api' #

Started through Roboto itself – the web app, the CLI, the SDK, or a direct REST call.

These surfaces read the thread back from Roboto rather than mirroring it somewhere else, so there is nothing for a new turn to fall out of sync with and the thread stays writable.

ThreadOrigin.SLACK

SLACK = 'slack' #

Started by mentioning @Roboto in Slack, and mirrored into that Slack conversation.

ThreadVisibility

class roboto.ai.agent_thread.record.ThreadVisibility#View Source

Bases: roboto.compat.StrEnum

Read-scope for an AgentThreadRecord.

Set when the thread is created, and changed afterwards only by the thread’s creator, via roboto.ai.agent_thread.AgentThread.set_visibility() (POST /v1/ai/threads/<thread_id>/visibility). Roboto admins read every thread but cannot re-scope one they did not create.

Import as roboto.ai.agent_thread.ThreadVisibility.

Attributes

ThreadVisibility.ORG

ORG = 'org' #

Any member of the thread’s organization (and Roboto admins) may read the thread.

Default for threads produced by the agent launch flow, since agents exist to share workflows across teammates. Forks of an ORG thread do not inherit visibility — every fork lands as PRIVATE.

ThreadVisibility.PRIVATE

PRIVATE = 'private' #

Only the creating user (and Roboto admins) may read the thread.

Default for threads created via POST /v1/ai/threads so an in-flight experiment does not leak to the rest of the org until the caller opts in.

UpdateThreadVisibilityRequest

class roboto.ai.agent_thread.record.UpdateThreadVisibilityRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload for re-scoping who may read an agent thread.

Sent to POST /v1/ai/threads/<thread_id>/visibility by roboto.ai.agent_thread.AgentThread.set_visibility().

Parameters

data Any

Attributes

UpdateThreadVisibilityRequest.visibility

Read-scope the thread has once the call returns.

Was this page helpful?