rlmesh.adapters.resolve_from_contract

functionfrom rlmesh.adapters import resolve_from_contract[source]

Derive an Adapter from an env contract and a model spec.

resolve_from_contract(
    contract: EnvContract,
    model_spec: ModelSpec,
    *,
    trust_entrypoints: bool = False,
    check_inverse: bool = True,
) -> Adapter

Reads the env’s tags from its contract metadata (published under ENV_METADATA_KEY by a server set up with rlmesh.adapters.tag()) and its observation/action spaces from the contract, then resolves as in resolve().

Parameters

NameTypeDescription
contractEnvContractThe environment contract (e.g. remote_env.env_contract).
model_specModelSpecThe model's declared input/output format.
trust_entrypointsboolSee resolve().
check_inverseboolSee resolve().

Raises

TypeDescription
AdapterResolutionErrorIf the contract carries no tags, or resolution fails.