Mojentic.LLM.Tools.ParallelToolRunner (Mojentic v1.5.0)

Copy Markdown View Source

Execute tool calls concurrently using Task.async_stream/3.

max_concurrency defaults to 4 — high enough to win meaningfully on typical realtime turns (2–3 concurrent function calls), low enough that unbounded fan-out into rate-limited APIs doesn't punish users.

Output order matches input order even though execution is concurrent.

Summary

Functions

Variant that accepts an explicit runner struct so callers can override concurrency / timeout per batch.

Types

t()

@type t() :: %Mojentic.LLM.Tools.ParallelToolRunner{
  max_concurrency: pos_integer(),
  timeout: timeout()
}

Functions

new(opts \\ [])

run_with(runner, calls, tools, ctx \\ nil)

Variant that accepts an explicit runner struct so callers can override concurrency / timeout per batch.