jupyter-ai icon indicating copy to clipboard operation
jupyter-ai copied to clipboard

Support '@' routing in addition to slash routing

Open michaelchia opened this issue 1 year ago • 0 comments
trafficstars

Problem

I would like to reference some commands with the @ symbol rather than the slash. I would like to separate RAG / context type commands for QA (e.g. /ask) from commands that are more structured in input (e.g. /help, /clear) or have some side effect (e.g. /learn, /generate). I have added a bunch of both kinds of custom commands and it would be nice to easily convey its expected usage pattern based on the type of command.

As my command list grows, the autocomplete feature in https://github.com/jupyterlab/jupyter-ai/pull/810 will allow users to quickly filter the context commands (@) with a single input.

Proposed Solution

Allow '@' as a valid HandlerRoutingType and supported in the command detection in RootChatHandler and the future autocomplete feature in https://github.com/jupyterlab/jupyter-ai/pull/810.

Additional context

Some future extensions of this could be:

  • Changing /ask to something like @files
    • supporting @files:/path/to/file/or/dir to QA a subset of the learned files
  • Creating some like @model:<provider_id>:<model_id> to let a different provider handle a question without having to switch back and forth in the settings.

michaelchia avatar Jun 02 '24 03:06 michaelchia