Goal

data class Goal(val name: String, val description: String, val pre: Set<String> = emptySet(), val inputs: Set<IoBinding> = emptySet(), val outputClass: Class<*>?, val value: <Error class: unknown class> = 0.0, val tags: Set<String> = emptySet(), val examples: Set<String> = emptySet(), val export: Export = Export()) : GoapGoal, AgentSystemStep

Agent platform goal. Exposes GOAP metadata.

Parameters

name

name of the goal

description

description of the goal. This should be sufficiently detailed to enable goal choice by an LLM. The goal description may also be exposed to MCP clients as a hint for the goal's purpose, so ensure that it is clear and unambiguous.

pre

preconditions for the goal, as a set of strings. These are the conditions that must be true before the goal can be achieved.

inputs

inputs required for the goal, as a set of IoBinding objects. These are the inputs that must be provided to achieve the goal.

outputClass

if this goal returns a single instance of a Java class, this is the class that will be returned.

value

value of the goal, as a ZeroToOne. This is the value of achieving the goal.

tags

Set of tags describing classes or capabilities for this specific skill. example: "cooking", "customer support", "billing"

examples

The set of example scenarios that the skill can perform. Will be used by the client as a hint to understand how the skill can be used. example: "I need a recipe for bread"

Constructors

Link copied to clipboard
constructor(name: String, description: String, pre: Set<String> = emptySet(), inputs: Set<IoBinding> = emptySet(), outputClass: Class<*>?, value: <Error class: unknown class> = 0.0, tags: Set<String> = emptySet(), examples: Set<String> = emptySet(), export: Export = Export())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val inputs: Set<IoBinding>
Link copied to clipboard
open override val knownConditions: Set<String>

The names of all conditions that are referenced by this step

Link copied to clipboard
open override val name: String
Link copied to clipboard
Link copied to clipboard
val pre: Set<String>
Link copied to clipboard
open override val preconditions: EffectSpec

Conditions that must be true for this step to execute

Link copied to clipboard
Link copied to clipboard
open override val value: <Error class: unknown class> = 0.0

Functions

Link copied to clipboard
open override fun infoString(verbose: Boolean?, indent: Int): String
Link copied to clipboard
open fun isAchievable(currentState: GoapWorldState): Boolean

Whether the step is available in the current world state

Link copied to clipboard
fun withGoalPreconditions(vararg goals: Goal): Goal
Link copied to clipboard
fun withPreconditions(vararg preconditions: String): Goal
Link copied to clipboard
fun withValue(value: Double): Goal

Create a goal with the given value.