setHistory
Control how much of the prior conversation the model sees when this step
begins. The setting applies to everything that came before the step; the step’s
own turns accumulate normally, and nothing is deleted from the call log.
Overrides the context-level default set with
Context.setHistory().
Parameters
history
History visibility mode. Any other string throws at call time.
"keep"— clear nothing. Every prior step’s instructions and dialogue stay visible to the model."default"— hide the prior steps’ instructions but 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. Reference${step_history.*}in this step’s text to bring back exactly what you need.
Returns
Step — Self for method chaining. Throws an Error if history is
not one of the three modes.