@mikeloc @deconinck.louis - I think I’ve managed to fix it. It’s certainly not the cleanest solution but as the problem looks to be with ChatGPT’s API call then someone else might find the solution helpful.
I ended up using the :find-and-replace feature and then added this regex pattern -
^\s*(\b\w+\b\W*){0,8}\n
Then I added a single space to replace it.

Any new line that’s under 8 words gets replaced with a single space and then I :trimmed the space off.
Like I said, it’s not ideal but hopefully someone saves themselves a few hours if they run in to the same problem.