Fixed stacking prompt instructions (#5520)

fixed issue with prompt instruction stacking

prompt instructions were stacking making the agent eventually return an error because the prompt was full of repeating instructions
This commit is contained in:
NeonN3mesis
2023-10-04 00:16:08 -04:00
committed by GitHub
parent f81b466c9a
commit f227d5adb1

View File

@@ -108,10 +108,12 @@ class Agent(
def build_prompt(
self,
*args,
extra_messages: list[ChatMessage] = [],
extra_messages: [list[ChatMessage]] = None,
include_os_info: Optional[bool] = None,
**kwargs,
) -> ChatPrompt:
if extra_messages is None:
extra_messages = []
# Clock
extra_messages.append(
ChatMessage.system(f"The current time and date is {time.strftime('%c')}"),