Skip to main content
LangState is an abstract generic class that holds component references and defines an application-facing lifecycle. The pinned source does not include a concrete subclass, so it cannot be instantiated directly.

Required methods

An application subclass implements:
The interpretive accessor is get_current_state(). A completed invocation returns ActionResultData, not StateResultData.

Constructor components

LangState.__init__() accepts optional:
  • BaseSpecExtractor
  • BaseMutator
  • BaseProjectorCanonicalState
  • one BaseProjectorUI or a list of UI projectors
The base class stores schema, canonical and interpretive state references, conversation history, and action handlers. It exposes setters and read-only component properties, but the subclass owns initialization and invocation sequencing.

Invocation result models

InteractionRequest represents another user interaction. It can carry a prompt, UI components, options, pending fields, InterpretiveStateSchema, and CanonicalStateSchema. ActionResultData represents completion:
This model is distinct from ActionResult in the action module. ActionResult describes an individual action execution with an ActionStatus; ActionResultData is the orchestrator’s completed-flow payload.

Application responsibility

The abstract contract does not automatically connect repositories, snapshots, actions, mutators, or projectors. A subclass must define ordering, error handling, concurrency, persistence, transaction boundaries, and how component results are converted to the Pydantic boundary models.