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 dlqqq committed Jun 12, 2024
1 parent 83ca89e commit 8156afd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/clear.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

from .base import BaseChatHandler, SlashCommandRoutingType


class ClearChatHandler(BaseChatHandler):
"""Clear the chat panel and show the help menu"""

id = "clear"
name = "Clear chat messages"
help = "Clear the chat window"
Expand All @@ -27,5 +29,5 @@ async def process_message(self, _):

self._chat_history = [tmp_chat_history]
self.reply(tmp_chat_history.body)
break

break
6 changes: 4 additions & 2 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ async def process_message(self, message: HumanChatMessage):
markdown_content = "\n\n".join(
self.chat_message_to_markdown(msg) for msg in self._chat_history
)
args = self.parse_args(message)
chat_filename = args.path[0] if (args.path and args.path[0]!="") else "chat_history" # Handles both empty args and double tap <Enter> key
args = self.parse_args(message)
chat_filename = (
args.path[0] if (args.path and args.path[0] != "") else "chat_history"
) # Handles both empty args and double tap <Enter> key
chat_filename = f"{chat_filename}-{datetime.now():%Y-%m-%d-%H-%M}.md"
chat_file = os.path.join(self.root_dir, chat_filename)
with open(chat_file, "w") as chat_history:
Expand Down

0 comments on commit 8156afd

Please sign in to comment.