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

Feat/#218 add ai generation to markdown cells #228

Conversation

Aswanth-c
Copy link
Contributor

@Aswanth-c Aswanth-c commented Aug 29, 2024

Adding ai generation to markdown
@Aswanth-c Aswanth-c marked this pull request as draft August 29, 2024 19:30
- Move getValidationError function inside component
- Adjust onAcceptDiff to update text state and call onSave
- Rename setnewText to setNewText for consistency
- Update error display positioning and styling
@Aswanth-c Aswanth-c marked this pull request as ready for review August 29, 2024 21:43
Copy link
Contributor

@benjreinhart benjreinhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this @Aswanth-c

I pulled down the branch and am trying it out locally. Extracting the AI prompt looks like a good change, but the functionality does not seem to work as I would expect. The goal here is for the AI to generate markdown but the prompts submitted to the models are prompts that instruct the AI to write code. The result is that it seems to mostly generate code in the markdown cell which is not intended -- we want it to write markdown.

I believe we will need a new prompt for this PR.

@Aswanth-c
Copy link
Contributor Author

Aswanth-c commented Aug 30, 2024

Thank you for this @Aswanth-c

I pulled down the branch and am trying it out locally. Extracting the AI prompt looks like a good change, but the functionality does not seem to work as I would expect. The goal here is for the AI to generate markdown but the prompts submitted to the models are prompts that instruct the AI to write code. The result is that it seems to mostly generate code in the markdown cell which is not intended -- we want it to write markdown.

I believe we will need a new prompt for this PR.

Gotcha, I will update the pr with new prompt

@Aswanth-c Aswanth-c marked this pull request as draft August 30, 2024 02:16
@Aswanth-c
Copy link
Contributor Author

Aswanth-c commented Sep 4, 2024

Thank you for this @Aswanth-c

I pulled down the branch and am trying it out locally. Extracting the AI prompt looks like a good change, but the functionality does not seem to work as I would expect. The goal here is for the AI to generate markdown but the prompts submitted to the models are prompts that instruct the AI to write code. The result is that it seems to mostly generate code in the markdown cell which is not intended -- we want it to write markdown.

Update: I have added the prompt,
will do thorough testing

@Aswanth-c Aswanth-c marked this pull request as ready for review September 17, 2024 03:22
Copy link
Contributor

@versecafe versecafe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benjreinhart Works for me and looks good but could you take a look at it, and make sure the prompt is good


Your job is to edit the cell based on the contents of the Srcbook and the user's intent.
Act as a **Markdown expert**, writing the best possible content you can. Focus on being **elegant, concise, and clear**.
**ONLY RETURN THE MARKDOWN TEXT , NO PREAMBULE, NO SUFFIX, NO CODE FENCES (LIKE TRIPLE BACKTICKS) ONLY THE MARKDOWN**.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PREAMBULE should be PREAMBLE

Copy link
Contributor

@nichochar nichochar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a few issues with this and I think it's not worth fixing them as we're changing how the AI works (see app builder branch)

@@ -0,0 +1,85 @@
<!-- srcbook:{"language":"markdown"} -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this in the prompt

1. Title cell (heading 1)
2. N more cells, which are either:
- **Markdown cells** (GitHub flavored Markdown)
- Markdown cells, which have a filename and source content.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong, should be code cells

@Aswanth-c Aswanth-c closed this Oct 15, 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

Successfully merging this pull request may close these issues.

5 participants