Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and srdas committed Mar 16, 2024
1 parent 3ef11ce commit 774849d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from .base import BaseChatHandler, SlashCommandRoutingType
from .clear import ClearChatHandler
from .default import DefaultChatHandler
from .export import ExportChatHandler
from .generate import GenerateChatHandler
from .help import HelpChatHandler
from .learn import LearnChatHandler
from .export import ExportChatHandler
10 changes: 5 additions & 5 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/export.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from typing import List

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

from .base import BaseChatHandler, SlashCommandRoutingType


class ExportChatHandler(BaseChatHandler):
id = "export"
name = "Export chat messages"
Expand All @@ -23,11 +24,10 @@ def chat_message_to_markdown(self, message):
else:
return ""


async def process_message(self, _):
markdown_content = "\n\n".join(self.chat_message_to_markdown(msg) for msg in self._chat_history)
markdown_content = "\n\n".join(
self.chat_message_to_markdown(msg) for msg in self._chat_history
)
# Write the markdown content to a file or do whatever you want with it
with open("./playground/chat_history.md", "w") as chat_history:
chat_history.write(markdown_content)


2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
AskChatHandler,
ClearChatHandler,
DefaultChatHandler,
ExportChatHandler,
GenerateChatHandler,
HelpChatHandler,
LearnChatHandler,
ExportChatHandler,
)
from .chat_handlers.help import HelpMessage
from .completions.handlers import DefaultInlineCompletionHandler
Expand Down

0 comments on commit 774849d

Please sign in to comment.