feat: editing response textboxes should stop GPT generation
transmissions11 opened this issue · 9 comments
alternative: if you edit the textbox while its generating, it stops streaming in the response immediately
alternative: if you edit the textbox while its generating, it stops streaming in the response immediately
It would be best to do like that with proper debouncing.
@h0tw4t3r can you explain how debouncing comes into play here? i think we'd just mark the node as non generating and then can update the openai streaming logic to check a node is still marked as generating before appending text
@h0tw4t3r can you explain how debouncing comes into play here? i think we'd just mark the node as non generating and then can update the openai streaming logic to check a node is still marked as generating before appending text
oh I'm sorry, taking my words back. I thought about not just stopping the request but reinitiating it on text change.
As long as it is not possible to go back from an edit if nothing has been changed (prompt/temperature) it should go back and show the existing ongoing stream.
If an edit has been saved then it should cancel the stream or ignore it and start a new stream. Currently it mixes both results together in gibberish and you will have to reload to fix it.
on this issue tho, given this PR introduces an edit button for GPT nodes, we can/should just re-use that button space for a stop button, and not allowing editing at all during generation. knock out two birds w/ one stone.
cc @ghgoodreau
Yeah I agree, it should be straightforward to just render a big red button while the text is generating where the previous edit button was. I'll look into tackling that for my next PR if it hasn't been fixed by then
technically closed, though with a caveat:
hmmm ok just realized the way we've set things up, setting one node's streamId to
undefined
stops the whole stream and thus all their siblings. would have to not or conditionally abort the stream if we wanted the ability to pause generation of a specific child. i think this behavior is fine for now though, as its strictly an improvement over the status quo. good work for a future PR if folks complain :p