Specify the answer contract before choosing a model
Translate user questions into tasks, schemas and an ordered chain.
Specify the answer contract before choosing a model
Work through the decision
A work-order form needs an asset ID and a deadline from a technician’s note. The note supplies the asset but says nothing about a deadline. The prototype invents a date to complete its JSON. How should the system behave?
Check your reasoning
Choose extraction for fields present in the note. Define a nullable date, accepted formats and an explicit missing-information outcome. Parse and validate the model response before writing to the form. Re-run a case with no date as well as one with an ambiguous date and one with a valid date.
Compare the choices
- Structured output contract
- Define required fields, types and allowed missing values. Use parsing and schema validation before downstream use.
- Classification
- Map an input to one or more permitted categories and define how to handle uncertain cases.
- Information extraction
- Identify fields supported by the input source, retaining missing values and evidence as appropriate.
- Retrieval-augmented generation
- Retrieve relevant authorized material and condition the answer on it. Track source IDs to verify support.
Test the decision
Classification assigns one of a bounded set of labels. Extraction locates a value in evidence. Generation composes an answer. Retrieval brings outside evidence into the request. An application can combine these tasks while keeping each contract testable.
Practice the guide skills
- A downstream system expects JSON with a nullable effective date. Watch 5:39 · Continue at 6:52
Check your answer
Provide the field names, types, allowable nulls and one representative example. Parse and validate the returned object before passing it on, and handle invalid output explicitly.
- A user wants one of six approved request categories. Watch 5:05
Check your answer
Treat it as classification with a bounded label set. Use extraction for fields present in the input and generation for a new narrative. Provide an uncertainty path for ambiguous cases.
- An application must quote current manuals and output a source ID. Watch 9:23 · Continue at 10:19
Check your answer
Assemble query preparation, authorized retrieval, a context-bearing prompt, generation and output validation. Carry the passage IDs through to the final verifier.
Official objectives for this lesson
Related lesson · The Databricks platform
Specify the answer contract before choosing a model quiz
Answer 3 questions. Check each answer for an explanation.