Overview
Sample Response
Generate a short preview output before committing to a full response
previewgatingquality-check
Props
| Prop | Type | Default | Description |
|---|---|---|---|
sample | string | undefined | Optional preview text generated for the sample response |
prompt | string | undefined | Optional prompt context displayed with the sample |
onGenerateSample | () => void | required | Callback fired to request a new sample response |
onRegenerateSample | () => void | undefined | Optional callback fired to regenerate the sample |
onAcceptSample | () => void | undefined | Optional callback fired to proceed with full generation |
isGenerating | boolean | false | Whether sample generation is currently in progress |
title | string | "Sample Response" | Optional heading for the sample response component |
variant | "card" | "inline" | "card" | Display style for previewing the sample response |
Docs
Sample Response provides a lightweight preview of what the AI is likely to produce before the user commits to a full generation run. It helps users validate direction, tone, and relevance early, reducing wasted compute and unnecessary long outputs.
Variants
- Inline sample — A compact preview shown directly near the prompt controls for fast iteration.
- Card preview — A richer preview panel with prompt context and explicit follow-up actions.
- Sample-to-full gate — Users must review and accept a sample before triggering the full response.
Use Cases
- Checking tone and scope before generating long-form content
- Reducing token spend in high-cost model workflows
- Validating prompt quality during iterative prompt engineering
- Previewing output style for stakeholder approval flows
- Guarding against irrelevant responses in agentic pipelines
Best Practices
- Keep samples short and representative rather than exhaustive.
- Make the transition from sample to full response explicit.
- Offer one-click regenerate so users can quickly compare alternatives.
- Show loading feedback to distinguish preview latency from full generation time.
- Retain prompt context near the sample so users can evaluate alignment.