executeMultipleTools

expect open suspend override fun executeMultipleTools(toolCalls: List<Message.Tool.Call>, parallelTools: Boolean): List<ReceivedToolResult>(source)

Executes multiple tool calls and returns their results. These calls can optionally be executed in parallel.

Return

A list of results from the executed tool calls.

Parameters

toolCalls

The list of tool calls to execute.

parallelTools

Specifies whether tools should be executed in parallel, defaults to false.

fun executeMultipleTools(toolCalls: List<Message.Tool.Call>, parallelTools: Boolean, executorService: ERROR CLASS: Symbol not found for ExecutorService?? = null): List<ReceivedToolResult>(source)

Executes multiple tool calls either sequentially or in parallel based on the provided configurations.

Return

a list of results obtained from executing the provided tool calls

Parameters

toolCalls

a list of tool call objects to be executed

parallelTools

a boolean flag indicating whether the tool calls should be executed in parallel

executorService

an optional executor service to manage parallel execution; if not provided, a default executor is used