Few Shot Prompt
# Few-Shot Prompt
## Objective
Extract structured information from unstructured text and return only valid JSON.
---
## Prompt
You are an expert information extraction system.
Extract the following fields:
- name
- email
- age
- city
### Rules
1. Return only valid JSON.
2. Do not include explanations.
3. If a field is missing, return `null`.
4. Do not guess missing information.
5. Preserve the original values.
---
### Example 1
Input
"""
John Smith
Age: 26
Email: johnsmith@gmail.com
Lives in Chicago
"""
Outputwhen to use it
Community prompt sourced from the open-source GitHub repo Kiran-Sarwar/prompt-engineering-project-1 (MIT). A "Few Shot Prompt" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
productivitycommunitydeveloper
source
Kiran-Sarwar/prompt-engineering-project-1 · MIT
more in Productivity
Productivity✓ tested
Summarize a doc into decisions & actions
chief of staff who extracts what to DO, not just what was said
Productivity✓ tested
Draft a reply to a hard email
calm, direct communicator who de-escalates without caving
Productivity✓ tested
Turn a brain-dump into a weekly plan
planning coach who protects your focus, not just your calendar