Update to jupyterlab-ai-commands 0.3.1#301
Conversation
jupyterlab-ai-commands 0.3.0jupyterlab-ai-commands 0.3.1
There was a problem hiding this comment.
Thanks @jtpio , it seems a lot more reliable.
I still see some error done by mistral (devstral), but I think it is also an issue with the LLM. Sometime when I ask something that is not fully relevant with the current notebook, it opens a lot of notebooks to see if one matches better the request.
Ideas for future PRs:
- add a command to read the content without opening the widget, to help introspecting files and opening only the relevant one. It was part of jupyter-ai-contrib/jupyterlab-ai-commands#5, maybe we could keep only the part about reading content.
- specify to ask the user when the request is not fully understand, before starting to call tools
- I haven't see issues so far with this PR, but it could be useful to tell the agent to compare the file after the change, and correct it if it is not what was expected
| ## Notebook State and Cell Identity | ||
| When working with an existing notebook, use the notebook's current structure and kernel state as the source of truth. | ||
| - Before changing notebook content or structure, inspect the notebook and any target cells with the relevant notebook commands you have discovered. | ||
| - If the user may have edited the notebook, or if a previous command could have changed it, refresh your view before continuing rather than relying on earlier results. |
There was a problem hiding this comment.
An other idea for future PR.
"If the user may have edited the notebook": I wonder if we could send this information back to the agent during a response generation. If we add a message in the history, it will probably break the history if it is inserted between a tool call and a tool result...
But there may be other way to inform the agent about some changes that should be taken into consideration.
There was a problem hiding this comment.
Good point. Maybe listening to fileChanged and passing this information to the conversation (as a message hidden to the user) could be a more reliable approach.
Update to the latest release, which should bring improvements when editing notebooks and files.
Also slightly tweak the system prompt to nudge the model to get more up-to-date information about the files it edits.