From f9c7203a48637c947a31da0f702e2f6281af524a Mon Sep 17 00:00:00 2001 From: Alex-Welsh Date: Fri, 4 Apr 2025 11:13:35 +0100 Subject: [PATCH] Fix error with long messages breaking for everyone --- web-apps/chat/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-apps/chat/app.py b/web-apps/chat/app.py index b2ebaa0..18284bb 100644 --- a/web-apps/chat/app.py +++ b/web-apps/chat/app.py @@ -70,7 +70,7 @@ def inference(latest_message, history): context = [] if INCLUDE_SYSTEM_PROMPT: context.append(SystemMessage(content=settings.model_instruction)) - else: + elif history and len(history) > 0: # Mimic system prompt by prepending it to first human message history[0]['content'] = f"{settings.model_instruction}\n\n{history[0]['content']}"