-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
AI generated content in markdown is messy #58
Comments
Yeahhh I noticed that too – might need to coerce that to plaintext for now |
That would have issue too. Previously, the gtp response would have a nice format but any editing of the response would cause the text to lose all the line break. I could not find a solution to that problem at the moment. |
Removed markdown formatting from the prompt for now until we figure out a solution for this: 97b0c49 |
I will try to tackle this problem on Thursday. My hacky way to preserve line breaks and format previously was to put text in blackquote onFinish
|
@jt6677 yeah that's smart! The root of the issue is streaming response doesn't play well with the way they're converted into markdown by Setting everything with |
@steven-tey I came close with a solution.
The problem is setContent would work but not insertContent. setContent replaces everything. Maybe someone with better knowledge with tiptap would know what to do here. |
@jt6677 ended up doing the same thing. |
yeah, tiptap markdown does not play nice with streamed response. You either need to escape all the markdown syntax while streaming then set it again or just no using markdown at all. I delete the markdown plugin because the markdown was just too unpredictable. |
@steven-tey, really appreciate your work. From Vercel's Platforms Starter Kit to this awesome UI editor! Format gets broken as the generated markdown text streams into the editor. Solution is replacing the whole content iteratively instead of just inserting the diff so instead of
remove the last appended completion + append the whole new completion again to let the editor fix the formatting:
|
@andrewdoro This issue is likely resolved by the new AI implementation since it's not streamed into the editor directly. |
@haydenbleasel Yep thanks for the tag here. So the new AI implementation works with Markdown. We no longer have a working example for the old I also recommend the new approach. This is what Notion also uses. |
@andrewdoro I need to stream AI content directly into the editor. Isn't there a way of doing this? I almost finished the project and encountered this problem. I should start from scratch using a different editor if I cannot find a solution. |
openAI's response does not play nice with new markdown feature. My guess you need to force the response to be plain text.
The text was updated successfully, but these errors were encountered: