ToolLoopConfiguration

data class ToolLoopConfiguration(val type: ToolLoopConfiguration.ToolLoopType = ToolLoopType.DEFAULT, val maxIterations: Int = 20, val parallel: ToolLoopConfiguration.ParallelModeProperties = ParallelModeProperties(), val toolNotFound: ToolLoopConfiguration.ToolNotFoundProperties = ToolNotFoundProperties())

Configuration for tool loop execution.

Externalized via properties:

embabel:
agent:
platform:
toolloop:
type: default # default | parallel
max-iterations: 20
tool-not-found:
max-retries: 3
min-fuzzy-length: 3
parallel:
per-tool-timeout: 30s
batch-timeout: 60s

Threading and context propagation

Parallel tool execution uses the com.embabel.agent.api.common.Asyncer bean, which is the single extension point for controlling threading behavior and propagating execution context (e.g., security context, MDC) to tool execution threads.

To customize threading, provide a custom Asyncer bean rather than using executor configuration properties.

See also

Constructors

Link copied to clipboard
constructor(type: ToolLoopConfiguration.ToolLoopType = ToolLoopType.DEFAULT, maxIterations: Int = 20, parallel: ToolLoopConfiguration.ParallelModeProperties = ParallelModeProperties(), toolNotFound: ToolLoopConfiguration.ToolNotFoundProperties = ToolNotFoundProperties())

Types

Link copied to clipboard

Type of executor for parallel tool execution.

Link copied to clipboard
data class ParallelModeProperties(val perToolTimeout: Duration = Duration.ofSeconds(30), val batchTimeout: Duration = Duration.ofSeconds(60), val executorType: ToolLoopConfiguration.ExecutorType = ExecutorType.VIRTUAL, val fixedPoolSize: Int = 10, val shutdownTimeout: Duration = Duration.ofSeconds(5))

Properties for parallel mode tool execution. Only applicable when type is ToolLoopType.PARALLEL.

Link copied to clipboard

Type of tool loop to use.

Link copied to clipboard
data class ToolNotFoundProperties(val maxRetries: Int = 3, val minFuzzyLength: Int = 3)

Properties for tool-not-found auto-correction behavior.

Properties

Link copied to clipboard
val maxIterations: Int = 20
Link copied to clipboard