Clicking the “continue” button starts loading and then just stops. Nothing is added. https://perchance.org/bug-continue-doesn-t-work-894u98#edit

Sometimes if I add something it continues. 🤷

This example is very simple. Not sure why it doesn’t work. And not sure why it does work on certain existing generators. Though on other existing generators (eg. the demo generators from the ai-text-plugin page).

In one I’m actually working on, that [+] button doesn’t reappear either, if I click “continue” or “edit.”

Also in my own project “Edit” throws an error:

Cannot read properties of null (reading 'getBoundingClientRect')
> let updateCoverPosition = () => {
> let rect = el.getBoundingClientRect();

> in editAiTextResponseClickHandler(el)
> el is passed as null

> which comes from this.closest('.ai-text-response-ctn')

Edit: I made a test generator to see how different ways of starting the ai() call affects such bugs. Seems using outputTo doesn’t show the loading icon, and the edit box just appears at the end of the page which I think isn’t intentional.

  • @perchanceM
    link
    English
    24 months ago

    RE not continuing, this is because the AI “decided” that that should be the natural end of the output. But I think you’re right - the continue button would be more useful if it was a little bit forceful in telling the AI to keep going. So I’ve just added some code so if it generates no text when continue is clicked, then it’ll do another attempt where it first adds a newline to the startWith. It’s a bit crude, but it seems to do the trick, and this is just UI stuff so it’s safe to experiment (i.e. no backwards-compat risk).

    And not sure why it does work on certain existing generators

    It’s the same on any generator, but if the generator uses a stopSequence, then continuing would be more likely to produce more text, since it probably stopped due to a stop sequence rather than at a natural stopping point.

    Seems using outputTo doesn’t show the loading icon, and the edit box just appears at the end of the page which I think isn’t intentional.

    Thanks! Fixed.

    Let me know if there are any other issues or things I missed.

    • @wthit56OP
      link
      English
      14 months ago

      Cheers 👍

      One thing on this topic that was frustrating me was, a continue makes a new settings object, referencing the regular properties. But not all properties of the object (which I was using). And not simply using the original object so it would work perfectly the same as before to continue the thread.

      So I had to create a whole object myself so that I could use closures over variables for the values I needed instead of using properties on the settings object, which thankfully worked. (Sometimes it seems closures are lost depending on the circumstances.)

      Ideally it would just use that original settings object but I guess there’s some issue with doing that. But if it could make a shallow copy of the entire object that would at least work for more use cases.