---
sidebar:
  hidden: true
title: roboto.ai.goals.types
---
## Module Contents

### AgentGoal

```python
roboto.ai.goals.types.AgentGoal
```

`from roboto.ai.goals import AgentGoal`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/goals/types.py#L390-L400)

Goal of any kind: an instance of one of the six goal classes.

The classes are `DatasetSummaryAgentGoal`, `DatasetTriageGoal`, `CreateEventsGoal`, `SessionSummaryAgentGoal`, `SessionTriageGoal` and `SessionCreateEventsGoal`.

Pydantic picks the class from `goal_type`. Only Roboto adds kinds of goal.

### AgentGoalBase

```python
class roboto.ai.goals.types.AgentGoalBase(/, **data: Any)
```

`from roboto.ai.goals.types import AgentGoalBase`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/goals/types.py#L64-L86)

Bases: `pydantic.BaseModel`

Base class of the goals in `AgentGoal`.

Roboto subclasses it to add a kind of goal; to declare a goal, build one of its subclasses. Defining a subclass without a `goal_type` field raises `TypeError`. `goal_type` counts as set even when left at its default, so `model_dump(exclude_unset=True)` keeps it and Roboto can tell which kind of goal a request declares.

**Parameters**

- **data** (`Any`)

### AgentGoalStatus

```python
class roboto.ai.goals.types.AgentGoalStatus
```

`from roboto.ai.agent_thread import AgentGoalStatus`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/goals/types.py#L45-L61)

Bases: `roboto.compat.StrEnum`

Status of a goal: whether Roboto's AI has achieved it.

A goal starts `PENDING` when it is declared and ends `ACHIEVED` or `FAILED` with its turn.

**Attributes**

- **AgentGoalStatus.ACHIEVED** = `'achieved'`: The AI made the change the goal asks for.

- **AgentGoalStatus.FAILED** = `'failed'`: The turn ended without the AI achieving the goal.

  Either the AI used up its retries for the turn, or Roboto could not process this kind of goal.

- **AgentGoalStatus.PENDING** = `'pending'`: Declared, and not yet achieved or failed.

### CreateEventsGoal

```python
class roboto.ai.goals.types.CreateEventsGoal(/, **data: Any)
```

`from roboto.ai.goals import CreateEventsGoal`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/goals/types.py#L224-L287)

