PromptForge
Prompt library

Structured Output (JSON & Tables) — Hugging Face (open-source)

Hugging Face (open-source)Fundamentals From a course

When you need output your app or spreadsheet can actually use, explicitly request a schema.

The prompt

System: Respond only with valid JSON matching this schema: {"summary": string, "sentiment": "positive"|"neutral"|"negative", "keywords": string[]}. User: [paste customer feedback]

What to replace

Swap these placeholders for your own details before running the prompt:

  • [paste customer feedback]your own value

Pro tip: Always show the exact JSON schema in the prompt itself — models follow explicit key names far more reliably than vague descriptions.

How to use this prompt

  1. Copy the prompt using the button above.
  2. Replace [paste customer feedback] with your own details — the more specific you are, the better the output.
  3. Paste it into Hugging Face (open-source) and run it.
  4. If the answer feels generic, add constraints: audience, length, tone, and what to avoid. That single change fixes most weak output.

Learn the technique

Structured Output (JSON & Tables)

Module 2 — Core Techniques · Prompt Engineering Fundamentals

Related prompts