nemo_voice_agent.evaluation

View as Markdown

Subpackages

Submodules

Package Contents

Functions

NameDescription
get_eval_data_rootResolve the root directory for evaluation fixture data.
load_db_artifactLoad a tau2-style DB artifact, transparently handling sharded form.

API

nemo_voice_agent.evaluation.get_eval_data_root() -> pathlib.Path

Resolve the root directory for evaluation fixture data.

Checks $EVAL_DATA_ROOT first; falls back to packaged data under nemo_voice_agent/evaluation/data, then the legacy <repo>/evaluation/data layout. Lazy (function, not module constant) so env-var changes after import take effect — useful for tests and for bridge/server processes setting it differently.

Convention: db_path and similar fixture-path values stored in shared_state_init are always relative to this root, so bridge and server can resolve to different absolute roots.

nemo_voice_agent.evaluation.load_db_artifact(
path: typing.Union[str, pathlib.Path]
) -> typing.Dict[str, typing.Any]

Load a tau2-style DB artifact, transparently handling sharded form.

Some upstream db.json files exceed file size limits (e.g., 5 MB per-file cap), so they’re sharded into <name>/<table>.json one-file-per-top-level-key. This helper accepts either form:

  • <path>.json file → json.loads(read_text())
  • <path>/ directory → {stem: json.loads(read_text())} for every *.json file under it (top-level only; no recursion).

The two layouts are byte-equivalent at the in-memory dict level so callers (gold replay, bot-side state, predicates) don’t care which on-disk shape a given domain uses.

The caller passes a path WITHOUT the .json suffix (the artifact name). For backward compatibility with callers that still include .json, the suffix is stripped before probing.

Raises FileNotFoundError if neither form exists.