set_history

View as MarkdownOpen in Claude

Set the default visibility mode for every step in this context. A step’s own set_history() overrides it. See that page for what each mode does.

Parameters

history
strRequired

One of "keep", "default", or "hide".

Returns

Context — Self for method chaining.

Raises

ValueError if history is not one of the three modes.

Example

from signalwire import AgentBase
agent = AgentBase(name="my-agent", route="/agent")
contexts = agent.define_contexts()
ctx = contexts.add_context("default").set_history("hide")
ctx.add_step("greet").set_text("Greet the caller.")
ctx.add_step("help").set_text("Previously: ${step_history.prev.summary}. Help them.")
agent.serve()