Skip to content

Commit

Permalink
Merge pull request #15 from sotopia-lab/bugs/parsing_error
Browse files Browse the repository at this point in the history
Workaround to fix multiple agent in single round
  • Loading branch information
XuhuiZhou authored Jan 16, 2024
2 parents 6cc9c6d + e06fad6 commit c4fdb16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sotopia/messages/message_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,11 @@ def split_by_turn(self, input_string: str) -> list[str]:
dialogues[-1] = "\n".join(
dialogues[-1].split("\n")[:2]
) # Discard further input in the last turn
# print("Dialogues: ", dialogues)

for dialogue in dialogues:
# TODO this is current workaround for the issue of multiple agents in one turn
if len(dialogue.split("\n")) >= 3:
raise ValueError("Only one agent can act per turn.")
return dialogues

@staticmethod
Expand Down

0 comments on commit c4fdb16

Please sign in to comment.