BaseAsyncLlmAgent

open class BaseAsyncLlmAgent(val broker: LlmBroker, val model: String, var behaviour: String = "You are a helpful assistant.", tools: List<LlmTool> = emptyList(), val config: CompletionConfig = CompletionConfig()) : Agent

LLM-backed agent. Subclasses override receiveEvent to map incoming events to prompts and feed the LLM response back into the event stream.

Mirrors the Python reference's BaseAsyncLLMAgent. The Kotlin port keeps the tool list mutable so subclasses can register tools after construction.

Inheritors

Constructors

Link copied to clipboard
constructor(broker: LlmBroker, model: String, behaviour: String = "You are a helpful assistant.", tools: List<LlmTool> = emptyList(), config: CompletionConfig = CompletionConfig())

Properties

Link copied to clipboard

the system-prompt persona / instructions.

Link copied to clipboard

the LlmBroker used for generation.

Link copied to clipboard

completion-time settings (temperature, tool budget, etc.).

Link copied to clipboard

the LLM model identifier passed to the broker.

Link copied to clipboard

Immutable snapshot of currently registered tools.

Functions

Link copied to clipboard
fun addTool(tool: LlmTool)
Link copied to clipboard
open suspend fun generateResponse(content: String): LlmGatewayResponse

Run a single LLM turn with content appended as a user message. Returns the full LlmGatewayResponse so subclasses can inspect content, tool calls, and structured output.

Link copied to clipboard
open suspend override fun receiveEvent(event: Event): List<Event>

Default implementation does nothing — override to emit follow-up events.