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#
- class roboto.ai.goals.results.CreateEventsGoalResult(/, **data)#
Bases:
GoalResultBase,roboto.ai.goals.achieve_inputs.CreateEventsAchieveInputResult of a
GoalType.CREATE_EVENTSachieve-tool invocation.Exposes the list of
EventSpecobjects 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 inevents. (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 (Any)
- goal_type: Literal[roboto.ai.goals.types.GoalType.CREATE_EVENTS]#
Discriminator. Always
GoalType.CREATE_EVENTS.
- class roboto.ai.goals.results.DatasetSummaryGoalResult(/, **data)#
Bases:
GoalResultBase,roboto.ai.goals.achieve_inputs.DatasetSummaryAchieveInputResult of a
GoalType.DATASET_SUMMARYachieve-tool invocation.Exposes the LLM-submitted
summarydirectly alongside the rawachieve_tool_use/achieve_tool_resultblocks.- Parameters:
data (Any)
- goal_type: Literal[roboto.ai.goals.types.GoalType.DATASET_SUMMARY]#
Discriminator. Always
GoalType.DATASET_SUMMARY.
- class roboto.ai.goals.results.DatasetTriageGoalResult(/, **data)#
Bases:
GoalResultBase,roboto.ai.goals.achieve_inputs.DatasetTriageAchieveInputResult of a
GoalType.DATASET_TRIAGEachieve-tool invocation.Exposes the full per-label deliberation in
label_decisions; useapplied_labelsfor the convenience subset that actually became tags on the dataset.- Parameters:
data (Any)
- property applied_labels: list[str]#
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).- Return type:
list[str]
- goal_type: Literal[roboto.ai.goals.types.GoalType.DATASET_TRIAGE]#
Discriminator. Always
GoalType.DATASET_TRIAGE.
- roboto.ai.goals.results.GoalResult#
Closed, Roboto-controlled discriminated union of every typed goal result.
Validated via pydantic discriminator on
goal_type. Mirrors the shape ofAgentGoalso 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.
- class roboto.ai.goals.results.GoalResultBase(/, **data)#
Bases:
pydantic.BaseModelShared base for every concrete
GoalResult.Subclasses must declare a literal-typed
goal_typefield so the discriminated union can dispatch — and must also inherit from the matching achieve-input model fromroboto.ai.goals.achieve_inputsso the parsed typed fields land alongside the raw blocks.- Parameters:
data (Any)
- achieve_tool_result: roboto.ai.core.content.AgentToolResultContent | None = None#
The
AgentToolResultContentthe runner observed for the matchingtool_use_id, if any.Nonewhen the runner persisted a tool_use but no corresponding tool_result reached the chunk log before the turn terminated.
- achieve_tool_use: roboto.ai.core.content.AgentToolUseContent#
The
AgentToolUseContentthe LLM submitted.inputcarries the raw arguments; the parsed typed fields on the subclass are derived from it.
- status: roboto.ai.goals.types.AgentGoalStatus#
ACHIEVEDorFAILED.- Type:
Terminal status of the goal