ThreadState

org.llm4s.agent.graph.ThreadState
final class ThreadState

The committed state of a graph thread: a typed key/value store over the graph's registered StateKeys. It is immutable, so every task in a superstep reads the same snapshot.

Reads are checked: a key the graph did not register - or a different key instance sharing a registered key's id - is an GraphError.UnknownStateKey. A registered key with no stored entry reads as its initial value. The erasure to Any stays private to this boundary.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def get[A](key: StateKey[A, _]): Result[A]

The key's committed value, or its initial value when no entry is stored.

The key's committed value, or its initial value when no entry is stored.

Attributes

def isSet(key: StateKey[_, _]): Boolean

Whether the key has a stored entry, as opposed to reading its initial value.

Whether the key has a stored entry, as opposed to reading its initial value.

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