ToolLoop

interface ToolLoop

Embabel's own tool execution loop.

This gives us full control over:

  • Message capture and history management

  • Dynamic tool injection via strategies

  • Observability and event emission

  • Integration with Embabel's autonomy system

This interface is framework-agnostic - implementations use LlmMessageSender for LLM communication, allowing different backends (Spring AI, LangChain4j, etc.) to be plugged in.

Functions

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

Execute a conversation with tool calling until completion.