Give uncertainty a structure.
Keep candidate values, confidence, and the latest inference together. Inspect what the system believes before deciding what to accept.
Explore interpretive state ↗A Python framework for the space between what a user says and what your application knows.
Represent uncertainty. Resolve it on your terms.
Build around state you can inspect.
Start from a pinned source checkout. Installation guide ↗
registrant.name2 candidatesThe user supplied a full name after a short name.
Python OpenAPI schemas Pydantic models Field-level state
01 / THE APPROACH
Natural language is partial, ambiguous, and sometimes contradictory. Keep those possibilities visible before they become application decisions.
Keep candidate values, confidence, and the latest inference together. Inspect what the system believes before deciding what to accept.
Explore interpretive state ↗Store authoritative values at stable field paths. Give downstream validation and business logic a clear representation to work with.
Explore canonical state ↗Compare expected and actual interpretive states field by field. Test the effect of a mutator beyond the text of its response.
Explore evaluation ↗02 / THE ARCHITECTURE
LangState gives interpretation and authoritative data different homes. Your application owns the policy that connects them.
Understand the two-state model ↗Candidates · Confidence · Latest inference
Resolved values · Stable field paths
Projector and orchestration contracts are abstract.
Their implementations belong to your application.
03 / START WITH THE PRIMITIVES
Read an OpenAPI schema, create canonical state, and derive interpretive state. Start with concrete APIs exercised by the documented source tests.
Walk through the quickstart →Early by design. Clear about the boundaries.Source-only alpha. No supported PyPI release; the PyPI name belongs to an unrelated project. See implementation status ↗
# Run from the documented source checkout
from core.state.factory.state_factory import StateFactory
# schema comes from OpenAPIReader
factory = StateFactory()
canonical = factory.create_canonical_state(schema)
canonical.set_field(
"registrant.name", "Ada Lovelace"
)
interpretive = factory.create_interpretive_state(
canonical
)
# A candidate you can inspect
best = interpretive.get_best_value(
"registrant.name"
)MAKE THE IMPLICIT EXPLICIT