Package com.embabel.agent.core
Object EarlyTerminationPolicy.Companion
-
- All Implemented Interfaces:
public class EarlyTerminationPolicy.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static EarlyTerminationPolicy.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final static EarlyTerminationPolicymaxActions(Integer maxActions)Creates a policy that terminates the process after a maximum number of actions. final static EarlyTerminationPolicymaxTokens(Integer maxTokens)final static EarlyTerminationPolicyfirstOf(EarlyTerminationPolicy earlyTerminationPolicies)Combines multiple early termination policies into one. final static EarlyTerminationPolicyhardBudgetLimit(Double budget)Fallback budget limit for the agent process. -
-
Method Detail
-
maxActions
final static EarlyTerminationPolicy maxActions(Integer maxActions)
Creates a policy that terminates the process after a maximum number of actions.
- Parameters:
maxActions- The maximum number of actions allowed- Returns:
An EarlyTerminationPolicy that enforces the action limit
-
maxTokens
final static EarlyTerminationPolicy maxTokens(Integer maxTokens)
-
firstOf
final static EarlyTerminationPolicy firstOf(EarlyTerminationPolicy earlyTerminationPolicies)
Combines multiple early termination policies into one. The process will terminate if any of the provided policies triggers termination. Policies are evaluated in the order they are provided.
- Parameters:
earlyTerminationPolicies- The policies to combine- Returns:
A combined EarlyTerminationPolicy
-
hardBudgetLimit
final static EarlyTerminationPolicy hardBudgetLimit(Double budget)
Fallback budget limit for the agent process. This is a last resort termination policy to prevent runaway costs.
- Parameters:
budget- The maximum cost allowed for the process in dollars- Returns:
An EarlyTerminationPolicy that enforces the budget limit
-
-
-
-