The requirement is a chain that fills a prompt template with a user's question, calls a model, and returns plain text. Which composition fits?
- Exam domain
- Application Development30% of the exam
- Difficulty
- Easy
- In this mock
- 16 questions on this domainPractise this domain
Why the exam asks this
Section 4: Assembling and Deploying Applications (22%).
Objective in the exam guide: Code a simple chain according to requirements
Coding a simple chain is named in the objective.
Why C is the answer
Prompt template, then chat model, then a string output parser
A simple chain runs in data order: the template builds the prompt, the model answers, and the parser returns text.
How it works
A prompt template turns input into a prompt.
The model generates a response.
An output parser shapes the response for the caller.
Clues in the question
The words that point to the answer, and what each one tells you.
- Fill template, call model, return text
- Template, model, parser.
In detail
- Order follows the data: input, prompt, model, parser.
- Add retrieval only when the requirement needs documents.
Side by side with look-alikes
| Order | Works? |
|---|---|
| Template, model, parser | Yes |
| Model, template, index | No |
| Parser, template, model | No |
| Index, parser, no model | No |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Output parser, then prompt template, then chat modelWrongMost tempting
The parser must come last.
Why it tempts: It has the right parts. But the parser needs model output, so it comes last.
B. Vector index, then output parser, with no modelWrong
With no model, nothing generates an answer.
C. Prompt template, then chat model, then a string output parserRight
A simple chain runs in data order: the template builds the prompt, the model answers, and the parser returns text.
D. Chat model, then prompt template, then a vector indexWrong
The template must come before the model.
In practice
- Log the chain with MLflow so it can be served.