Skip to content

Commit

Permalink
Backport PR jupyterlab#1077: Fix /export by including streamed agen…
Browse files Browse the repository at this point in the history
…t messages
  • Loading branch information
mcavdar authored and meeseeksmachine committed Nov 1, 2024
1 parent d42edd5 commit ffa8d4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import datetime
from typing import List

from jupyter_ai.models import AgentChatMessage, HumanChatMessage
from jupyter_ai.models import AgentChatMessage, AgentStreamMessage, HumanChatMessage

from .base import BaseChatHandler, SlashCommandRoutingType

Expand All @@ -22,7 +22,7 @@ def __init__(self, *args, **kwargs):
self.parser.add_argument("path", nargs=argparse.REMAINDER)

def chat_message_to_markdown(self, message):
if isinstance(message, AgentChatMessage):
if isinstance(message, (AgentChatMessage, AgentStreamMessage)):
agent = self.config_manager.persona.name
return f"**{agent}**: {message.body}"
elif isinstance(message, HumanChatMessage):
Expand Down

0 comments on commit ffa8d4c

Please sign in to comment.