executeTools

suspend fun executeTools(toolCalls: List<MessagePart.Tool.Call>, parallelTools: Boolean = false): 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.


suspend fun executeTools(message: Message.Assistant, parallelTools: Boolean = false): List<ReceivedToolResult>(source)

Executes all tool calls from a Message.Assistant and returns their results. Corresponds to nodeExecuteToolsAndGetReceivedResults.

Parameters

message

The assistant message containing tool calls to execute.

parallelTools

Whether to execute tools in parallel.