Update multi_agent.py
Browse files- multi_agent.py +5 -2
multi_agent.py
CHANGED
@@ -2,6 +2,7 @@ import chess, chess.svg, math
|
|
2 |
from autogen import ConversableAgent, register_function
|
3 |
from typing_extensions import Annotated
|
4 |
|
|
|
5 |
counter = 0
|
6 |
made_move = False
|
7 |
|
@@ -16,7 +17,7 @@ def get_legal_moves() -> Annotated[str, "A list of legal moves in UCI format"]:
|
|
16 |
def make_move(move: Annotated[str, "A move in UCI format."]) -> Annotated[str, "Result of the move."]:
|
17 |
global counter
|
18 |
counter += 1
|
19 |
-
print("###
|
20 |
|
21 |
move = chess.Move.from_uci(move)
|
22 |
board.push_uci(str(move))
|
@@ -63,7 +64,9 @@ def get_num_turns(num_moves):
|
|
63 |
|
64 |
return num_turns
|
65 |
|
66 |
-
def run_multi_agent(llm_white, llm_black, num_moves):
|
|
|
|
|
67 |
llm_config_white = {"model": llm_white}
|
68 |
llm_config_black = {"model": llm_black}
|
69 |
|
|
|
2 |
from autogen import ConversableAgent, register_function
|
3 |
from typing_extensions import Annotated
|
4 |
|
5 |
+
g_moves = 0
|
6 |
counter = 0
|
7 |
made_move = False
|
8 |
|
|
|
17 |
def make_move(move: Annotated[str, "A move in UCI format."]) -> Annotated[str, "Result of the move."]:
|
18 |
global counter
|
19 |
counter += 1
|
20 |
+
print("### "+str(counter)+" of "+str(g_moves))
|
21 |
|
22 |
move = chess.Move.from_uci(move)
|
23 |
board.push_uci(str(move))
|
|
|
64 |
|
65 |
return num_turns
|
66 |
|
67 |
+
def run_multi_agent(llm_white, llm_black, num_moves):
|
68 |
+
global g_moves
|
69 |
+
g_moves = num_moves
|
70 |
llm_config_white = {"model": llm_white}
|
71 |
llm_config_black = {"model": llm_black}
|
72 |
|