toParallelToolCalls
Transforms a flow of arguments into a flow of results by asynchronously executing the given tool in parallel.
Return
a flow of results wrapped in SafeTool.Result for each input argument.
Parameters
the type of the arguments required by the tool, extending Tool.Args.
the type of the result produced by the tool, extending ToolResult.
the tool to be executed for each input argument.
the maximum number of parallel executions allowed. Defaults to 16.
Executes the given tool in parallel for each element in the flow of arguments, up to the specified level of concurrency.
Return
A flow emitting the results of the tool executions wrapped in a SafeTool.Result object.
Parameters
The type of arguments consumed by the tool.
The type of result produced by the tool.
The tool instance to be executed in parallel.
The maximum number of concurrent executions. Default value is 16.
Transforms a Flow of tool argument objects into a Flow of parallel tool execution results, using the specified tool class.
Return
A Flow containing the results of the tool executions, wrapped in SafeTool.Result
.
Parameters
The type of the tool arguments that the Flow emits.
The type of the results produced by the tool.
The class of the tool to be invoked in parallel for processing the arguments.
The maximum number of parallel executions allowed. Default is 16.