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
Source
EventType.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def decode(payload: Value): Option[A]

Attributes

Source
EventType.scala
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

Source
EventType.scala
def encode(value: A): Value

Attributes

Source
EventType.scala
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

Source
EventType.scala
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
Source
EventType.scala
def unapply(event: StreamEvent): Option[A]

Attributes

Source
EventType.scala

Concrete fields

val name: String

Attributes

Source
EventType.scala
val version: Int

Attributes

Source
EventType.scala