Bases: [`AgentGoalBase`](/docs/reference/python-sdk/roboto/ai/goals/types#roboto.ai.goals.types.AgentGoalBase)

Goal that has Roboto's AI investigate a dataset and create events on it, of kinds the caller supplies.

Every event the AI creates is on the dataset `dataset_id` and no other, takes a key of `event_vocabulary` as its name, and carries only tags that are keys of `tag_vocabulary`. The descriptions in both vocabularies guide the AI's choice of time spans and tags. When `collection_id` is set, Roboto also adds every created event to that collection and no other.

Only an organization whose [`EventModel`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.EventModel) is [`Legacy`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.EventModel.Legacy) or `Dual` takes events on datasets. Declaring this goal on a dataset of any other organization raises `RobotoInvalidRequestException`; declare `SessionCreateEventsGoal` on a session instead.

Building the goal raises `pydantic.ValidationError` when:

- `event_vocabulary` is empty.
- Either vocabulary has more than 50 entries, a blank key, a key longer than 100 characters, or a description that is blank or longer than 500 characters.
- `event_focus_prompt` is empty or longer than 4000 characters.

**Parameters**

- **data** (`Any`)

**Attributes**

- **CreateEventsGoal.collection_id** (`str | None`) = `None`: ID of the collection to add every created event to.

  It must be a collection of events ([`Event`](/docs/reference/python-sdk/roboto/domain/collections/record#roboto.domain.collections.record.CollectionResourceType.Event)). `None` adds them to no collection.

- **CreateEventsGoal.dataset_id** (`str`): ID of the dataset to investigate and create events on.

- **CreateEventsGoal.event_focus_prompt** (`str | None`) = `None`: Further instructions for the AI on which events to create, from 1 to 4000 characters.

  For example, `"only flag intervals longer than five seconds"`. `None` leaves the vocabulary descriptions as the only guidance.

- **CreateEventsGoal.event_vocabulary** (`dict[str, str]`) = `None`: Names of the events the AI may create, each mapped to a description of what that kind of event marks.

  The AI reads the descriptions to decide which time spans qualify.

- **CreateEventsGoal.goal_type** (`Literal[GoalType]`): Kind of goal, always `GoalType.CREATE_EVENTS`.

- **CreateEventsGoal.tag_vocabulary** (`dict[str, str]`) = `None`: Tags the AI may put on the events it creates, each mapped to a description of when it applies.

  The AI picks any number of them for each event. Defaults to none, so created events carry no tags.

### DatasetSummaryAgentGoal

```python
class roboto.ai.goals.types.DatasetSummaryAgentGoal(/, **data: Any)
```

`from roboto.ai.goals import DatasetSummaryAgentGoal`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/goals/types.py#L93-L113)

Bases: [`AgentGoalBase`](/docs/reference/python-sdk/roboto/ai/goals/types#roboto.ai.goals.types.AgentGoalBase)

Goal that has Roboto's AI summarize a dataset.

The AI stores the summary on the dataset `dataset_id` and no other, where [`get_summary()`](/docs/reference/python-sdk/roboto/domain/datasets/dataset#roboto.domain.datasets.dataset.Dataset.get_summary) returns it. Building the goal raises `pydantic.ValidationError` when `summary_format_spec_prompt` is empty or longer than 4000 characters.

**Parameters**

- **data** (`Any`)

**Attributes**

- **DatasetSummaryAgentGoal.dataset_id** (`str`): ID of the dataset to summarize.

- **DatasetSummaryAgentGoal.goal_type** (`Literal[GoalType]`): Kind of goal, always `GoalType.DATASET_SUMMARY`.

- **DatasetSummaryAgentGoal.summary_format_spec_prompt** (`str | None`) = `None`: Instructions for the AI on how to structure the summary, from 1 to 4000 characters.

  Roboto does not check the summary against them. `None` uses Roboto's default structure.

### DatasetTriageGoal

```python
class roboto.ai.goals.types.DatasetTriageGoal(/, **data: Any)
```

`from roboto.ai.goals import DatasetTriageGoal`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/goals/types.py#L154-L183)

Bases: [`AgentGoalBase`](/docs/reference/python-sdk/roboto/ai/goals/types#roboto.ai.goals.types.AgentGoalBase)

Goal that has Roboto's AI tag a dataset with the labels from a vocabulary that apply to it.

The AI decides on every label in `label_vocabulary`, giving whether it applies, a justification and a confidence. Roboto adds the labels that apply, if any, to the tags of the dataset `dataset_id` and no other. The decisions are in the goal's [`DatasetTriageGoalResult`](/docs/reference/python-sdk/roboto/ai/goals/results#roboto.ai.goals.results.DatasetTriageGoalResult).

Building the goal raises `pydantic.ValidationError` when:

- `label_vocabulary` is empty or has more than 50 labels.
- A label has a character other than an ASCII letter, digit, underscore or hyphen.
- A label's description is blank or longer than 500 characters.

**Parameters**

- **data** (`Any`)

**Attributes**

- **DatasetTriageGoal.dataset_id** (`str`): ID of the dataset to tag.

- **DatasetTriageGoal.goal_type** (`Literal[GoalType]`): Kind of goal, always `GoalType.DATASET_TRIAGE`.

- **DatasetTriageGoal.label_vocabulary** (`dict[str, str]`) = `None`: Labels the AI chooses from, each mapped to a description of what it means.

  The AI reads each description to decide whether the label applies.

### GoalType

```python
class roboto.ai.goals.types.GoalType
```

`from roboto.ai.goals import GoalType`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/goals/types.py#L14-L42)

Bases: `roboto.compat.StrEnum`

Kind of goal: what Roboto's AI must produce.

Each member is the `goal_type` of one class in `AgentGoal`.

**Attributes**

- **GoalType.CREATE_EVENTS** = `'create_events'`: Events on a dataset, of kinds the caller supplies (`CreateEventsGoal`).

- **GoalType.DATASET_SUMMARY** = `'dataset_summary'`: Summary of a dataset (`DatasetSummaryAgentGoal`).

  Roboto stores it where [`get_summary()`](/docs/reference/python-sdk/roboto/domain/datasets/dataset#roboto.domain.datasets.dataset.Dataset.get_summary) returns it.

- **GoalType.DATASET_TRIAGE** = `'dataset_triage'`: Tags on a dataset, chosen from labels the caller supplies (`DatasetTriageGoal`).

- **GoalType.SESSION_CREATE_EVENTS** = `'session_create_events'`: Session events, of kinds the caller supplies (`SessionCreateEventsGoal`).

- **GoalType.SESSION_SUMMARY** = `'session_summary'`: Summary of a session (`SessionSummaryAgentGoal`).

  Roboto stores it where [`get_summary()`](/docs/reference/python-sdk/roboto/experimental/sessions/session#roboto.experimental.sessions.session.Session.get_summary) returns it.

- **GoalType.SESSION_TRIAGE** = `'session_triage'`: Tags on a session, chosen from labels the caller supplies (`SessionTriageGoal`).

### SessionCreateEventsGoal

```python
class roboto.ai.goals.types.SessionCreateEventsGoal(/, **data: Any)
```

`from roboto.ai.goals import SessionCreateEventsGoal`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/goals/types.py#L340-L387)

Bases: [`AgentGoalBase`](/docs/reference/python-sdk/roboto/ai/goals/types#roboto.ai.goals.types.AgentGoalBase)

Goal that has Roboto's AI investigate a session and create session events on it, of kinds the caller supplies.

The session counterpart of `CreateEventsGoal`, which states the rules both vocabularies and `event_focus_prompt` must follow; building this goal raises `pydantic.ValidationError` for the same values. Every event the AI creates is on the session `session_id` and no other, has an ID beginning with `evt_`, and is listed by [`list_events()`](/docs/reference/python-sdk/roboto/experimental/sessions/session#roboto.experimental.sessions.session.Session.list_events). Each event may name the topics of the session it concerns. Session events cannot be added to collections, so the goal has no `collection_id`.

Only an organization whose [`EventModel`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.EventModel) is `Dual`, `Migrating` or `Session` takes session events.

**Parameters**

- **data** (`Any`)

**Attributes**

- **SessionCreateEventsGoal.event_focus_prompt** (`str | None`) = `None`: Further instructions for the AI on which events to create, from 1 to 4000 characters.

  `None` leaves the vocabulary descriptions as the only guidance.

- **SessionCreateEventsGoal.event_vocabulary** (`dict[str, str]`) = `None`: Names of the events the AI may create, each mapped to a description of what that kind of event marks.

  The AI reads the descriptions to decide which time spans qualify.

- **SessionCreateEventsGoal.goal_type** (`Literal[GoalType]`): Kind of goal, always `GoalType.SESSION_CREATE_EVENTS`.

- **SessionCreateEventsGoal.session_id** (`str`): ID of the session to investigate and create events on.

- **SessionCreateEventsGoal.tag_vocabulary** (`dict[str, str]`) = `None`: Tags the AI may put on the events it creates, each mapped to a description of when it applies.

  The AI picks any number of them for each event. Defaults to none, so created events carry no tags.

### SessionSummaryAgentGoal

```python
class roboto.ai.goals.types.SessionSummaryAgentGoal(/, **data: Any)
```

`from roboto.ai.goals import SessionSummaryAgentGoal`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/goals/types.py#L290-L310)

Bases: [`AgentGoalBase`](/docs/reference/python-sdk/roboto/ai/goals/types#roboto.ai.goals.types.AgentGoalBase)

Goal that has Roboto's AI summarize a session.

The AI stores the summary on the session `session_id` and no other, where [`get_summary()`](/docs/reference/python-sdk/roboto/experimental/sessions/session#roboto.experimental.sessions.session.Session.get_summary) returns it. Building the goal raises `pydantic.ValidationError` when `summary_format_spec_prompt` is empty or longer than 4000 characters.

**Parameters**

- **data** (`Any`)

**Attributes**

- **SessionSummaryAgentGoal.goal_type** (`Literal[GoalType]`): Kind of goal, always `GoalType.SESSION_SUMMARY`.

- **SessionSummaryAgentGoal.session_id** (`str`): ID of the session to summarize.

- **SessionSummaryAgentGoal.summary_format_spec_prompt** (`str | None`) = `None`: Instructions for the AI on how to structure the summary, from 1 to 4000 characters.

  Roboto does not check the summary against them. `None` uses Roboto's default structure.

### SessionTriageGoal

```python
class roboto.ai.goals.types.SessionTriageGoal(/, **data: Any)
```

`from roboto.ai.goals import SessionTriageGoal`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/goals/types.py#L313-L337)

Bases: [`AgentGoalBase`](/docs/reference/python-sdk/roboto/ai/goals/types#roboto.ai.goals.types.AgentGoalBase)

Goal that has Roboto's AI tag a session with the labels from a vocabulary that apply to it.

The session counterpart of `DatasetTriageGoal`, which states the rules `label_vocabulary` must follow; building this goal raises `pydantic.ValidationError` for the same values. Roboto adds the labels that apply, if any, to the tags of the session `session_id` and no other. The decisions are in the goal's [`SessionTriageGoalResult`](/docs/reference/python-sdk/roboto/ai/goals/results#roboto.ai.goals.results.SessionTriageGoalResult).

**Parameters**

- **data** (`Any`)

**Attributes**

- **SessionTriageGoal.goal_type** (`Literal[GoalType]`): Kind of goal, always `GoalType.SESSION_TRIAGE`.

- **SessionTriageGoal.label_vocabulary** (`dict[str, str]`) = `None`: Labels the AI chooses from, each mapped to a description of what it means.

  The AI reads each description to decide whether the label applies.

- **SessionTriageGoal.session_id** (`str`): ID of the session to tag.
