A rail operator's support team wants a Flex prompt template that writes a wrap-up summary for lost-luggage cases. Every summary must use exactly four sections: 'Issue', 'Steps Taken', 'Outcome' and 'Follow-up'. When there is no follow-up, that section must read 'No further action needed.' Which approach most reliably produces this structure?
- Send the raw model output to a flow and use Apex string handling to rebuild it into the four sections.
- Spell out the four section headings and the conditional wording rule directly in the template's format and constraint instructions.
- Use chain-of-thought prompting so the model first lists the four headings and then reasons through the content of each.
Show answer
Answer: B
Why: The most direct way to get a fixed output structure is to state it explicitly in the prompt: name the headings and give the conditional rule for an empty section. Clear format and constraint instructions guide the LLM without extra code or reasoning steps.