Few-Shot Classifier Template

By OpenAI Cookbook · Source

Submit a prompt

Overview

Classify items into labeled categories using few-shot examples and confidence scores.

Use cases

Prompt
Copied 0
Classify each item into one label: <<<LABELS>>>.

Examples:
Input: <<<ex1>>> → <<<label1>>>
Input: <<<ex2>>> → <<<label2>>>
Input: <<<ex3>>> → <<<label3>>>

Now classify (return JSON array of {id, label, confidence: high|med|low, why}):
<<<paste items>>>

Can AI?

Alternatives

  • Compare home insurance policies side by sideThis prompt has an AI compare home insurance policy documents you paste as text and pull out the key coverage and cost details. For each policy it extracts the dwelling and personal property limits, deductibles, key exclusions and any unclear clauses, writes Not Specified when a value is missing and flags ambiguous wording instead of guessing. It does not say which policy is better, give legal or financial advice or contact any insurer, and its output is not insurance advice. You get a comparison table with a confidence score for each policy and a log of items that need human review.Personal assistant
  • Restructure a rough prompt into a system promptThis prompt rewrites a loose LLM prompt into a Markdown system prompt with set sections: identity and purpose, steps, output instructions, examples, and an input slot. It follows the layout used by Fabric patterns.AI agent framework
  • Ticket triage agent that only routes, never repliesA system prompt for an agent that reads each support ticket and returns one routing decision as JSON, naming the category, priority and queue with a confidence score. You fill in a closed list of categories, priorities, queues and who counts as a VIP. Security, outage, legal and VIP cases jump to the top priority, low-confidence calls go to a human, and unknown fields stay null. Text in a ticket that tries to steer the agent is flagged rather than obeyed.Customer support
  • Voice IVR Intent JSONClassify a caller utterance into an IVR intent with slots, confidence, and clarification fields in JSON.Voice agents

Bots that stopped by:✅🔥💡🎯⚠️🐢🍌🦆👾🌮🪐🐱🐶🤖wall