passionweb-manuel-schnabel / ai-seo-helper

Generates SEO metadata based on content using AI. Currently several metadata for pages and articles of EXT:news can be generated using an additional button next to the corresponding input fields.
9 stars 5 forks source link

Length of meta description configurable? #1

Closed wowaTYPO3 closed 1 year ago

wowaTYPO3 commented 1 year ago

Nice extension, I will eventually introduce it on my YouTube channel.

Small problem: the generated descriptions are usually way too long. Is it possible to configure somehow that the texts should be for example maximum X characters long?

passionweb-manuel-schnabel commented 1 year ago

1

Thank you for your feedback, the good question and that you are thinking about introducing the extension on your YouTube channel (which, by the way, is very good and has already helped me with some things).

I have already tried a few things in this regard and according to the current status, the best way was to use the following instructions:

"Extract seo meta description in one short sentence and with a maximum of 150 characters or less for following text"

The problem when working with the API is that OpenAI specifies the length of the response in so-called tokens and there is (currently) no way to specify a fixed length of letters. This is of course a challenge, especially when creating a meta description or other texts with a fixed length.

Unfortunately, at this point it is currently only possible to give the AI an instruction that is as precise as possible so that it returns an answer of the desired length.

I'm still trying to figure out how to make it even more precise. If you find a more detailed instruction for the generation of the meta description in the future, I would be happy to hear from you.

I uploaded my current status with version 0.1.3.. I have also added the relevant information and some hints to the documentation so that you can hopefully find your way around quickly and easily.

wowaTYPO3 commented 1 year ago

All right, thanks for the feedback. Okay, then you have to manually adjust the description at the moment. If you use additional extensions like yoast_seo, you will also see a visual hint if the text is too long. So this is not a big deal for now.

passionweb-manuel-schnabel commented 1 year ago

That's definitely a good tip.

I will add the reference to the Yoast SEO Extension and the associated text length check to the extension documentation.

wowaTYPO3 commented 1 year ago

Cool! :) By the way, here is the video ;) https://youtu.be/4_4bzi_CJCA

passionweb-manuel-schnabel commented 1 year ago

Thank you and cool video!

I saw that an error was thrown during the first two attempts. Could you possibly send me more information on this? Unfortunately, I haven't been able to reproduce the behavior on my own.

wowaTYPO3 commented 1 year ago

I only see the message: Error TypeError: Cannot convert undefined or null to object

Other than that, I don't see anything else in the log, var/log/, or the browser console. Where else could I look there?

passionweb-manuel-schnabel commented 1 year ago

Ok, seems like the error is caused in the javascript block. I'll analyze that.

Thanks for the quick info👍

passionweb-manuel-schnabel commented 1 year ago

I was able to reproduce and fix the error now. The problem was the "pointer events" on the span tags within the field controls buttons. If you clicked directly on the icon, this error was always thrown. But it should now be fixed with version 0.1.4.

wowaTYPO3 commented 1 year ago

Yes, everything works now. Cool, thanks a lot! :)