Skip to content

OSSS.ai.orchestration.routers.registry

OSSS.ai.orchestration.routers.registry

RouterError

Bases: Exception

Raised for router registry or execution errors.

RouterSpec dataclass

Optional metadata for introspection / docs / validation.

RouterRegistry

Central registry of named router functions.

GraphFactory / PatternSpec refers to routers by string name.

Contract Superset Mode (Option A): - Pattern names are canonical only ("standard", "data_query", ...). - Router names are contracts too: patterns.json references canonical router names (e.g. "refiner_route_query_or_end", "route_after_data_query"). - Legacy aliases (e.g. "route_after_refiner") must NOT be required.

call(name, state)

Execute a router by name with
  • exception safety (fallback)
  • output type safety (must be str)
  • optional allowed_outputs validation

This does NOT change LangGraph’s API, but you can use this from GraphFactory / node wrappers if you want stricter behavior.

If you don't use it anywhere, it's harmless.