From bead0a74baf990875046d42f6968f5877879c2f5 Mon Sep 17 00:00:00 2001 From: Antti Kaihola <13725+akaihola@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:07:06 +0300 Subject: [PATCH] Use `:` prefix instead of pseudo-XML for non-chat models --- packages/jupyter-ai-magics/jupyter_ai_magics/magics.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/magics.py b/packages/jupyter-ai-magics/jupyter_ai_magics/magics.py index 9e05880e8..2c2c683e0 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/magics.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/magics.py @@ -610,9 +610,9 @@ def run_ai_cell(self, args: CellArgs, prompt: str): if self.transcript: transcript = [ ( - f"{message.content}" - if message.type == "human" - else message.content + f"AI: {message.content}" + if message.type == "ai" + else f"{message.type.title()}: {message.content}" ) for message in self.transcript[-2 * self.max_history :] + [HumanMessage(content=prompt)]