org.llm4s.agent.streaming.AgentEvent
See theAgentEvent companion object
Events emitted during streaming agent execution.
AgentEvent provides fine-grained visibility into agent execution, enabling real-time UIs, progress tracking, and debugging.
Event categories:
- Text events: Token-level streaming during LLM generation
- Tool events: Tool invocation lifecycle
- Agent lifecycle: Start, step, complete, fail
- Handoff events: Agent-to-agent delegation
Attributes
- Example
-
agent.runWithEvents( query = "What's the weather?", tools = weatherTools, onEvent = { case TextDelta(delta, _) => print(delta) case ToolCallStarted(_, name, _, _) => println(s"[Calling $$name]") case AgentCompleted(state, _) => println("Done!") case _ => // ignore } ) - Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class AgentCompletedclass AgentFailedclass AgentStartedclass HandoffCompletedclass HandoffStartedclass InputGuardrailCompletedclass InputGuardrailStartedclass OutputGuardrailCompletedclass OutputGuardrailStartedclass StepCompletedclass StepStartedclass TextCompleteclass TextDeltaclass ToolCallCompletedclass ToolCallFailedclass ToolCallStarted
Members list
In this article