Update multi_agent.py
Browse files- multi_agent.py +7 -8
multi_agent.py
CHANGED
@@ -1,8 +1,6 @@
|
|
1 |
-
import chess, chess.svg
|
2 |
from autogen import ConversableAgent, register_function
|
3 |
from typing_extensions import Annotated
|
4 |
-
from io import BytesIO
|
5 |
-
from PIL import Image
|
6 |
|
7 |
made_move = False
|
8 |
|
@@ -49,8 +47,9 @@ def check_made_move(msg):
|
|
49 |
else:
|
50 |
return False
|
51 |
|
52 |
-
def run_multi_agent(
|
53 |
-
|
|
|
54 |
|
55 |
board_proxy = ConversableAgent(
|
56 |
name="Board Proxy",
|
@@ -67,7 +66,7 @@ def run_multi_agent(llm, num_turns):
|
|
67 |
"Then call make_move(move) to make a move. "
|
68 |
"After a move is made, analyze the move using technical jargon, don't make any other comments. "
|
69 |
"Then continue playing.",
|
70 |
-
llm_config=
|
71 |
)
|
72 |
|
73 |
player_black = ConversableAgent(
|
@@ -77,7 +76,7 @@ def run_multi_agent(llm, num_turns):
|
|
77 |
"Then call make_move(move) to make a move. "
|
78 |
"After a move is made, analyze the move using technical jargon, don't make any other comments. "
|
79 |
"Then continue playing.",
|
80 |
-
llm_config=
|
81 |
)
|
82 |
|
83 |
for caller in [player_white, player_black]:
|
@@ -142,7 +141,7 @@ def run_multi_agent(llm, num_turns):
|
|
142 |
player = "Player White"
|
143 |
|
144 |
if turn_num > 0:
|
145 |
-
result += f"<b>{player}, {turn_num}:</b> {chat.get('content')}<br />{board_svgs[turn_num - 1]}<br />"
|
146 |
|
147 |
turn_num += 1
|
148 |
|
|
|
1 |
+
import chess, chess.svg
|
2 |
from autogen import ConversableAgent, register_function
|
3 |
from typing_extensions import Annotated
|
|
|
|
|
4 |
|
5 |
made_move = False
|
6 |
|
|
|
47 |
else:
|
48 |
return False
|
49 |
|
50 |
+
def run_multi_agent(llm_white, llm_black, num_turns):
|
51 |
+
llm_config_white = {"model": llm_white}
|
52 |
+
llm_config_black = {"model": llm_black}
|
53 |
|
54 |
board_proxy = ConversableAgent(
|
55 |
name="Board Proxy",
|
|
|
66 |
"Then call make_move(move) to make a move. "
|
67 |
"After a move is made, analyze the move using technical jargon, don't make any other comments. "
|
68 |
"Then continue playing.",
|
69 |
+
llm_config=llm_config_white,
|
70 |
)
|
71 |
|
72 |
player_black = ConversableAgent(
|
|
|
76 |
"Then call make_move(move) to make a move. "
|
77 |
"After a move is made, analyze the move using technical jargon, don't make any other comments. "
|
78 |
"Then continue playing.",
|
79 |
+
llm_config=llm_config_black,
|
80 |
)
|
81 |
|
82 |
for caller in [player_white, player_black]:
|
|
|
141 |
player = "Player White"
|
142 |
|
143 |
if turn_num > 0:
|
144 |
+
result += f"<b>{player}, Move {turn_num}:</b> {chat.get('content')}<br />{board_svgs[turn_num - 1]}<br />"
|
145 |
|
146 |
turn_num += 1
|
147 |
|