Built with Bolt.new badge

Using Examples

How to use examples to guide AI responses.

Using Examples in Prompts

Providing examples in your prompt helps the AI understand the format and style you want. Examples act as templates, showing the model what kind of output you expect. This is especially useful for complex tasks, formatting requirements, or when you want to match a specific tone.

Why Use Examples?

  • Clarifies expectations: The AI can mimic the structure and style of your example.
  • Reduces ambiguity: Examples show exactly what you want, leaving less room for misinterpretation.
  • Improves consistency: The model is more likely to produce similar outputs across different runs.

Example

Translate the following sentences to French:
- Hello, how are you?
- What time is it?

Expanded Example:

Translate the following sentences to French. Provide the translation in a numbered list, and include a brief explanation for any idiomatic phrases:
- It's raining cats and dogs.
- Break a leg!

Best Practices for Using Examples

  • Include at least one example for complex or unfamiliar tasks.
  • Use examples to demonstrate both correct and incorrect outputs if needed.
  • Reference your example in the prompt (e.g., "Follow the format above").

Further Reading