Menu

Day 3: Prompting Techniques in AI (Part 1)
🖼️

Day 3: Prompting Techniques in AI (Part 1)

DEV Community·Suraj Bera·7 months ago
#SAloPH7a
#ai#webdev#python#softwareengineering#role
Reading 0:00
15s threshold

AI Prompting techniques: Zero-shot, One-shot, Few-shot

After using the ChatGPT and other AI tools, I used to think prompts were just simple text inputs that AI models magically processed. But as mentioned in my Day 1 post: AI models are just next-word predictors , not thinkers. They predict based on training data (though modern ones now use real-time search and tool calling for better results).

The Basics

Simplest python code snippet for getting response from AI

response = client . responses . create ( model = " gpt-5-nano " , input = [ { " role " : " system " , " content " : SYSTEM_PROMPT }, { " role " : " user " , " content " : " How do I reverse a list in Python? " }, ] )

Enter fullscreen mode

Exit fullscreen mode

The most important point to note: role key has 3 values: system , user , assistant . The system prompt sets the behaviour.

1.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.