Counting words afterwards is not the issue. There’s plenty of ways to do that. It’s more a matter of getting it to generate the number of words requested, with say a 10% allowance either way. Well, if I was requesting this as a feature I’d also ask for it to be possible to specify the margin of error. For instance,
“Write a description for a YouTube video about Trafalgar Square in London, 500 words, 10% more or less”
That gave me 464 words when I tried it. Actually, if my maths is correct, the word count this time is as requested.
“Write a description for a YouTube video about St Martin in the Fields chuch in London, including nearby attractions, 400 words, 10% more or less”
Result - 432 words. Hmmm. Is the clue to getting this to work the specification of margin of error?