royerlab / napari-chatgpt

A napari plugin to process and analyse images with chatGPT!
BSD 3-Clause "New" or "Revised" License
250 stars 26 forks source link

What's the purpose of `Save chats as Jupyter notebooks` checkbox? #37

Closed li-li-github closed 8 months ago

li-li-github commented 8 months ago

Hi Loic and other contributors,

I just realized that if I uncheck Save chats as Jupyter notebooks, napari will throw an error and won't pop up in the web browser. (and the program won't terminate even if I close napari)

├ Error: 'NoneType' object has no attribute 'register_snapshot_function'
├ Omega failed to start. Please check the console for more information.
Traceback (most recent call last):
  File "/opt/anaconda3/envs/omega/lib/python3.10/site-packages/napari_chatgpt/_widget.py", line 467, in _start_omega
    self.server = start_chat_server(self.viewer,
  File "/opt/anaconda3/envs/omega/lib/python3.10/site-packages/napari_chatgpt/chat_server/chat_server.py", line 303, in start_chat_server
    notebook.register_snapshot_function(bridge.take_snapshot)
AttributeError: 'NoneType' object has no attribute 'register_snapshot_function'

This makes me wonder what was the intention of making it uncheckable.

royerloic commented 8 months ago

Arg. Good catch! Need to fix that!