LLM stream to generate markdown text and insert to editor #5967
Replies: 3 comments 4 replies
-
|
Hello were you able to figure it out. |
Beta Was this translation helpful? Give feedback.
-
|
I had a similar issue. U can solve this if u replace
but in my case i'm not streaming chunk by chunk ... but instead I wait for the whole result and add this result only once ... |
Beta Was this translation helpful? Give feedback.
-
|
For anyone else trying to implement this, I got a version working that supports markdown with tables using lexical's HTML converter and showdown, and vercel AI sdk: Not sure if clearing the editor and inserting all the nodes again is the best way... I couldn't find a way to set the editor state from a set of nodes directly. lexicalexample.mp4 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I'm quite new to Lexical and have been experimenting with using AI streams to create markdown text in an editor.
Typing directly into the editor works fine.
keyboard.mov
But I'm encountering issues when trying to insert text from the AI stream into the editor.
llm.mov
Currently, I'm using
selection.insertRawText(chunk)for this purpose. Could you help me figure out if I'm missing something? Thanks a lot!Beta Was this translation helpful? Give feedback.
All reactions