jupyter-ai
jupyter-ai copied to clipboard
Provide meaningful message if applying /learn to a directory that is empty or only contains unsupported files.
trafficstars
Problem
If user applies /learn to a directory that is empty or only contains unsupported files, the message given will be "Learn documents in {load_path} failed. enough values to unpack (expected 2, got 0).".
https://github.com/jupyterlab/jupyter-ai/blob/3e6b61d39309e8f7601c4f8474e3e868ba3bc5c5/packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py#L132
This is not very helpful to the user, especially when it may not be obvious to the user what all the supported extensions are.
Proposed Solution
Provide a more meaningful error response telling the user it could not find any supported files and perhaps indicating the supported extension types.