Context
A Context represents a distinct conversation mode — like “sales”, “support”, or
“billing” — within a ContextBuilder.
Each context holds an ordered sequence of
Step objects and
configures its own prompt, system prompt, fillers, and navigation rules.
You obtain a Context by calling add_context() on a ContextBuilder or by calling
get_context() to retrieve one that already exists.
Properties
name
Unique context name. When using a single context inside a ContextBuilder, this
must be "default".
Methods
Add a POM section with bullet points to the context prompt.
Add enter fillers for a specific language.
Add exit fillers for a specific language.
Add a POM section to the context prompt.
Add a new step to this context.
Add a POM section with bullets to the system prompt.
Add a POM section to the system prompt.
Get an existing step by name.
Move an existing step to a specific position in the step order.
Remove a step from this context.
Set whether to consolidate conversation history when entering this context.
Set all enter fillers at once.
Set all exit fillers at once.
Set whether to completely replace the system prompt when entering this context.
Set whether to truncate conversation history when entering this context.
Override the post-prompt text while this context is active.
Set the context’s prompt text directly.
Set a new system prompt that takes effect when this context is entered.
Inject a user message when entering this context.
Set which contexts the agent can navigate to from this context.
Set which steps can be navigated to from any step in this context.