Controls timeout and retry behaviour for tool calls executed through a ToolRegistry.
A default configuration applies no timeout and no retry, preserving the original single-attempt execution behaviour. Build one with ToolExecutionConfig.apply (or start from ToolExecutionConfig.default) and change it with the with* setters; the constructor and copy are private, so a new field never breaks callers. Pass a configuration to ToolRegistry.execute, ToolRegistry.executeAsync, or ToolRegistry.executeAll when a tool call should fail after a bounded duration or retry transient failures before returning an error.
Value parameters
- retryPolicy
-
optional retry policy for errors considered retryable by ToolCallError.isRetryable
- timeout
-
optional maximum duration to wait for each individual tool call before returning ToolCallError.Timeout
Attributes
- Example
-
import org.llm4s.toolapi._ import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.duration._ val config = ToolExecutionConfig.default .withTimeout(5.seconds) .withRetryPolicy(ToolRetryPolicy(maxAttempts = 3, baseDelay = 200.millis)) val registry = new ToolRegistry(Seq(myTool)) registry.execute(request, config) registry.executeAll(requests, ToolExecutionStrategy.ParallelWithLimit(2), config) - Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any