-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtermination_reasons.py
More file actions
29 lines (22 loc) · 1011 Bytes
/
Copy pathtermination_reasons.py
File metadata and controls
29 lines (22 loc) · 1011 Bytes
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
"""Shared string-enum for game termination reasons.
Isolated into its own tiny module so lightweight consumers (e.g. log refiners,
offline analysis scripts) can read these constants without paying the ~3.5s
import cost of `llm_chess`, which transitively pulls in `autogen`, `matplotlib`,
`moviepy`, Google Cloud AI Platform, etc.
`llm_chess.TerminationReason` is re-exported from this module, so existing
callers that do `from llm_chess import TerminationReason` keep working
unchanged.
"""
from enum import Enum
class TerminationReason(Enum):
TOO_MANY_WRONG_ACTIONS = "Too many wrong actions"
CHECKMATE = "Checkmate"
STALEMATE = "Stalemate"
INSUFFICIENT_MATERIAL = "Insufficient material"
SEVENTYFIVE_MOVES = "Seventy-five moves rule"
FIVEFOLD_REPETITION = "Fivefold repetition"
MAX_TURNS = "Max turns in single dialog"
UNKNOWN_ISSUE = "Unknown issue, failed to make a move"
MAX_MOVES = "Max moves reached"
ERROR = "ERROR OCCURED"
__all__ = ["TerminationReason"]