Rules for getting consistent structured output from Perplexity using few-shot prompting techniques, with format specification and validation guidelines.
When you need structured output from Perplexity, use few-shot prompting with these rules:
1. PROVIDE EXAMPLES: Always give 1-2 examples of the exact output format you want before asking your question. Example:
Input: "Apple Inc"
Output: {"company": "Apple Inc", "sector": "Technology", "market_cap": "$3.4T", "pe_ratio": 33.2, "source": "Yahoo Finance, Dec 2024"}
Now do the same for: "Microsoft"
2. SPECIFY FORMAT: Explicitly state the output format: JSON, markdown table, CSV, bullet list, or numbered steps. Perplexity follows format instructions well when they are explicit.
3. FIELD REQUIREMENTS: List required fields and their data types. Example: "Include: name (string), price (number in USD), rating (number 1-5), source_url (valid URL)."
4. NULL HANDLING: Instruct how to handle missing data: "If a field cannot be found, use null rather than guessing."
5. ARRAY OUTPUT: For lists of items, specify minimum and maximum count: "Return exactly 10 results" or "Return between 5-15 results."
6. VALIDATION: Add validation rules: "Ensure all URLs are valid and accessible. Ensure all dates are in ISO 8601 format."Perplexity Space rules for researching AI ethics, governance frameworks, responsible AI practices, and regulatory developments in artificial intelligence.
Perplexity Space configuration for researching climate science, energy policy, sustainability metrics, and environmental regulations with scientific rigor.
Perplexity Space rules for researching talent markets, compensation benchmarks, hiring trends, and building data-backed recruitment strategies.
Perplexity Space configuration for cybersecurity threat intelligence research, vulnerability tracking, incident analysis, and security posture assessment.
Rules for controlling Perplexity's output format, citation style, depth of analysis, and response structure for professional research workflows.
Perplexity Space configuration for tracking and researching regulatory compliance requirements across industries and jurisdictions.