nemo_gym.discovery
nemo_gym.discovery
Shared component-discovery helpers: which roots to scan for a component, how to resolve name
collisions across them, and how to read a component’s (domain, description).
Lives below the per-component registries (registry.py, benchmarks.py, agent_registry.py) so
they can share it without depending on each other. Reads configs only; never starts servers.
Module Contents
Functions
Data
API
parse_no_environment for listing: fill unset ??? and undefined ${...} values (runtime-only
things like API keys/endpoints) with a placeholder so the config still resolves enough to identify the
component. Never mutates the input; errors other than those two propagate.
Best-effort (domain, description) from a config mapping: the first of each found across all
server groups. Never raises.
Run dir_scanning_fn on subdir of every :func:component_search_roots root and merge the results.
The shared body of discover_environments/discover_agents/discover_models/
discover_benchmarks: each passes its <type>/ subdir and a single-directory scan function, and
gets user-shadows-built-in merging (via :func:merge_by_name) for free.
Yield (group_key, server_name, server_config) for every server across all instances in a config.
Walks a loaded config mapping (each top-level instance -> its resources_servers/
responses_api_agents/responses_api_models group -> each server). Defensive against malformed
shapes, so it never raises. The shared primitive behind metadata reads and the inspect deep-parse.
Merge per-root name -> entry mappings; earlier roots win on a collision (user shadows built-in),
matching :func:component_search_roots precedence. Insertion order preserved.
Shared (domain, description) reader for an environment or benchmark config. Two passes, because
the two declare metadata differently:
- Raw (non-resolving) scan — environment configs declare it inline, and this is safe even though they reference servers defined elsewhere (resolving in isolation would raise).
- Resolving fallback for whatever’s still unset — benchmark configs inherit it via
config_paths/_inherit_from. Tolerates unset runtime values; on failure keeps the raw result.
Never raises: an unreadable/unresolvable config yields (None, None).