roboto.ai.goals.results
Typed, per-goal-type results bundling the achieve-tool invocation.
A GoalResult is the typed read shape an SDK caller gets back from AgentThreadGoalView.result once a goal has reached a terminal state (ACHIEVED or FAILED with at least one attempted invocation). It bundles together:
- The goal’s terminal
AgentGoalStatus. - The exact
AgentToolUseContentthe LLM submitted to satisfy the goal — useful when callers need to introspect the request or correlate with downstream effects. - The corresponding
AgentToolResultContent(when the runner observed one), so callers can see the response the LLM saw. - Per-goal-type typed fields parsed from
achieve_tool_use.inputvia the sharedroboto.ai.goals.achieve_inputsmodels, so callers getresult.summary,result.label_decisions,result.eventsdirectly instead of reaching into a raw dict.
The discriminated-union pattern mirrors AgentGoal exactly: each concrete subclass declares goal_type: Literal[GoalType.X] = GoalType.X and the union dispatches on that discriminator.
Validation lives in the SDK, not on the wire — the server emits achieve_tool_use_id (a pointer into the persisted message stream) and the SDK rebuilds the GoalResult from messages it already holds. A new goal type therefore needs no API change, only a new subclass here plus a corresponding entry in AgentGoal.
Module Contents
CreateEventsGoalResult
Bases: GoalResultBase, roboto.ai.goals.achieve_inputs.CreateEventsAchieveInput
Result of a GoalType.CREATE_EVENTS achieve-tool invocation.
Exposes the list of EventSpec objects the LLM submitted. The SDK does not currently surface the resulting event ids directly from this result — callers wanting the created events should query the dataset’s events using the time bounds in events. (Surfacing event ids here would require an API-layer round-trip back to the achieve-tool’s response payload; YAGNI until a caller needs it.)
Parameters
data AnyAttributes
CreateEventsGoalResult.goal_type
Discriminator. Always GoalType.CREATE_EVENTS.
DatasetSummaryGoalResult
Bases: GoalResultBase, roboto.ai.goals.achieve_inputs.DatasetSummaryAchieveInput
Result of a GoalType.DATASET_SUMMARY achieve-tool invocation.
Exposes the LLM-submitted summary directly alongside the raw achieve_tool_use / achieve_tool_result blocks.
Parameters
data AnyAttributes
DatasetSummaryGoalResult.goal_type
Discriminator. Always GoalType.DATASET_SUMMARY.
DatasetTriageGoalResult
Bases: GoalResultBase, roboto.ai.goals.achieve_inputs.DatasetTriageAchieveInput
Result of a GoalType.DATASET_TRIAGE achieve-tool invocation.
Exposes the full per-label deliberation in label_decisions; use applied_labels for the convenience subset that actually became tags on the dataset.
Parameters
data AnyProperties
DatasetTriageGoalResult.applied_labels
Labels for which the LLM voted applies=True.
Matches the set of tags the achieve-tool persisted on the dataset. Returned in declaration order, not the (sorted) order in which the achieve-tool writes them to the dataset; for stable ordering use sorted(result.applied_labels).
Attributes
DatasetTriageGoalResult.goal_type
Discriminator. Always GoalType.DATASET_TRIAGE.
GoalResult
Closed, Roboto-controlled discriminated union of every typed goal result.
Validated via pydantic discriminator on goal_type. Mirrors the shape of AgentGoal so adding a new goal type means:
- Add a new
GoalTypemember. - Add a new
AgentGoalsubclass inroboto.ai.goals.types. - Add a matching achieve-input model in
roboto.ai.goals.achieve_inputs. - Add a new
GoalResultsubclass here that inherits from bothGoalResultBaseand the new achieve-input model.
No API or wire-schema change is needed because the SDK builds the result from the persisted message stream via achieve_tool_use_id.
GoalResultBase
Bases: pydantic.BaseModel
Shared base for every concrete GoalResult.
Subclasses must declare a literal-typed goal_type field so the discriminated union can dispatch — and must also inherit from the matching achieve-input model from roboto.ai.goals.achieve_inputs so the parsed typed fields land alongside the raw blocks.
Parameters
data AnyAttributes
GoalResultBase.achieve_tool_result
The AgentToolResultContent the runner observed for the matching tool_use_id, if any. None when the runner persisted a tool_use but no corresponding tool_result reached the chunk log before the turn terminated.
GoalResultBase.achieve_tool_use
The AgentToolUseContent the LLM submitted. input carries the raw arguments; the parsed typed fields on the subclass are derived from it.
GoalResultBase.status
Terminal status of the goal: ACHIEVED or FAILED.