OpenAI (ChatGPT) Plugin to create introtext from content

Since ChatGPT is the latest thing.

I made a plugin that uses the API to ask for a summary of the content of a page and adds it to you introtext. It would be a good way to SEO friendly meta-descriptions.

Not very optimized, would be better if it submitted the rendered content for some pages. Use ada for the fastest and cheapest responses, use davinci for better and more costly ones.

import properties

[{"name":"api_key","desc":"","xtype":"textfield","options":[],"value":"sk-XXXXXXXXXXXXXXXXXXX","lexicon":"","overridden":false,"desc_trans":"","area":"","area_trans":"","menu":null},{"name":"api_url","desc":"","xtype":"textfield","options":[],"value":"https://api.openai.com/v1/completions","lexicon":"","overridden":false,"desc_trans":"","area":"","area_trans":"","menu":null},{"name":"model","desc":"OpenAI API models with different capabilities and price points.","xtype":"list","options":[{"text":"text-davinci-003","value":"text-davinci-003","name":"text-davinci-003"},{"text":"text-davinci-002","value":"text-davinci-002","name":"text-davinci-002"},{"text":" text-curie-001","value":" text-curie-001","name":" text-curie-001"},{"text":"text-babbage-001","value":"text-babbage-001","name":"text-babbage-001"},{"text":"text-ada-001","value":"text-ada-001","name":"text-ada-001"},{"text":"davinci","value":"davinci","name":"davinci"},{"text":"curie","value":"curie","name":"curie"},{"text":"babbage","value":"babbage","name":"babbage"},{"text":"ada","value":"ada","name":"ada"}],"value":"text-ada-001","lexicon":"","overridden":false,"desc_trans":"OpenAI API models with different capabilities and price points.","area":"","area_trans":"","menu":null},{"name":"prompt","desc":"Chat completion prompt","xtype":"textfield","options":[],"value":"Write a SEO optimized description without html formatting in 160 words or less for the following...","lexicon":"","overridden":false,"desc_trans":"Chat completion prompt","area":"","area_trans":"","menu":null}]

BTW snippets and plugins should be easier to export and perhaps even built-in to share.

7 Likes

Very cool, Brian! This is a great use-case for AI—it is impressive in its ability to summarize things or “explain _____ to me like I’m in 5th grade” (and so much more).

Great idea!

I tested ChatGPT with this sentence (and no context):

What does this sentence mean?
“Two to nothing Twins in the bottom of the seventh”

Notice that almost none of the words above have their usual meaning, and there’s no reference at all to baseball.

The answer was flawless, except for one tiny error (which I suspect has been corrected, since I told ChatGPT about it) – it assumed that the sentence contained an implication about which team was at bat.

Then I asked it to write the answer in the style of Hemingway, Poe, Shakespeare, Thomas Pynchon, Raymond Chandler, and several other authors. The Shakespeare was pretty bad, but all the others were amazingly convincing. The Hemingway version was spectacular.

It’s amazing, and also very scary.

1 Like

Yes, context one of greatest features. Most of the non-technical people I have seen use chat-gpt, don’t understand that part. You really need to prime the chat a bit before submitting your prompt.

I don’t think you get that with the API. I did make the prompt a parameter, so you can tweak the intro.

My point was that it’s amazingly good at figuring out the context, even with a short, extremely idiomatic, question phrase.

That said, you’re right about it being more difficult for the bot to guess the context inside a MODX site, rather than a situation that’s describing conditions in the “real world.”

So how about generating content from an introtext?! :sweat_smile:

3 Likes

:thinking:

That would actually work.

It doesn’t learn in realtime, it has no memory (past the conversation and reiterating the previous tokens you pass back to it). As far as we’ve been told, they don’t retrain using our conversations either.

Thanks for the info. :slight_smile:

Hi.
I got my api key and created the plugin but I have nothing happening? Can you help me?