ToolExecutionConfig

org.llm4s.toolapi.ToolExecutionConfig
case class ToolExecutionConfig(timeout: Option[FiniteDuration], retryPolicy: Option[ToolRetryPolicy])

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. 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(
 timeout = Some(5.seconds),
 retryPolicy = Some(ToolRetryPolicy(maxAttempts = 3, baseDelay = 200.millis))
)
val registry = new ToolRegistry(Seq(myTool))
registry.execute(request, config)
registry.executeAll(requests, ToolExecutionStrategy.ParallelWithLimit(2), config)
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product