Instruction

sealed interface Instruction

A unit of instruction provided to an LlmAgent.

Use one of the variants:

Convenience factories on the companion object allow the call sites Instruction("text"), Instruction(content), and Instruction { ctx -> ... }.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
fun interface Provider : Instruction

A function that produces the instruction Content at turn time, given a ReadonlyContext.

Link copied to clipboard
value class Structured(val content: Content) : Instruction

A pre-built structured instruction, e.g. multimodal content.

Link copied to clipboard
value class Text(val text: String) : Instruction

A literal text instruction. Wrapped into a single Part at runtime.