Spaces:
Sleeping
Sleeping
Alexandre Gazola
commited on
Commit
·
99ae9bc
1
Parent(s):
7514a27
test
Browse files
analyse_chess_position_tool.py
CHANGED
@@ -7,19 +7,14 @@ def get_best_move(fen: str) -> str:
|
|
7 |
Given the description of a chess board using FEN notation, returns the next best move.
|
8 |
|
9 |
Args:
|
10 |
-
fen (str): The description of the chessboard position in FEN notation
|
11 |
|
12 |
Returns:
|
13 |
str: The description of the next best move.
|
14 |
"""
|
15 |
-
url = "https://lichess.org/api/cloud-eval"
|
16 |
-
params = {
|
17 |
-
"fen": fen,
|
18 |
-
"multiPv": 1, # only top move
|
19 |
-
"syzygy": 5 # enable tablebase for 5-piece positions
|
20 |
-
}
|
21 |
|
22 |
-
|
|
|
23 |
payload = {
|
24 |
"fen": fen,
|
25 |
"depth": 1
|
|
|
7 |
Given the description of a chess board using FEN notation, returns the next best move.
|
8 |
|
9 |
Args:
|
10 |
+
fen (str): The description of the chessboard position in FEN notation
|
11 |
|
12 |
Returns:
|
13 |
str: The description of the next best move.
|
14 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
CHESS_MOVE_API = "https://chess-api.com/v1"
|
17 |
+
url = CHESS_MOVE_API
|
18 |
payload = {
|
19 |
"fen": fen,
|
20 |
"depth": 1
|