File size: 1,253 Bytes
0f6657d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

"""
OpenEnv Auto Module
===================

Provides HuggingFace-style auto-discovery API for OpenEnv environments.

This module enables automatic environment and action class loading without
manual imports:

    >>> from openenv import AutoEnv, AutoAction
    >>>
    >>> # Load environment from installed package or HuggingFace Hub
    >>> env = AutoEnv.from_name("coding-env")
    >>>
    >>> # Get action class
    >>> CodeAction = AutoAction.from_name("coding")
    >>> action = CodeAction(code="print('Hello!')")

Classes:
    AutoEnv: Automatic environment client selection and instantiation
    AutoAction: Automatic action class selection

The auto-discovery system works by:
1. Discovering installed openenv-* packages via importlib.metadata
2. Loading environment manifests (openenv.yaml) from package resources
3. Supporting HuggingFace Hub repositories for remote environments
4. Caching discovery results for performance
"""

from .auto_action import AutoAction
from .auto_env import AutoEnv

__all__ = ["AutoEnv", "AutoAction"]