roboto.ai.core.context#
Module Contents#
- class roboto.ai.core.context.AnalysisScope(/, **data)#
Bases:
pydantic.BaseModelThe slice of data an agent is expected to analyze.
An
AnalysisScopeis delivered to everyAgentToolinvocation on the server side. Individual tools opt in to honoring the scope as they are adopted; this SDK type carries the configuration, it does not itself enforce anything. Fields set toNoneare unconstrained on that dimension; anAnalysisScopewith every fieldNoneis equivalent to no scope at all.- Parameters:
data (Any)
- end_time: int | None = None#
Upper bound (inclusive) of the analysis window, expressed as nanoseconds since the Unix epoch.
- merge(override)#
Zipper-merge
overrideonto this scope, dimension by dimension.For each field, the
overridevalue wins when it is set (notNone); otherwise this scope’s value carries through. Used to reconcile an invoke-time scope (override) against an authored template scope (self): a launch can override individual dimensions while inheriting the rest.- Parameters:
override (AnalysisScope)
- Return type:
- start_time: int | None = None#
Lower bound (inclusive) of the analysis window, expressed as nanoseconds since the Unix epoch.
- class roboto.ai.core.context.ClientViewingContext(/, **data)#
Bases:
pydantic.BaseModelWhat the Roboto client (e.g. the Web UI) is currently viewing when the user composed a message.
Passed to the agent as implicit context for resolving deictic references — “this dataset”, “those files”, “the visualizer state I’m looking at” — that the user would otherwise have to spell out. This type is purely informational; it is not enforced and never gates tool authorization.
Distinct from:
AnalysisScope, which is a hard analysis window honored by individual tools on the server side.AgentGoal, which declares typed outcomes the agent runner must drive the turn to satisfy.
The corresponding wire-format field is
client_context(with a one-releasecontextalias for migration).- Parameters:
data (Any)
- collection_ids: list[str] = None#
IDs of collections the user is currently viewing or has selected.
- dataset_ids: list[str] = None#
IDs of datasets the user is currently viewing or has selected.
- device_ids: list[str] = None#
IDs of devices the user is currently viewing or has selected.
Device IDs are user-chosen rather than minted by Roboto, so unlike the other fields here a value may look like anything at all.
- display_time_anchor_label: str | None = None#
What the client shows the user as the name of that t=0 — “Start of workspace”, or a picked timestamp rendered as local time.
Informational, like every field here: it lets the agent name the instant an offset is counted from, rather than leaving the reader to guess.
Nonewheneverdisplay_time_anchor_nsisNone.
- display_time_anchor_ns: int | None = None#
Epoch nanoseconds the client renders as t=0, set only while the user is reading timestamps as an elapsed count from that instant, and
Noneotherwise.Informational, like every field here: it lets the agent resolve a bare relative time the user types (“around 65 s”) to an absolute instant, and the agent still reports absolute nanoseconds back.
- file_ids: list[str] = None#
IDs of files the user is currently viewing or has selected.
- misc_context: dict[str, Any] | None = None#
Miscellaneous client-supplied context that doesn’t fit the typed fields above. Use sparingly; prefer adding a typed field when a recurring shape emerges.
- table_state: dict[str, Any] | None = None#
The resource table on screen, when the user composed the message from one: its
target(datasets,files, …) and its livedefinition– the same shape a View stores: RoboQL text or filter controls, plus visible columns, sort, and page size.Sent whether or not a View is loaded, so the agent can describe ad-hoc filters and so “save what I’m looking at as a View” names something concrete. Informational, like every field here.
- view_ids: list[str] = None#
IDs of Views – saved, shareable searches over one resource type – applied to a resource table the user is looking at.
Informational, like every field here: it lets the agent resolve “this View” without the user naming it, and the agent still reads the View through its own tools.
- visualizer_state: dict[str, Any] | None = None#
State of the visualizer, when the user composed the message from the visualizer view. A relatively opaque JSON blob.