openenv/coding_env
21
1# Copyright (c) Meta Platforms, Inc. and affiliates.2# All rights reserved.3#4# This source code is licensed under the BSD-style license found in the5# LICENSE file in the root directory of this source tree.6 7"""8OpenEnv Auto Module9===================10 11Provides HuggingFace-style auto-discovery API for OpenEnv environments.12 13This module enables automatic environment and action class loading without14manual imports:15 16 >>> from openenv import AutoEnv, AutoAction17 >>>18 >>> # Load environment from installed package or HuggingFace Hub19 >>> env = AutoEnv.from_name("coding-env")20 >>>21 >>> # Get action class22 >>> CodeAction = AutoAction.from_name("coding")23 >>> action = CodeAction(code="print('Hello!')")24 25Classes:26 AutoEnv: Automatic environment client selection and instantiation27 AutoAction: Automatic action class selection28 29The auto-discovery system works by:301. Discovering installed openenv-* packages via importlib.metadata312. Loading environment manifests (openenv.yaml) from package resources323. Supporting HuggingFace Hub repositories for remote environments334. Caching discovery results for performance34"""35 36from .auto_action import AutoAction37from .auto_env import AutoEnv38 39__all__ = ["AutoEnv", "AutoAction"]40 