Skip to content

Input Configuration API Reference ​

Complete API reference for customer input configuration classes.

InputConfiguration ​

Main configuration class for customer input with ASR and DTMF support.

Properties ​

PropertyTypeDefaultDescription
PrimaryPrimaryInputConfigurationnew()Primary input configuration (typically ASR/Speech)
FallbackFallbackInputConfigurationnew()Fallback input configuration (typically DTMF)
InputModeInputMode?nullOverall input mode when not using Primary/Fallback pattern
FallbackTriggersFallbackTriggerFallbackTrigger.AnyErrorConditions that trigger fallback from primary to secondary input
EnableFallbackbooltrueWhether to enable automatic fallback to DTMF when primary input fails
MaxDigitsint?nullMaximum number of digits to collect (for DTMF)
TimeoutSecondsint?nullTimeout in seconds for customer input
InterDigitTimeoutSecondsint?nullInter-digit timeout in seconds (time between DTMF key presses)
IsSequentialboolcomputedDetermines if this configuration uses the Sequential input pattern (Primary → Fallback)

IsSequential Property ​

Returns true when:

  • EnableFallback is true
  • Primary.Mode is InputMode.Speech
  • Fallback.Mode is InputMode.DTMF
csharp
var config = new InputConfiguration
{
    EnableFallback = true
};
config.Primary.Mode = InputMode.Speech;
config.Fallback.Mode = InputMode.DTMF;

// Returns true
bool isSequential = config.IsSequential;

PrimaryInputConfiguration ​

Configuration for primary input mode (typically ASR/Speech).

Properties ​

PropertyTypeDefaultDescription
ModeInputModeInputMode.SpeechInput mode for primary input
LexBotstring?nullAmazon Lex bot name for speech recognition
LexBotAliasstring?nullAmazon Lex bot alias
LexBotVersionstring"V2"Amazon Lex bot version (e.g., "V2" for Lex V2)
Localestring"en_US"Locale/language for Lex bot (e.g., "en_US", "es_US")
Promptstring?nullPrompt text for ASR input
RetryPromptstring?nullRetry prompt text when input is not recognized
MaxRetriesint2Maximum number of retry attempts for ASR
TimeoutSecondsint5Timeout in seconds for speech input
ConfidenceThresholddouble0.7Confidence threshold for speech recognition (0.0 to 1.0). Intent matches below this threshold will be treated as NoMatch
EncryptInputboolfalseWhether to encrypt customer input for PCI compliance

Example ​

csharp
var config = new InputConfiguration();
config.Primary.Mode = InputMode.Speech;
config.Primary.LexBot = "CustomerServiceBot";
config.Primary.LexBotAlias = "Production";
config.Primary.LexBotVersion = "V2";
config.Primary.Locale = "en_US";
config.Primary.Prompt = "How can I help you today?";
config.Primary.RetryPrompt = "I'm sorry, I didn't catch that. Please try again.";
config.Primary.MaxRetries = 3;
config.Primary.TimeoutSeconds = 5;
config.Primary.ConfidenceThreshold = 0.75; // 75% confidence required
config.Primary.EncryptInput = false;

FallbackInputConfiguration ​

Configuration for fallback input mode (typically DTMF).

Properties ​

PropertyTypeDefaultDescription
ModeInputModeInputMode.DTMFInput mode for fallback input
PromptTextstring?nullPrompt text for DTMF fallback
RetryPromptstring?nullRetry prompt text when DTMF input is invalid
MaxDigitsint1Maximum number of digits to collect
MinDigitsint?nullMinimum number of digits required
TerminatingDigitstring?nullTerminating digit (e.g., "#")
TimeoutSecondsint5Timeout in seconds for DTMF input
InterDigitTimeoutSecondsint2Inter-digit timeout in seconds
MaxRetriesint2Maximum number of retry attempts for DTMF
EncryptInputboolfalseWhether to encrypt customer input for PCI compliance

Example ​

csharp
var config = new InputConfiguration();
config.Fallback.Mode = InputMode.DTMF;
config.Fallback.PromptText = "Please use your keypad. Press 1 for sales, 2 for support.";
config.Fallback.RetryPrompt = "Invalid selection. Please press 1 or 2.";
config.Fallback.MaxDigits = 1;
config.Fallback.MinDigits = 1;
config.Fallback.TerminatingDigit = "#";
config.Fallback.TimeoutSeconds = 10;
config.Fallback.InterDigitTimeoutSeconds = 3;
config.Fallback.MaxRetries = 2;
config.Fallback.EncryptInput = false;

FallbackTrigger Enum ​

Defines conditions that trigger fallback from primary input to secondary input. Can be combined using bitwise flags.

