Promptles
Prompt Engineering Basics

Example-Driven Prompting

beginner

Definition

Showing the AI a concrete example of the input and output you expect, rather than only describing it in words. Examples remove ambiguity because the AI can pattern-match on what you showed, not just what you said.

In the wild

'Write a function that formats names. Example: formatName('john', 'doe') should return 'Doe, John'.' The example makes the capitalization and ordering crystal clear without needing a paragraph of explanation.

More from Prompt Engineering Basics