101dotxyz / GPTeam

GPTeam: An open-source multi-agent simulation
https://www.gpteamai.com/
MIT License
1.64k stars 254 forks source link

Agent to agent messages can be addressed X in Y #89

Open marvinirwin opened 1 year ago

marvinirwin commented 1 year ago

pattern = r"(?P<sender>[\w\s]+) said to (?P<recipient>[\w\s]+): [\"'](?P<message>.*)[\"']"

I've got messages which are addressed to "everyone in location", which breaks this regex, as it doesn't expect recipient to have whitespace in it. This causes the sender_name, recipient, content = re.findall(pattern, event.description)[0] to explode

Adding .* to the regex to allow the recipient to have spaces in it makes it work, though I'm not sure it wont break something else

With the .* added: pattern = r"(?P<sender>[\w\s]+) said to (?P<recipient>[\w\s]+.*): [\"'](?P<message>.*)[\"']"