EventType

org.llm4s.agent.graph.EventType
See theEventType companion object
final class EventType[A]

A typed event: a payload type A with a stable name and version, sent durably with emit (a RunEvent.Custom, committed with the task) or live with progress (a StreamEvent.Live), and matched on either with unapply:

val Ping = EventType[Ping]("my.ping", 1)
runtime.subscribe(threadId) {
 case Ping(p) => println(p)
 case _       => ()
}

unapply is None for another name or version, for a kernel event, and for a payload that does not decode (logged at DEBUG), so a listener never throws on an event it does not know.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def decode(payload: Value): Option[A]
def emit(context: RunContext, value: A): Unit

A durable event: committed with the task, delivered after the commit, replayed later.

A durable event: committed with the task, delivered after the commit, replayed later.

Attributes

def encode(value: A): Value
def progress(context: RunContext, value: A): Unit

A live event: delivered at once to current subscribers, never stored.

A live event: delivered at once to current subscribers, never stored.

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
def unapply(event: StreamEvent): Option[A]

Concrete fields

val name: String
val version: Int