Agent

Since

0.3.0-beta01

Inheritors

Properties

Link copied to clipboard
open val id: String

Stable identifier for the agent, useful for telemetry, log routing, and the Agent.version / id / tools accessors v6 exposes (per historical parity gap #33). Implementations default to "agent"; override in the constructor or via class member to set a more specific tag ("chat-agent", "lineup-subagent", etc.).

Link copied to clipboard
abstract val tools: ToolSet<TContext>

The tool surface this agent carries. Exposed at the interface so consumers can inspect / dispatch without casting to ToolLoopAgent.

Link copied to clipboard
open val version: String?

Optional version string — "1.0.0", a git sha, anything stable across an app build. Null = unversioned. Lets telemetry pin issues to a specific agent revision.

Functions

Link copied to clipboard
abstract fun generate(prompt: String? = null, messages: List<ModelMessage> = emptyList(), options: TContext? = null, abortSignal: AbortSignal = AbortSignalNever): Flow<GenerateResult<TOutput>>

One-shot generation. Either prompt or messages (or both) must be supplied. When both are present, prompt is appended as a trailing user message.

Link copied to clipboard
Link copied to clipboard
abstract fun stream(prompt: String? = null, messages: List<ModelMessage> = emptyList(), options: TContext? = null, abortSignal: AbortSignal = AbortSignalNever): Flow<StreamEvent>

Streaming generation. Cold flow — starts when collected.