Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
|
@@ -92,6 +92,7 @@ class AnalyzeRequest(BaseModel):
|
|
| 92 |
moves: List[str] # e.g., ["e4", "e5", "Nf3", "Nc6", ...]
|
| 93 |
time_per_move: float = 0.1 # quick eval per move
|
| 94 |
player_color: str = "white"
|
|
|
|
| 95 |
|
| 96 |
class MoveAnalysis(BaseModel):
|
| 97 |
move_num: int
|
|
@@ -201,7 +202,7 @@ async def analyze_game(request: AnalyzeRequest):
|
|
| 201 |
engine = None
|
| 202 |
try:
|
| 203 |
engine = await get_engine()
|
| 204 |
-
board = chess.Board()
|
| 205 |
limit = chess.engine.Limit(time=request.time_per_move)
|
| 206 |
|
| 207 |
analysis_results = []
|
|
|
|
| 92 |
moves: List[str] # e.g., ["e4", "e5", "Nf3", "Nc6", ...]
|
| 93 |
time_per_move: float = 0.1 # quick eval per move
|
| 94 |
player_color: str = "white"
|
| 95 |
+
start_fen: Optional[str] = None
|
| 96 |
|
| 97 |
class MoveAnalysis(BaseModel):
|
| 98 |
move_num: int
|
|
|
|
| 202 |
engine = None
|
| 203 |
try:
|
| 204 |
engine = await get_engine()
|
| 205 |
+
board = chess.Board(request.start_fen) if request.start_fen else chess.Board()
|
| 206 |
limit = chess.engine.Limit(time=request.time_per_move)
|
| 207 |
|
| 208 |
analysis_results = []
|