Skip to content

Commit

Permalink
Fix /export by including streamed agent messages (#1077)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcavdar authored Nov 1, 2024
1 parent da1f5f6 commit f8944b1
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 f8944b1

Please sign in to comment.