Skip to content

Commit

Permalink
Use <role>: prefix instead of pseudo-XML for non-chat models
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Sep 30, 2024
1 parent 7ed670d commit bead0a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/jupyter-ai-magics/jupyter_ai_magics/magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,9 @@ def run_ai_cell(self, args: CellArgs, prompt: str):
if self.transcript:
transcript = [
(
f"<HUMAN>{message.content}</HUMAN>"
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)]
Expand Down

0 comments on commit bead0a7

Please sign in to comment.