Fix fstring bug.

pull/2531/head
BillSchumacher 2023-04-16 00:40:00 -05:00
parent abb54df4d0
commit 05bafb9838
No known key found for this signature in database
GPG Key ID: 1133789BDD03E12A
1 changed files with 4 additions and 2 deletions

View File

@ -47,7 +47,8 @@ class AgentManager(metaclass=Singleton):
for i, plugin in enumerate(self.cfg.plugins):
plugin_result = plugin.on_instruction(messages)
if plugin_result:
plugins_reply = f"{plugins_reply}{'' if not i else '\n'}{plugin_result}"
sep = '' if not i else '\n'
plugins_reply = f"{plugins_reply}{sep}{plugin_result}"
if plugins_reply and plugins_reply != "":
messages.append({"role": "assistant", "content": plugins_reply})
@ -96,7 +97,8 @@ class AgentManager(metaclass=Singleton):
for i, plugin in enumerate(self.cfg.plugins):
plugin_result = plugin.on_instruction(messages)
if plugin_result:
plugins_reply = f"{plugins_reply}{'' if not i else '\n'}{plugin_result}"
sep = '' if not i else '\n'
plugins_reply = f"{plugins_reply}{sep}{plugin_result}"
# Update full message history
if plugins_reply and plugins_reply != "":
messages.append({"role": "assistant", "content": plugins_reply})