You're going to design the configuration for a 3-step chain. Not code you run. a declarative artifact (YAML) that a chain runtime can read and execute step by step.
Each step has four fields:
- id: classify_report # unique step identifier
prompt: | # the LLM prompt
You are a classifier...
Text: {{ report }}
input: # where to source the placeholders
report: chain.input.text
output_key: category # under what name to store the resultThe runtime executes the steps in order. After the first step, the context has category with the classifier's output. The second step can use it as {{ category }} in its prompt.
Process reports like:
"Bay 4: valve 7 keeps triggering an intermittent alarm since last night."
And return at the end:
{
"category": "maintenance",
"fields": { "system": "bay 4 valve 7", "issue": "intermittent alarm", "time": "since last night" },
"summary": "Bay 4 valve 7 has intermittent alarm since last night."
}Three steps, each with a unique responsibility, all chained via explicit output_keys.
5 LLM-judge criteria on:
Designing a good chain is software engineering more than prompting. Think of each step as a pure function. Declared inputs, declared output, no surprises.