Perform an advanced context switch by replacing the system prompt, injecting a
user message, or resetting the conversation entirely. This is more flexible
than swmlChangeContext(),
which switches to a pre-defined named context.
When only system_prompt is provided (no other arguments), it performs a simple
string-based context switch. When multiple arguments are given, it constructs an
object-based context switch with fine-grained control.
Optional context switch configuration.
New system prompt to replace the current one.
A user message to inject into the conversation after the context switch.
When true, the existing conversation history is summarized into a condensed
form before applying the new context. Reduces token usage on long conversations.
When true, performs a complete context reset, clearing all conversation
history and starting fresh with the new prompt.
FunctionResult — this, for chaining.