For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
        • addContext
        • Context
        • createSimpleContext
        • GatherInfo & GatherQuestion
        • getCompletionAction
        • getContext
        • getGatherInfo
        • getQuestions
        • getStepOrder
        • getSteps
        • getValidContexts
        • reset
        • Step
        • toDict
        • validate
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Returns
  • Example
AgentsContextBuilder

reset

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

Step

Next
Built with

Remove all contexts, returning the builder to its initial state. Use this inside a dynamic-config callback when you need to rebuild contexts from scratch for a specific request, rather than mutating the shared builder.

Returns

ContextBuilder — self for method chaining.

Example

1agent.setDynamicConfigCallback((queryParams, bodyParams, headers, ephemeralAgent) => {
2 if (queryParams['tenant'] === 'billing') {
3 const builder = (ephemeralAgent as any).defineContexts();
4 builder.reset();
5 builder.addContext('default')
6 .addStep('greeting')
7 .setText('Welcome to billing.');
8 }
9});