File size: 1,033 Bytes
7aca0bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# 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.

"""
Chess Environment for OpenEnv.

This module provides OpenEnv integration for chess, using the moonfish
chess engine for position evaluation and opponent play.

Example:
    >>> from envs.chess_env import ChessEnv, ChessAction
    >>>
    >>> # Connect to a running server or start via Docker
    >>> env = ChessEnv.from_docker_image("chess-env:latest")
    >>>
    >>> # Reset and interact
    >>> result = env.reset()
    >>> print(result.observation.fen)
    >>> print(result.observation.legal_moves)
    >>>
    >>> result = env.step(ChessAction(move="e2e4"))
    >>> print(result.reward, result.done)
    >>>
    >>> # Cleanup
    >>> env.close()
"""

from .client import ChessEnv
from .models import ChessAction, ChessObservation, ChessState

__all__ = ["ChessEnv", "ChessAction", "ChessObservation", "ChessState"]