PR-437-Fixed bug to allow system instructions after first turn

This commit is contained in:
Sarthak Deshpande 2024-11-13 14:53:17 +05:30
parent 36b052ab10
commit e6e49e1bc6

View file

@ -156,7 +156,7 @@ class ChatAgent(ShieldRunnerMixin):
turns = await self.storage.get_session_turns(request.session_id)
messages = []
if len(turns) == 0 and self.agent_config.instructions != "":
if self.agent_config.instructions != "":
messages.append(SystemMessage(content=self.agent_config.instructions))
for i, turn in enumerate(turns):