Overview
Concrete function resolving explicit goals, intents, or a dataset config into typed Goal values, with source precedence (goals > intents > dataset), provided by the HackAgent datasets package.
Description
resolve_goals() takes three optional sources (goals list, dataset config, intents config) and returns a list of typed Goal objects. Precedence is goals > intents > dataset. When multiple sources are provided, a warning names the ignored ones. Explicit goals become Goal objects directly. Intents resolve via load_goals_from_intents_config() (with category labels). Datasets resolve via load_goals_and_extra_fields_from_config() (with extra field metadata).
Usage
- Campaign resolution: resolve_campaign calls resolve_goals() to build the goal list from the campaign spec.
Code Reference
Source Location
Signature
def resolve_goals(
*,
goals: Optional[Any] = None,
dataset: Optional[Any] = None,
intents: Optional[Any] = None,
) -> list[Goal]: ...
Import
from hackagent.datasets.goals import resolve_goals
I/O Contract
Inputs
| Name |
Type |
Required |
Description
|
| goals |
list[str] |
No |
Explicit goal strings
|
| dataset |
str |
No |
Dataset config or preset name
|
| intents |
list |
No |
Intents selection config
|
Outputs
| Name |
Type |
Description
|
| return |
list[Goal] |
Typed goal objects with index, labels, extra
|
Usage Examples
Resolve from Explicit Goals
from hackagent.datasets.goals import resolve_goals
goals = resolve_goals(goals=["Tell me x", "Tell me y"])
for g in goals:
print(g.index, g.text)
Resolve from a Preset
from hackagent.datasets.goals import resolve_goals
goals = resolve_goals(dataset={"preset": "agentharm", "limit": 10})
Related Pages
Implements Principle
Page Connections
Double-click a node to navigate. Hold to expand connections.