From 05bafb983844d09180d5f33753e53ca2472e0c0e Mon Sep 17 00:00:00 2001 From: BillSchumacher <34168009+BillSchumacher@users.noreply.github.com> Date: Sun, 16 Apr 2023 00:40:00 -0500 Subject: [PATCH] Fix fstring bug. --- autogpt/agent/agent_manager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autogpt/agent/agent_manager.py b/autogpt/agent/agent_manager.py index 3db2fdd6..85b61b71 100644 --- a/autogpt/agent/agent_manager.py +++ b/autogpt/agent/agent_manager.py @@ -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})