loliklr:)
loliklr:)2w ago

Allowing user to update value streamed from LLM

I am making a chat-like app with ChatGPT using the component https://www.convex.dev/components/persistent-text-streaming. I want the user to be able to edit all the responses after they finish streaming. How can I achieve that? Is it possible to bind a textarea to a convex mutation and have it real time sync?
3 Replies
Convex Bot
Convex Bot2w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
erquhart
erquhart2w ago
As it stands, your best bet is to use the getStreamBody method, and if status is done, write the whole thing to your own table. I could see this being better facilitated in the future within the component, but it would still involve this same sort of step, plus maybe deleting the chunks to avoid double storage. Once you have the chat in your table you can use mutations, queries, and optimistic updates like you normally would to allow the user to edit the chat. cc/ @Ian in case you have thoughts here. I could at least add a method for deleting a stream by id from the component tables. Maybe a future feature would be some sort of status event hook.
ian
ian2w ago
yeah exposing a method to update/delete a message by ID seems reasonable (assuming the message ID is exposed)

Did you find this page helpful?