Banner image for the oik-ai plugin
oik-ai banner
oik-ai banner image for a plugin called oik-ai, slogan “OIK-AI the new”, that uses artificial intelligence to generate text and images from user’s prompts
Generated by oik-ai using DALL·E 3. The original image was cropped, scaled to 250 pixels high, then centred in a 772 pixel wide WordPress banner.

oik-ai – the new – my AI tool

oik-ai is my AI tool. It uses OpenAI to respond to freeform prompts to generate or manipulate content for my WordPress websites.

It’s my experimental tool for playing with AI. I wanted to learn how to use AI to Enhance Search, but first I had to get to grips with the functionality that I’ve been cataloguing in this site. Wherever I refer to “my AI tool”, it’s this code that I’m talking about.

Text content generation and manipulation

Standard prompts

Edit prompts.json to add more standard prompts or change existing prompts.

The chat part of the implementation offers several Standard prompts that are passed to OpenAI as part of the Message structure.

If you choose None, leave the other fields empty, and press the Send button, then the response is

Hello! How can I assist you today?

Several of the other prompts will also result in an AI generated response that appears to have been plucked from nowhere. Others will say there’s something missing.

System message and User message

These fields are where you customise the prompt and provide the content to be manipulated. eg. For Translate to

French

oik-ai – the new – my AI tool

We get the response in the Assistant message.

Assistant message

oik-ai – le nouveau – mon outil d’IA

I then copy and paste the response into the relevant part of the website.

The word stop indicates the finish_reason of the request.

Manipulation

When I want to manipulate content I write a System Message saying what I want done and paste the original content in the User Message.

Differences between oik-ai and ChatGPT tools

The OpenAI model allows you to pass multiple sets of User Message and Assistant Message, thereby implementing a conversation. If you use ChatGPT you can have a conversation. I’ve been using oik-ai instructively… I write what I want and expect the answer first time. If I don’t get the answer I wanted I modify my System and User messages and try again. Sometimes it works, sometimes it does.

Image generation

DALL·E 3 can generate images in 3 different sizes:

  • Square – use the button labelled `Image: 1024×1024
  • Portrait: 1024×1792
  • Landscape: 1792×1024

If you want a different sized image you’ll have to manipulate the generated image yourself.

To generate an image ( DALL·E 3 can only do one at time ),

  • choose prompt of None,
  • enter the first part of your request in the System Message
  • and the details in the User Message.
  • Press the button for the image size you want.

oik-ai uses the System Message to construct the filename for the generated image. Each image is automatically saved.

For a random image just click on an image button.

About the code in oik-ai

I started building oik-ai it in November 2023. Written in PHP it uses the OpenAI PHP client library. At present it’s not actually a WordPress plugin. It’s some standalone PHP that I run in my local development environment. I’ve only recently bundled the code into a WordPress plugin, but I’ve not actually integrated it with WordPress. It’s currently dependent upon some of my code which is in a private repository, so it’s not something you can download and try.

It uses some hardcoded directories to read and write files.

  • saved – to store the prompt/response history for both text and image requests as .json files
  • ai – ( C:\apache\htdocs\ai ) where it stores images as .png files

References

  • openai-php/client – OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
  • bobbingwide/oik-ai – the source code for my AI tool.

Categories

, , , , , , , ,

Information


Excerpt

oik-ai is my AI tool. It uses OpenAI to generate and manipulate content for WordPress websites. The tool provides standard prompts, allows for content manipulation, and can generate images in three different sizes. Originally, not a WordPress plugin, it’s now bundled as one but is currently not integrated with WordPress.


SEO info

Related

AI tools for developers – image generation experiment Using AI tools, the author generates abstract images based on the prompt “AI tools for developers. Style: Abstract. Color: Inverse. Special effects: bokeh”. Different outcomes are produced with the top left image being chosen as the featured image. The same prompt is further elaborated and re-run on the AI tool.
DALL·E 3 image generator prompts crib sheet These crib sheets are designed to inspire your prompts for DALL·E 3, offering a wide range of categories to explore. For example, a simple subject prompt could be: “Shadowy beagle. Lighting: Moonlight. Composition: Reflections. Special effects: Edge detection.” Other options encompass various artists, styles, photography techniques, lighting strategies, subject matters, camera settings, compositional elements, resolutions, colors, and special effects.
Convert HTML select to list block and sort The author attempts to convert an HTML select list into an ordered list for a cheat sheet, utilizing AI to generate the list. The first attempt produces satisfactory results, but the second attempt shows clear discrepancies. Finally, they realize that the option values, not labels, were necessary for their intended task. Their concluding advice: ‘Don’t forget to check the output of the AI tool.’
Sorting a list of AI tools in ascending order_sg Sorting a list using an AI tool rendered an ascending sequence of various tech tools, including Altis Accelerate, ClassifAI, Elementor Pro, SEO Press Pro, and Yoast SEO among others.
Create Custom code Here’s an example of a WordPress shortcode named [ai]. This shortcode returns the text “Artificial Intelligence is amazing!”. The shortcode can be called in WordPress posts or pages using [ai]. This code should be added into your theme’s functions.php file. Make sure to back up your website before making changes.
5 recommendations for using AI in WordPress in 2024 Here are the top five recommendations for using AI in WordPress in 2024: AI for SEO Optimization, AI Chatbots for Customer Service, Smart Content Recommendations, Spam Filtering, and Automating Routine Tasks. Enjoy the efficiency and smart, user-friendly interface that AI brings!
Obfuscated text reverser The author uses a plugin called bbboing to generate obfuscated text, which is then fed into an AI tool. The obfuscated paragraph states that according to a researcher at Cambridge, humans can still read words even if their letters are jumbled, as long as the first and last letters are correct.
AI predictions from CSV data Utilizing an estimation approach with data provided, the AI predicts that total downloads will reach 10 billion around February or March of 2024. This estimation is based on a calculated average increase of around 80-90million downloads per month in 2023. However, this is a rough estimation, and actual results may vary based on the actual growth rate.
Reformat dates in a CSV The author used AI to convert a CSV’s date format from “Mon YY” to “YYYY-MM-DD”, using the last day of the month for day. Subsequently, this data was used to create a timeline supported chart.
Converting a list to a table I wanted to convert something that I’d started writing as a nested list into a table. Convert this Gutenberg nested list into a Gutenberg table block with 3 columns: Service, Chat, Image. The nested list items are the values for the Chat and Image cells.
Custom CSS – Improve bw_plug table formatting Improved bw_plug table formatting with custom CSS, adding vertical padding, full width, and collapsing cell borders. Changed background and padding for th cells. Corrected selectors by removing unwanted dots. Chat 3.5 provided correct selectors for the same query.
oik-ai – 7 reasons for using AI plugins in WordPress This post explores the significant role of AI in enhancing WordPress functionality and user experience. It digests the benefits of incorporating AI plugins on a WordPress site, including improving SEO performance, enhancing user experience, advanced analytics, better content management, and augmenting digital presence.

Navigation