Skip to content
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

Let the AI Suggest Markup Cells #284

Closed
jlewi opened this issue Oct 8, 2024 · 1 comment
Closed

Let the AI Suggest Markup Cells #284

jlewi opened this issue Oct 8, 2024 · 1 comment

Comments

@jlewi
Copy link
Owner

jlewi commented Oct 8, 2024

Once we fix #168 we will be able to render markup cells as ghost cells. So we could potentially have the AI start generating ghost markup cells.

This requires thinking through and changing a number of things.

  1. Currently, we only trigger if the selected cell is a markup cell

    func shouldTrigger(doc *v1alpha1.Doc, selectedIndex int32) bool {

    • This was a cost saving measure. Now that we are using gpt4o-mini which is pretty cheap we should be able to remove this
  2. We postprocess the completion to only return the code block

    func postProcessBlocks(blocks []*v1alpha1.Block) ([]*v1alpha1.Block, error) {

Its not entirely clear how we should change the post-processing. There's a couple different situations to consider

  1. If the selected cell is a code cell; it might be reasonable to try to insert a markup cell that reasons about the results and figures out what to do next

  2. If the current cell is a code cell; it sometimes will be reasonable to respond with a code cell that provides a plan about how to accomplish some task.

    • This would be useful when posing a question such as "Why isn't my application working."
jlewi added a commit that referenced this issue Oct 8, 2024
jlewi added a commit that referenced this issue Oct 23, 2024
## Suggest Markup Cells

* Now that the frontend can render markup as ghost cells we want the
agent to start generating them
* This will allow the AI to 
1. Reason about the outputs of commands - e.g. interpret whether the
output supports or refutes a hypothesis
   2. Suggest markup cells containing plans

* Related to #284

* Don't restrict the response to a single code block. 
  * Now that we can render markup cells as ghost cells
  * We should allow multi-block responses that can include markup cells

## Change PostProcessing of responses

* We no longer limit the response to a single code block.
* We allow at most 2 blocks; one markup and one code cell
* We do this because from a UX experience generating multiple cells is
confusing
* If there are multiple markup blocks in sequence we merge them into one
block
  * This is less confusing for users
* I believe the multiple cells is an artifact of Runme parses markup
into blocks.
* Drop any cells after the first code block in the response


* Remove the hack which only generated completions if the current cell
was a markup cell. We should generate completions even if the cell is
code or output cell
* This was a cost saving measure. However, switching to gpt4o-mini
should have sufficiently reduced costs that we can afford to generate
completions on all cells.
@jlewi
Copy link
Owner Author

jlewi commented Oct 23, 2024

Fixed by #285

@jlewi jlewi closed this as completed Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant