Skip to content

Commit

Permalink
save chat history to jupyter lab root dir
Browse files Browse the repository at this point in the history
The /export command was saving  chat history in the pwd, i.e., the directory from where JupyterLab is launched rather than the JupyterLab root. For JupyterLab sessions, where the root directory is different from the launch directory, users will not be able to see the exported chat history file in JupyterLab. This is now rectified.
  • Loading branch information
srdas committed May 1, 2024
1 parent 2acfd4d commit def2731
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def chat_message_to_markdown(self, message):
return ""

# Multiple chat histories in separate files
def get_chat_filename(self, path="./chat_history.md"):
def get_chat_filename(self, file_name="chat_history.md"):
path = os.path.join(self.root_dir, file_name)
filename, extension = os.path.splitext(path)
counter = 1
while os.path.exists(path):
Expand Down

0 comments on commit def2731

Please sign in to comment.