Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Thoughts

Collection of processes and branches to execute with middleware and state. Will use global path by default, but can be replaced with custom set. Sequence arrays define orders of named processes, to run consecutively. Default sequences are receive and dispatch to process incoming/outgoing. Each process may have a validate method to run before processing and an action method to run after. Validate returning false will skip the process.

Hierarchy

  • Thoughts

Index

Constructors

Properties

Methods

Object literals

Constructors

constructor

  • Start a new instance of thought processes with an optional path to process. By default will process global path, but can accept an isolated path for specific conversational context.

    Parameters

    • state: State
    • Optional path: bot.Path

    Returns Thoughts

Properties

b

path

path: Path

processes

processes: object

Type declaration

Methods

start

  • start(sequence: string): Promise<State>
  • Begin processing each thought in defined sequence.

    Parameters

    • sequence: string

    Returns Promise<State>

Object literals

sequence

sequence: object

dispatch

dispatch: string[] = ['respond', 'remember']

receive

receive: string[] = ['hear', 'listen', 'understand', 'act', 'remember']

respond

respond: string[] = ['respond']

Generated using TypeDoc