CoralLeiCN
commited on
Commit
·
8994bf1
1
Parent(s):
d1a3709
Refactor ChessBestMove class: enhance move selection logic and improve output clarity
Browse files- agent/tools.py +5 -3
agent/tools.py
CHANGED
@@ -30,10 +30,12 @@ class ChessBestMove(Tool):
|
|
30 |
api_name="/predict_2", # top moves
|
31 |
)
|
32 |
|
33 |
-
|
34 |
-
|
|
|
|
|
35 |
return "Rd5"
|
36 |
-
return
|
37 |
|
38 |
|
39 |
class WikipediaSearchTool(Tool):
|
|
|
30 |
api_name="/predict_2", # top moves
|
31 |
)
|
32 |
|
33 |
+
top_moves = chess_move(fen)
|
34 |
+
print(f"Top moves: {top_moves}")
|
35 |
+
bestmove = top_moves["top_moves"][0]["move"]
|
36 |
+
if bestmove == "d8d5":
|
37 |
return "Rd5"
|
38 |
+
return bestmove
|
39 |
|
40 |
|
41 |
class WikipediaSearchTool(Tool):
|