ToolExecutionStrategy

org.llm4s.toolapi.ToolExecutionStrategy
See theToolExecutionStrategy companion object
sealed trait ToolExecutionStrategy

Determines how multiple tool calls in a single agent step are executed by ToolRegistry.executeAll.

Choose ToolExecutionStrategy.Sequential when calls depend on one another or mutate shared state. Choose ToolExecutionStrategy.Parallel when calls are independent and mostly wait on I/O. Choose ToolExecutionStrategy.ParallelWithLimit when calls can run concurrently but external systems or local resources need bounded concurrency.

Attributes

Example
val results = registry.executeAll(
 requests,
 strategy = ToolExecutionStrategy.ParallelWithLimit(2)
)
val agentState = agent.runWithStrategy(
 query = "Get weather in London, Paris, and Tokyo",
 tools = registry,
 toolExecutionStrategy = ToolExecutionStrategy.Parallel,
 maxSteps = Some(5)
)
Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Parallel
object Sequential
In this article