TaskBudget

org.llm4s.agent.delegation.TaskBudget
See theTaskBudget companion object
@Experimental
final case class TaskBudget

A subagent's limits (design 4.45), each None unless set. When a task is called, each is capped by what its parent has left, from the parent's snapshot:

  • maxSteps: model calls in the child's turn; unset, the parent agent's maxSteps. Either way at most the parent turn's remaining steps (RunContext.remainingSteps).
  • timeout: the child's time, from its start; at most until the parent's deadline.
  • maxTokens: the child's input and output tokens; at most the parent's RunBudgets.maxTokens less what the parent's run has used.
  • maxConcurrency: the child's run's RunBudgets.maxConcurrency; at most the parent's.

Each limit is the child's whole life: a child recovered after a crash or a failed parent has its grant less what its earlier attempts used, and its time runs from its first start. Parallel children each get the same remainder, so together they can overshoot the parent's tokens; the parent's next model call then ends its turn TokenLimitReached. Every value set must be positive, which the parent's build() checks.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
def withMaxConcurrency(n: Option[Int]): TaskBudget
def withMaxSteps(n: Int): TaskBudget
def withMaxSteps(n: Option[Int]): TaskBudget
def withMaxTokens(n: Long): TaskBudget
def withMaxTokens(n: Option[Long]): TaskBudget
def withTimeout(t: FiniteDuration): TaskBudget
def withTimeout(t: Option[FiniteDuration]): TaskBudget

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product