Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NaturalLanguageBranch

Natural language branch uses NLU result to match on intent, entities and/or sentiment of optional score threshold. NLU must be trained to provide intent.

Hierarchy

Indexable

[key: string]: any

Natural language branch uses NLU result to match on intent, entities and/or sentiment of optional score threshold. NLU must be trained to provide intent.

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

callback

callback: IBranchCallback

criteria

criteria: bot.NaturalLanguageCriteria

force

force: boolean = false

id

id: string

match

match: bot.NaturalLanguageResultsRaw | undefined

Optional matched

matched: undefined | true | false

Methods

matcher

  • matcher(message: TextMessage): Promise<undefined | object>

process

  • Runs the matcher, then middleware and callback if matched. Middleware can intercept and prevent the callback from executing. If the state has already matched on prior branch, it will not match again unless forced to, with the branch's force property.

    Parameters

    • b: State

      State containing message to process

    • middleware: Middleware

      Executes before the branch callback if matched

    • Default value done: IBranchDone = () => null

      Called after middleware (optional), with match status

    Returns Promise<State>

Generated using TypeDoc