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

Preserve paragraph integrity in generated text #63

Closed

Conversation

jt6677
Copy link

@jt6677 jt6677 commented Jun 29, 2023

This commit parses the generated text into paragraph nodes to preserve the
original paragraph structure OnFinish. Previously, the text was being trimmed into a
single paragraph upon any edits due to the use of '\n\n' for paragraph separation.
With this change, each paragraph maintains its integrity even after edits.

@vercel
Copy link

vercel bot commented Jun 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
novel 🔄 Building (Inspect) Jun 29, 2023 8:10am

@vercel
Copy link

vercel bot commented Jun 29, 2023

@jt6677 is attempting to deploy a commit to the Elegance Team on Vercel.

A member of the Team first needs to authorize it.

@steven-tey
Copy link
Owner

Hmmm just checked this out – it doesn't work unfortunately:

CleanShot 2023-07-07 at 16 58 15

@jt6677
Copy link
Author

jt6677 commented Jul 8, 2023

The code is trying to solve this problem. The code is parsing streamed text into "paragraph text type". It does not know the original numberlist type .
(original)
https:/steven-tey/novel/assets/62420169/8c548607-6ee0-499f-ac22-4e52fa801b6f
(added parsing into paragraphs using"/n/n")
https:/steven-tey/novel/assets/62420169/2cfbd1c5-1686-4b99-94d3-9350284b42b6

@steven-tey
Copy link
Owner

@jt6677 ohhhh gotcha! I will need to think this one through a bit more 🙏

@andrewdoro
Copy link
Collaborator

I'll close this PR because of the recent changed and AI example here #297. For direct streaming we might have a new example

@andrewdoro andrewdoro closed this Mar 5, 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.

3 participants