Quick fix for the str concatenation bug, but it remains to be discovered why we are getting a 'ChatCompletionMessage' rather than a str. (#809)

This commit is contained in:
afourney
2023-11-29 09:15:44 -08:00
committed by GitHub
parent f96963ed43
commit 4fde1211c2

View File

@@ -208,7 +208,7 @@ Then select the next role from {[agent.name for agent in agents]} to play. Only
regex = (
r"(?<=\W)" + re.escape(agent.name) + r"(?=\W)"
) # Finds agent mentions, taking word boundaries into account
count = len(re.findall(regex, " " + message_content + " ")) # Pad the message to help with matching
count = len(re.findall(regex, f" {message_content} ")) # Pad the message to help with matching
if count > 0:
mentions[agent.name] = count
return mentions