jupyterlab / jupyter-ai

A generative AI extension for JupyterLab
https://jupyter-ai.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
3.24k stars 332 forks source link

/learn can run with no parameters #819

Closed JasonWeill closed 1 month ago

JasonWeill commented 5 months ago

Description

In the chat UI, /learn can be run with no parameters. In this case, I think it tries to run the command on the current directory.

Expected behavior

Running /learn with no parameters should produce an error with usage information.

Context

See also #633, with some other quirks when running the /learn command.

Found while testing #810 by @dlqqq , but not necessarily introduced by this PR.

andrewfulton9 commented 1 month ago

/learn is currently learning on the root (or preferred directory) if no parameter is given. Another option would be to add a dialog warning to require a confirmation on what /learn will be learning on if a parameter isn't given. That would make it clear what will be done and give the user the opportunity to cancel the task if learning on all files under the root directory wasn't intended.

JasonWeill commented 1 month ago

965 is a request for a "cancel" option, which should work for both messages and commands.