Values ​

ValueDescription
NoneNo fallback - stay with primary input mode
TimeoutFallback on timeout (no input received within timeout period)
InvalidInputFallback on invalid input (input doesn't match expected format)
NoMatchFallback on no match (intent not recognized or confidence too low)
ErrorFallback on error (system error during input collection)
LowConfidenceFallback on low confidence (confidence score below threshold)
MaxRetriesExceededFallback on maximum retries exceeded
AnyErrorFallback on any error condition (Timeout | InvalidInput | NoMatch | Error | LowConfidence)
AllFallback on all conditions (includes MaxRetriesExceeded)

Examples ​

csharp
// Single trigger
config.FallbackTriggers = FallbackTrigger.Timeout;

// Multiple triggers using bitwise OR
config.FallbackTriggers = FallbackTrigger.Timeout | FallbackTrigger.NoMatch;

// Predefined combination: Any error
config.FallbackTriggers = FallbackTrigger.AnyError;

// Check if specific trigger is set
if (config.FallbackTriggers.HasFlag(FallbackTrigger.Timeout))
{
    // Timeout trigger is enabled
}

Predefined Combinations ​

AnyError:

csharp
FallbackTrigger.AnyError =
    FallbackTrigger.Timeout |
    FallbackTrigger.InvalidInput |
    FallbackTrigger.NoMatch |
    FallbackTrigger.Error |
    FallbackTrigger.LowConfidence;

All:

csharp
FallbackTrigger.All =
    FallbackTrigger.Timeout |
    FallbackTrigger.InvalidInput |
    FallbackTrigger.NoMatch |
    FallbackTrigger.Error |
    FallbackTrigger.LowConfidence |
    FallbackTrigger.MaxRetriesExceeded;

InputMode Enum ​

Defines the input mode for customer interactions.

Values ​

ValueDescription
SpeechSpeech recognition (ASR) using Amazon Lex
DTMFDual-tone multi-frequency (DTMF) keypad input
BothBoth speech and DTMF accepted simultaneously
SequentialSequential input mode where primary input (typically ASR) is attempted first, with automatic fallback to secondary input (typically DTMF) based on configured triggers

Example ​

csharp
// Speech only
config.Primary.Mode = InputMode.Speech;

// DTMF only
config.Fallback.Mode = InputMode.DTMF;

// Both simultaneously (not recommended - use Sequential instead)
config.InputMode = InputMode.Both;

// Sequential (Primary → Fallback)
config.Primary.Mode = InputMode.Speech;
config.Fallback.Mode = InputMode.DTMF;
config.EnableFallback = true;
// config.IsSequential will return true

Complete Example ​

csharp
.GetCustomerInput(input =>
{
    // ===== PRIMARY: Speech Recognition =====
    input.Primary.Mode = InputMode.Speech;
    input.Primary.LexBot = "CustomerServiceBot";
    input.Primary.LexBotAlias = "Production";
    input.Primary.LexBotVersion = "V2";
    input.Primary.Locale = "en_US";
    input.Primary.Prompt = "How can I help you today?";
    input.Primary.RetryPrompt = "I'm sorry, I didn't understand. Please try again.";
    input.Primary.MaxRetries = 3;
    input.Primary.TimeoutSeconds = 5;
    input.Primary.ConfidenceThreshold = 0.75;
    input.Primary.EncryptInput = false;

    // ===== FALLBACK: DTMF =====
    input.Fallback.Mode = InputMode.DTMF;
    input.Fallback.PromptText = "Please use your keypad. Press 1 for sales, 2 for support.";
    input.Fallback.RetryPrompt = "Invalid selection. Please press 1 or 2.";
    input.Fallback.MaxDigits = 1;
    input.Fallback.MinDigits = 1;
    input.Fallback.TerminatingDigit = "#";
    input.Fallback.TimeoutSeconds = 10;
    input.Fallback.InterDigitTimeoutSeconds = 3;
    input.Fallback.MaxRetries = 2;
    input.Fallback.EncryptInput = false;

    // ===== FALLBACK TRIGGERS =====
    input.FallbackTriggers = FallbackTrigger.Timeout |
                            FallbackTrigger.NoMatch |
                            FallbackTrigger.LowConfidence;
    input.EnableFallback = true;

    // This will return true:
    // bool isSequential = input.IsSequential;
})
.OnDigit("1", sales => sales.TransferToQueue("Sales"))
.OnDigit("2", support => support.TransferToQueue("Support"))
.OnTimeout(timeout => timeout.Disconnect())
.OnError(error => error.Disconnect())
.OnDefault(def => def.Disconnect())

See Also ​

Preview release - Licensing terms TBD before 1.0