Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Thoughts

Collection of processes and branches to execute with middleware and state. Will use global branches 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 new instance of thought processes with optional branches to process. By default will process global branches, but can accept an isolated branches for specific conversational context. Start new instance of thought processes with optional branches to process. By default will process global branches, but can accept an isolated branches for specific conversational context.

    Parameters

    Returns Thoughts

Properties

b

b: State

branches

branches: BranchController

processes

processes: ThoughtProcesses

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']

serve

serve: string[] = ['hear', 'serve', 'act', 'remember']

Generated using TypeDoc