Update multi_agent.py
Browse files- multi_agent.py +4 -6
multi_agent.py
CHANGED
@@ -26,8 +26,6 @@ def make_move(move: Annotated[str, "A move in UCI format."]) -> Annotated[str, "
|
|
26 |
fill={move.from_square: "gray"},
|
27 |
size=200
|
28 |
)
|
29 |
-
|
30 |
-
board_svgs.append(svg)
|
31 |
|
32 |
piece = board.piece_at(move.to_square)
|
33 |
piece_symbol = piece.unicode_symbol()
|
@@ -36,6 +34,9 @@ def make_move(move: Annotated[str, "A move in UCI format."]) -> Annotated[str, "
|
|
36 |
if piece_symbol.isupper()
|
37 |
else chess.piece_name(piece.piece_type)
|
38 |
)
|
|
|
|
|
|
|
39 |
return f"Moved {piece_name} ({piece_symbol}) from "\
|
40 |
f"{chess.SQUARE_NAMES[move.from_square]} to "\
|
41 |
f"{chess.SQUARE_NAMES[move.to_square]}."
|
@@ -130,11 +131,8 @@ def run_multi_agent(llm, num_turns):
|
|
130 |
result = ""
|
131 |
turn_num = 0
|
132 |
|
133 |
-
print("###")
|
134 |
-
print(len(board_svgs))
|
135 |
-
|
136 |
for chat in chat_history:
|
137 |
-
result += f"{turn_num}: {chat.get('content')}<br />{board_svgs[
|
138 |
turn_num += 1
|
139 |
|
140 |
return result
|
|
|
26 |
fill={move.from_square: "gray"},
|
27 |
size=200
|
28 |
)
|
|
|
|
|
29 |
|
30 |
piece = board.piece_at(move.to_square)
|
31 |
piece_symbol = piece.unicode_symbol()
|
|
|
34 |
if piece_symbol.isupper()
|
35 |
else chess.piece_name(piece.piece_type)
|
36 |
)
|
37 |
+
|
38 |
+
board_svgs.append(svg)
|
39 |
+
|
40 |
return f"Moved {piece_name} ({piece_symbol}) from "\
|
41 |
f"{chess.SQUARE_NAMES[move.from_square]} to "\
|
42 |
f"{chess.SQUARE_NAMES[move.to_square]}."
|
|
|
131 |
result = ""
|
132 |
turn_num = 0
|
133 |
|
|
|
|
|
|
|
134 |
for chat in chat_history:
|
135 |
+
result += f"{turn_num}: {chat.get('content')}<br />{board_svgs[turn_num]}<br />\n***\n<br />"
|
136 |
turn_num += 1
|
137 |
|
138 |
return result
|