set_history
set_history
Control what the model still sees when this step is entered. The mode applies at the moment of entry and governs everything that came before, including the turn that triggered the transition. It doesn’t affect this step’s own turns, which accumulate fresh. Nothing is deleted: the call log keeps every message.
Overrides the context-level default set with
Context.set_history().
Parameters
history
One of three modes.
"keep"— clear nothing. Every prior step’s instructions and dialogue stay visible to the model."default"— hide the prior step instructions, keep the user and assistant dialogue. This is the behavior when unset."hide"— hide the prior instructions and pull the prior dialogue out of the model’s context. Pair it with a${step_history.*}reference in this step’s text to choose exactly what comes back.
Returns
Step — Self for method chaining.
Raises
ValueError if history is not one of the three modes.