-
-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make path argument required on /learn #1012
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you apply a label now?
Co-authored-by: Michał Krassowski <[email protected]>
Co-authored-by: Michał Krassowski <[email protected]>
@andrewfulton9 I'm not sure if this feature is the best user experience we can offer here. If a user runs |
@dlqqq, thanks for the feedback! My initial attempt at this was actually doing that. My concern with having it be a reply in the chat panel, at least if its asking for confirmation and not just saying an argument is required, is that the chat interactions aren't necessarily synchronous so you could have a situation where you have a history that looks like:
So in this situation, the code will have to check every incoming message to see if it is "yes" and probably some variations or that ("Yes") and then determine what that was a response to. Maybe in practice this wouldn't be as problematic as I expect, but I could see there being lots of confusing edge cases. Maybe the best answer here is to just not allow empty directory arguments in the first place. What do you think? Should I take a stab at in chat panel confirmation, allowing no empty directory argument, continue with front-end implementation, or another option that I'm not thinking of? |
@andrewfulton9 There's no reliable way I can think of that allows a user to reply yes/no to a previous question, since commands are only routed to the It seems the root issue is that Can # Make sure the path exists.
if not len(args.path) == 1:
self.reply(f"{self.parser.format_usage()}", message)
return Replying with a better error message here is a simpler solution. It avoids opening a full-page dialog that interrupts the user's workflow, and does not require any response. The user can read the error message and determine what command they want to run by themselves. |
The user must have an option to explicitly specify the name of the notebook
being generated. This is very important because we sometime see invalid
filenames generated by AI. This results in no file being written out.
…On Tue, Sep 24, 2024, 1:34 PM Andrew Fulton ***@***.***> wrote:
@andrewfulton9 <https://github.com/andrewfulton9> I'm not sure if this
feature is the best user experience we can offer here. If a user runs
/learn without specifying a target directory, why should that trigger a
dialog that takes over the user's entire screen? This is a minor usage
error that can be displayed as a reply in the chat panel.
@dlqqq <https://github.com/dlqqq>, thanks for the feedback! My initial
attempt at this was actually doing that. My concern with having it be a
reply in the chat panel, at least if its asking for confirmation and not
just saying an argument is required, is that the chat interactions aren't
necessarily synchronous so you could have a situation where you have a
history that looks like:
[
"/generate a notebook that gives basic usage examples of numpy",
"Great, I will get started on your notebook. It may take a few minutes, but I will reply here when the notebook is ready. In the meantime, you can continue to ask me other questions.",
"/learn ",
"Can you confirm that you want to learn under all files in the directory. if so,type yes",
"I have created your notebook and saved it to the location /home/vagrant/jupyter-ai/Basic Usage and Operations with NumPy in Python.ipynb. I am still learning how to create notebooks, so please review all code before running it.",
"yes"
]
So in this situation, the code will have to check every incoming message
to see if it is "yes" and probably some variations or that ("Yes") and then
determine what that was a response to. Maybe in practice this wouldn't be
as problematic as I expect, but I could see there being lots of confusing
edge cases.
Maybe the best answer here is to just not allow empty directory arguments
in the first place. What do you think? Should I take a stab at in chat
panel confirmation, allowing no empty directory argument, continue with
front-end implementation, or another option that I'm not thinking of?
—
Reply to this email directly, view it on GitHub
<#1012 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACHJVL3LNN4NXS2K24SRRPDZYGPDBAVCNFSM6AAAAABOW7CVKWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZRHEYDMMZUGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@richlysakowski This pull request concerns the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caught a few typos, no other comments
Co-authored-by: Michał Krassowski <[email protected]>
Co-authored-by: Michał Krassowski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewfulton9 Love the new error message! It's a concise summary of exactly how to use /learn
. Just two tiny suggestions and this is good to go.
Co-authored-by: david qiu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewfulton9 Awesome, thank you!
* Add dialog pop-up if no parameter is given for /learn * lint and improve wording * Update packages/jupyter-ai/src/components/chat-input.tsx Co-authored-by: Michał Krassowski <[email protected]> * Update packages/jupyter-ai/src/components/chat-input.tsx Co-authored-by: Michał Krassowski <[email protected]> * add else clause * remove warning * /learn arg.path required, remove warning * Update packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py Co-authored-by: Michał Krassowski <[email protected]> * Update packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py Co-authored-by: Michał Krassowski <[email protected]> * Update packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py Co-authored-by: david qiu <[email protected]> * remove debugging print --------- Co-authored-by: Michał Krassowski <[email protected]> Co-authored-by: david qiu <[email protected]>
closes #819
This PR adds a dialog pop-up when/learn
is used without a directory parameter. This makes it clear what is happening and gives people the opportunity to cancel the operation if learning on all files under the root (or preferred) directory wasn't intended.Updated to make /learn require a path argument. Now /learn will respond with a helpful message and example input if no path argument is given.