Library
6 min read
·┌──────────────────────────────────────────────────────────┐ │ ═══════════════════════════════════════════════════ │ │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ │ ──────────────────────────────────────────────────── │ │ ██████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░ │ │ █████████████████████████████████░░░░░░░░░░░░░░░░░░ │ │ ██████████████████████████████████████░░░░░░░░░░░░░ │ │ ████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ │ ──────────────────────────────────────────────────── │ │ ███████████████████████████████████████░░░░░░░░░░░░ │ └──────────────────────────────────────────────────────────┘
A prompt is the text instruction you give to an AI model. It tells the model what you want it to do. Writing good prompts is essential for getting good results from AI.
A prompt is simply the text you send to an AI model. It can be:
[Clear task]: State exactly what you want the AI to do [Context]: Provide relevant background information [Examples]: Show the AI what good output looks like [Constraints]: Specify length, style, format, or other requirements [Tone]: Indicate the desired tone (professional, casual, technical, etc.)
[Zero-shot]: Just ask directly without examples [Few-shot]: Provide a few examples of what you want [Chain-of-thought]: Ask the AI to think step-by-step [Role-playing]: Have the AI act as a specific role or expert
[Too vague]: "Write something about AI" (what kind of something?) [Missing context]: Not providing necessary background information [Too complex]: Trying to do too many things in one prompt [Unclear format]: Not specifying how you want the output formatted
[Be specific]: Clear, detailed prompts produce better results [Provide context]: Give the AI relevant background information [Use examples]: Show what good output looks like [Iterate]: Refine prompts based on results [Break down tasks]: Split complex tasks into smaller prompts
[Bad prompt]: "Write about AI" [Good prompt]: "Write a 500-word blog post explaining what artificial intelligence is for a general audience. Use simple language and include 2-3 real-world examples."
[Bad prompt]: "Fix my code" [Good prompt]: "Review this Python function and fix any bugs. The function should calculate the average of a list of numbers and handle empty lists gracefully."
[System prompts]: Set the AI's behavior and role [Temperature]: Control creativity vs consistency [Max tokens]: Limit response length [Stop sequences]: Tell the AI when to stop generating
Mastering prompting is one of the most valuable skills for working with AI. Good prompts can dramatically improve results.