A placeholder marks variable data inside a prompt template. Static instructions surround positions such as {game} and {question}; Spring AI fills those positions before submitting the completed prompt to an LLM. section 3.1 section 3.1.1
Use placeholders to keep prompt construction explicit and maintainable:
- Define the reusable prompt as a StringTemplate or external template resource. section 3.1.1 section 11.2.1
- Name a placeholder for each variable value, such as a game, question, source language, target language, or source text. section 3.1.1 section 11.2.1
- Pass the template through ChatClient user configuration and call param() for each value before calling the model. section 3.1.1
Tabletop-game question
A template such as “Answer this question about {game}: {question}” can receive “checkers” and “How many pieces are there?” at request time, producing a focused prompt and answer. section 3.1.1






