Lastly, the fourth method is video. While this isn’t as commonly used in coding, it’s still an option.
You can upload a video and ask an AI specialized in video operations to, for example, recreate the video with changes or modify a character in the video. However, video-based prompts are expensive and not as widely used in the coding world right now.
Conclusion:
For coding purposes, the best methods of interaction are text and, in some cases, images.
Text is straightforward and effective for generating code, and images can be useful for getting the AI to interpret and write code based on visual content.
Lesson 4.
Prompt architecture
Hello and welcome to Lesson 4 – Prompt Architecture.
In this lesson, I’ll walk you through the basics of prompt design and how to properly structure a prompt.
A basic prompt usually consists of three parts:
Task
Context
Exemplar
Let’s break these down.
The task is the most important part – it’s what you’re asking the AI to do. Without a task, the prompt won’t work at all.
For example, a prompt like “Name fruits” is a task. And the AI might respond with apple, banana, pear, etc.
These could come from anywhere – northern countries, southern countries, Europe, Africa, Australia – all kinds of fruits.
The context is good to have, because it gives your prompt direction.
Let’s say we add: “Tropical ones.” Now the prompt becomes “Name fruits, tropical ones.” The AI now focuses only on tropical fruits. So context helps narrow down the result.
The third part is an exemplar – an example. This one is optional, but useful.
Adding “Example: mango” helps the AI stay focused.
So now the full prompt becomes: “Name fruits, tropical ones. Example: mango.”
Here’s how I personally rank their importance out of 100:
Task: 50%
Context: 40%
Exemplar: 10%
Let’s look at another example – this time, building a city.
Task: Build a city.
Without context, the AI might build any kind of city – something real, imaginary, ancient, futuristic, or something from a game or book.
Context: Let’s say the city should have many trees, be cloudy, rainy, and have a cool climate.
Now the AI will avoid building a city in a hot or dry region.
Exemplar: Seattle.
Adding that helps the AI aim for a similar feel or environment.
Let’s try a coding example now.
Task: Build a form.