Skip to content

OSSS.ai.orchestration.routers.helpers

OSSS.ai.orchestration.routers.helpers

get_exec_state(state)

Normalize whatever the graph/router receives into the execution_state dict.

Supported inputs
  • plain dict state (langgraph state)
  • dict containing {"execution_state": {...}}
  • AgentContext-like objects with .execution_state or .get("execution_state")

truthy(value)

Interpret common "truthy" encodings robustly.

This exists because router modules often import truthy from here.

Examples treated as True
  • True, 1, "1", "true", "yes", "y", "on", "t"

Examples treated as False: - False, 0, "0", "false", "no", "n", "off", "f", "", None

get_query_profile(state)

Compatibility shim: some routers import get_query_profile() from this module.

Returns a small, stable "query profile" derived from execution_state that routers can use for branching decisions without hard-coupling to other services.