execute

abstract fun <O> execute(initialMessages: List<Message>, initialTools: List<Tool>, outputParser: (String) -> O): ToolLoopResult<O>

Execute a conversation with tool calling until completion.

Return

The result containing parsed output and conversation history

Parameters

initialMessages

The starting messages (system + user)

initialTools

The initially available tools

outputParser

Function to parse the final response to the output type