AI Prompt Engineering Assistant

Iman Johari
4 min readJun 6, 2024

--

Introduction

Having worked in various AI projects, prompt engineering is one of the major steps that we need to perform before we can capture the magic of generative AI.

Some prompt are easy to make and some may take a bit longer however it always helps if we don’t have to start from scratch.

Let’s explore how we can leverage IBM Watsonx.Ai platform to make our life may be an epsilon easier.

Approach

IBM Watsonx.Ai hosts a number of foundation models. We can both manually and programmatically select these models for our AI use cases.

In addition to the hosted models, Watsonx.ai let’s you bring your own custom foundation model into the platform.

Question answering is one of the most famous AI use cases, it would be beneficial to have an AI point of view about the prompts we want to create on the subject before start building AI application.

This is the question of “how to ask”! Imagine there is a very smart person in the room and you want to ask them a question about a subject. There are also various smart people on the room as well, it would be beneficial to ask all these smart people how you should articulate your question before asking the other smart guy.

May be you listen to one of them, may be you modify your question to include some of the suggestion made by some of the smart people in the room or may be you ignore all suggestions and ask your own question the way you want it. You have at least some options.

I have developed a simple tool that leverages set of foundation models hosted on the Watsonx.Ai platform. By providing a short description of your prompt subject, this tool it offers you various detailed, workable prompt suggestions to start your AI application!

It is always better not to start from scratch; in the image below, I have selected 4 foundation models and prompts about “extracting places, dates and people” generated from these foundation models, are visible in the centre of the page .

Architecture

This application has an html client that talks to a backend rest server which communicates with Watsonx.Ai.

Alternatively instead of using the user interface another 3rd party system can communicate with this system and request for prompts programmatically as well.

The interaction is quite simple :

1- AI engineer navigates to the index.html of AI Prompt Generator application and clicks on the hamburger menu on top left.

2- A REST call [/models] is initiated to get all the available foundation models hosted on Watsonx.Ai and the models are returned to the User Interface; AI engineer can select various foundation models for prompt generation.

3- AI Engineer gives a short description of the prompt and clicks on “Suggest prompts” button. This will initiate a second rest call [/getprompts] to pass the prompt subject to each foundation model and to generate a prompt for each foundation model.

e.g. a prompt to classify an email with time-sensitive or non-time-sensitive — my output should be json

4- For each selected model the generated prompt is shown and AI Engineer can choose to use or modify them in their AI application.

--

--

No responses yet