I’ve run in to a few unique problem that I hope someone can lend a hand with.
I have an app where a user can input/type dynamic choices in to a multiline dropdown (see below)
When the user presses the “Generate” button, an API call is triggered to ChatGPT which then sends back a small blog post based on those words input in to the multiline dropdown.
That’s all working as I want it to. However, if I copy and paste those words from an external source in to the multiline dropdown and then press generate, an issue arises where three or four words will be added on their own line before it outputs what it should. See below as an example.
As you can see, it’s added “,cultured restaurants” before outputting the correct thing.
Now I’ve done endless testing on this problem and have found that when the descriptive words are typed then the output comes back as it should. But when I copy and paste the descriptive words from somewhere else, it add’s random words to the beginning of the output.
Can anyone point out where I’m going wrong? Or is there a way that I can run a workflow (regex maybe??) that trims or removes the first line of a sentence if it has less than 10 words before saving to the DB?