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

AI Plugin does not preserve all tokens after newlines added #4040

Open
supersimple33 opened this issue Jan 28, 2025 · 4 comments
Open

AI Plugin does not preserve all tokens after newlines added #4040

supersimple33 opened this issue Jan 28, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@supersimple33
Copy link

Description

After a double new line from the llm (or psuedo llm) the editor correctly loads each chunk as its fed in however once they are all loaded the chunks after the first set of double new lines are lost.

Reproduction URL

https://platejs.org/blocks/ai-demo

Reproduction steps

1. Type anything into the text box.
2. hit the ai button and select continue writing

Plate version

43.0.2

Slate React version

0.110.1

Screenshots

Logs

Browsers

No response

@supersimple33 supersimple33 added the bug Something isn't working label Jan 28, 2025
@supersimple33
Copy link
Author

supersimple33 commented Jan 28, 2025

I have found via my testing that if I comment out the onFinish part of the useChatChunk call from useAIChatHooks that fixes this problem. Let me know if that sounds good or if you guys would do it some other way.

@ruimarcosjoao
Copy link

I have the same problem whenever I use the ai feature

@ruimarcosjoao
Copy link

I have found via my testing that if I comment out the onFinish part of the useChatChunk call from useAIChatHooks that fixes this problem. Let me know if that sounds good or if you guys would do it some other way.

I can't find this function anywhere in my code, I'm using the plate-ai template

@supersimple33
Copy link
Author

@ruimarcosjoao take a look at #4041 to see what I did. These edits will probably need to be made in node_modules for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants