Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BotActionConfig

This class standardizes Custom Config property syntax for each configurable Bot Action.

Hierarchy

  • BotActionConfig

Index

Constructors

Private constructor

  • new BotActionConfig(constructiveFeedbackOnlyToggle: boolean, threshold: number): BotActionConfig

Properties

Readonly constructiveFeedbackOnlyToggle

constructiveFeedbackOnlyToggle: boolean

Readonly threshold

threshold: number

Methods

Static from

  • This method analyzes user-defined Bot Action configuration values and uses them for Bot Action logic if they are valid. If configuration values are missing or invalid, the default values are used.

    Parameters

    • botActionDefaults: BotActionDefaults

      the default values for the configurable Bot Action

    • retrieved: any

      the values retrieved from the user-defined .grdb.json Custom Config file

    Returns BotActionConfig

Static setConstructiveFeedbackOnlyToggle

  • setConstructiveFeedbackOnlyToggle(defaultToggle: boolean, retrieved: any, actionName: string): boolean
  • Determine if user-configured value for constructiveFeedbackOnlyToggle is set and valid, or if default value should be used

    Parameters

    • defaultToggle: boolean

      default config value for constructiveFeedbackOnlyToggleDefault

    • retrieved: any

      user-configured bot action values

    • actionName: string

      name of bot action

    Returns boolean

    boolean for constructiveFeedbackOnlyToggle in BotActionConfig

Static setThreshold

  • setThreshold(retrieved: any, actionName: string, thresholdName: string, defaultThreshold: number, thresholdMin: number, thresholdMax: number): number
  • Determine if user-configured value for bot action threshold is set and valid, or if default value should be used

    Parameters

    • retrieved: any

      user-configured bot action values

    • actionName: string

      name of bot action

    • thresholdName: string

      name of threshold for bot action

    • defaultThreshold: number

      action config default value for threshold

    • thresholdMin: number

      inclusive minimum value for valid threshold

    • thresholdMax: number

      inclusive maximum value for valid threshold

    Returns number

    number for threshold value in BotActionConfig

Static validThreshold

  • validThreshold(threshold: any, min: number, max: number): boolean

Static validToggle

  • validToggle(toggle: any): boolean

Generated using TypeDoc