File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
packages/jupyter-ai/jupyter_ai/chat_handlers Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
from .base import BaseChatHandler , SlashCommandRoutingType
6
6
7
+
7
8
class ClearChatHandler (BaseChatHandler ):
8
9
"""Clear the chat panel and show the help menu"""
10
+
9
11
id = "clear"
10
12
name = "Clear chat messages"
11
13
help = "Clear the chat window"
@@ -27,5 +29,5 @@ async def process_message(self, _):
27
29
28
30
self ._chat_history = [tmp_chat_history ]
29
31
self .reply (tmp_chat_history .body )
30
-
31
- break
32
+
33
+ break
Original file line number Diff line number Diff line change @@ -34,8 +34,10 @@ async def process_message(self, message: HumanChatMessage):
34
34
markdown_content = "\n \n " .join (
35
35
self .chat_message_to_markdown (msg ) for msg in self ._chat_history
36
36
)
37
- args = self .parse_args (message )
38
- chat_filename = args .path [0 ] if (args .path and args .path [0 ]!= "" ) else "chat_history" # Handles both empty args and double tap <Enter> key
37
+ args = self .parse_args (message )
38
+ chat_filename = (
39
+ args .path [0 ] if (args .path and args .path [0 ] != "" ) else "chat_history"
40
+ ) # Handles both empty args and double tap <Enter> key
39
41
chat_filename = f"{ chat_filename } -{ datetime .now ():%Y-%m-%d-%H-%M} .md"
40
42
chat_file = os .path .join (self .root_dir , chat_filename )
41
43
with open (chat_file , "w" ) as chat_history :
You can’t perform that action at this time.
0 commit comments