External module "lib/classify/set"
Functions
classifySet
- classifySet(context: IContextMutable, target: ITargetImmutable, classification: IDataImmutable): IDataImmutable
-
Parameters
-
-
target: ITargetImmutable
-
classification: IDataImmutable
Returns IDataImmutable
the set or updated data
Sets the result of a classification into a classify context
import { IContextMutable, IClassifyContextMutable } from '@ef-carbon/conversation'; const context: IContextMutable = {}; const classified: IClassifyContextMutable = {}; for await (const { target, ...rest } of classify(input, targets)) { set(classified, target, { ...rest }); } if (Object.keys(classified)) { context.response = classified; }