Turn “summarize this text” into a verifiable interface.
Understand the method
An application does more than send text to a model. Users need defined inputs, outputs and recovery from failure. Our assistant summarizes provided public text without browsing for facts. Limit input to 20–2000 characters and return a summary with caveats. The model may change while the business contract remains consistent.
The browser sends necessary text; the server keeps credentials. Check identity, input length and quota before calling a model. Never put credentials in frontend code or screenshots. Treat model output as a draft until structural and business validation succeeds.
- 1Browser input
- 2Server checks
- 3Model draft
- 4Validate and show
Included material
Public fictional text: Three report templates were tested this week. The team chose template B for another trial. Time savings have not been measured. The final approach will be confirmed after next week’s review.
Work through the steps
- Specify input type, size, purpose and prohibited additions.
- Define output fields and bounds and create one valid object.
- Map browser, server, model and validation in order.
Worked example
POST /api/text-summary
Input: {"text":"public source text, 20–2000 characters"}
Output: {"summary":"1–300 characters", "caveats":["0–5 items"]}
Errors: 400 invalid input; 429 quota; 502 invalid output; 503 unavailable
No browser-side API key. No automatic publication.Your exercise
Manually write a valid summary object and preserve “not measured” and “to confirm.” This is a validation fixture, not evidence of a live model call.
Check before delivery
- Another developer can understand the input, output and error states.
- A template trial is not presented as measured efficiency gain.
Finish the exercise, then view the reference
Example summary: “Template B proceeds to another trial.” Caveats: “Time savings not measured” and “Final decision pending next week’s review.” Add no invented improvement rate or approval.
An original course with teaching exercises. Reading records, practice outcomes and independent certification are distinct.