ToolExecutionStrategy

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

Strategy for executing multiple tool calls.

When an LLM requests multiple tool calls, they can be executed either sequentially (one at a time) or in parallel (simultaneously).

Attributes

Example
// Execute tools in parallel
agent.runWithStrategy(
 query = "Get weather in London, Paris, and Tokyo",
 tools = weatherTools,
 toolExecutionStrategy = ToolExecutionStrategy.Parallel
)
// Limit concurrency to 2 at a time
agent.runWithStrategy(
 query = "Search 10 different topics",
 tools = searchTools,
 toolExecutionStrategy = ToolExecutionStrategy.ParallelWithLimit(2)
)
Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Parallel
object Sequential
In this article