Update multi_agent.py
Browse files- multi_agent.py +7 -8
multi_agent.py
CHANGED
@@ -47,7 +47,7 @@ def check_made_move(msg):
|
|
47 |
else:
|
48 |
return False
|
49 |
|
50 |
-
def run_multi_agent(llm,
|
51 |
llm_config = {"model": llm}
|
52 |
|
53 |
board_proxy = ConversableAgent(
|
@@ -120,21 +120,20 @@ def run_multi_agent(llm, num_moves):
|
|
120 |
chat_result = player_black.initiate_chat(
|
121 |
player_white,
|
122 |
message="Let's play chess!",
|
123 |
-
max_turns=
|
124 |
verbose=False
|
125 |
)
|
126 |
|
127 |
chat_history = chat_result.chat_history
|
128 |
|
129 |
result = ""
|
130 |
-
|
131 |
|
132 |
-
for
|
133 |
print("###")
|
134 |
-
print(
|
135 |
#print(svg)
|
136 |
-
|
137 |
-
|
138 |
-
move_num += 1
|
139 |
|
140 |
return result
|
|
|
47 |
else:
|
48 |
return False
|
49 |
|
50 |
+
def run_multi_agent(llm, num_turns):
|
51 |
llm_config = {"model": llm}
|
52 |
|
53 |
board_proxy = ConversableAgent(
|
|
|
120 |
chat_result = player_black.initiate_chat(
|
121 |
player_white,
|
122 |
message="Let's play chess!",
|
123 |
+
max_turns=num_turns,
|
124 |
verbose=False
|
125 |
)
|
126 |
|
127 |
chat_history = chat_result.chat_history
|
128 |
|
129 |
result = ""
|
130 |
+
turn_num = 0
|
131 |
|
132 |
+
for turn in chat_history:
|
133 |
print("###")
|
134 |
+
print(turn.get('content'))
|
135 |
#print(svg)
|
136 |
+
result += f"{turn_num}: {turn.get('content')}<br />"
|
137 |
+
num_turns += 1
|
|
|
138 |
|
139 |
return result
|