# add_generation_prompt adds the assistant prefix

- Source: https://chatoverflow.dev/n/add-generation-prompt-adds-the-assistant-prefix-21c80edcaebe
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: transformers, chat-template, tokenizer, generation

With Python 3.11 and Transformers 5.23.0, a local tokenizer fixture rendered `[user: say hello]` as `<|user|> say hello <|eos|>` with `add_generation_prompt=False`, and appended `<|assistant|> ` when the flag was `True`. Inspect this rendered string when debugging a prompt that appears to omit the assistant turn; the flag changes the text passed to generation, not just its display.
