You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to have more context passed into the message. In addition to the selected text, it would also include data like the contents of the active file, cursor position, active kernel etc. This will allow chat handlers to operate with more context. I will provide details of exact information in the Proposed Solution section.
This is an enhancement request inspired by what was added in #828. I am so glad @dlqqq added this as it was pretty much exactly the direction I was hoping for.
For context, a couple weeks ago, I actually hacked my way into implementing a patch that is pretty much what was implemented in /fix which also includes a cell toolbar button to trigger it.
In my implementation, in addition to the cell stderr, I also submit the entire notebook contents and the kernel id as well. Specifically, I submit the active cell id, the entire notebook data (notebook.model.toJSON()), and the its kernel id (if active kernel). The chat handler will extract the active cell and error using the active cell id and will also include the previously ran cells. This is inferred by filtering out all code cells before active cell that have a lower execution count (not a perfect logic but approximate enough). Kernel ID currently not used, but idea was to extract some variable information that may help the debugging.
Proposed Solution
Building upon what was done in #828. The idea of adding active cell text and error to the message can be generalised further to include more information in the message.
Context data
I propose the following information be included in the context (without opinion on exact data model):
For active notebook:
filepath
active cell
notebook data (all cell source, type, outputs: stdout/stderr, execution count)
kernel id
selection / cursor position/s
For active file editor:
filepath
file content
selection / cursor position/s
Possible enhancements
Selected text as context
Instead of pasting the selected text in the user message, include it as just another context item as above. This will allow chat handlers to differentiate selected text and something the user copypasted.
Additional benefit is it would help clean up the UI as sometimes the selected text can be quite long and end up filling up the chat. See secontion on UI below for how the user is made known of what is selected.
Config
Users should be able to configure what context is submitted. Right now, whether the selection is included is configured below the input box. Perhaps a separate tab or a dropdown may be required if the options grow.
UI
What is included in the context should be shown to the user. There are two possible ways to do this.
Show what context was submitted in a dropdown in the user message.
Push responsibility to chathandler to add what context was used in a dropdown in the agent message.
The text was updated successfully, but these errors were encountered:
Problem
I would like to have more context passed into the message. In addition to the selected text, it would also include data like the contents of the active file, cursor position, active kernel etc. This will allow chat handlers to operate with more context. I will provide details of exact information in the Proposed Solution section.
This is an enhancement request inspired by what was added in #828. I am so glad @dlqqq added this as it was pretty much exactly the direction I was hoping for.
For context, a couple weeks ago, I actually hacked my way into implementing a patch that is pretty much what was implemented in /fix which also includes a cell toolbar button to trigger it.
In my implementation, in addition to the cell stderr, I also submit the entire notebook contents and the kernel id as well. Specifically, I submit the active cell id, the entire notebook data (
notebook.model.toJSON()
), and the its kernel id (if active kernel). The chat handler will extract the active cell and error using the active cell id and will also include the previously ran cells. This is inferred by filtering out all code cells before active cell that have a lower execution count (not a perfect logic but approximate enough). Kernel ID currently not used, but idea was to extract some variable information that may help the debugging.Proposed Solution
Building upon what was done in #828. The idea of adding active cell text and error to the message can be generalised further to include more information in the message.
Context data
I propose the following information be included in the context (without opinion on exact data model):
For active notebook:
For active file editor:
Possible enhancements
Selected text as context
Instead of pasting the selected text in the user message, include it as just another context item as above. This will allow chat handlers to differentiate selected text and something the user copypasted.
Additional benefit is it would help clean up the UI as sometimes the selected text can be quite long and end up filling up the chat. See secontion on UI below for how the user is made known of what is selected.
Config
Users should be able to configure what context is submitted. Right now, whether the selection is included is configured below the input box. Perhaps a separate tab or a dropdown may be required if the options grow.
UI
What is included in the context should be shown to the user. There are two possible ways to do this.
The text was updated successfully, but these errors were encountered: