From d8a6f54400cea8809358bf6391037097fc3c3175 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Thu, 29 Jun 2023 22:43:30 -0400 Subject: [PATCH] feat: add dummy mechanism that bypasses human feedback --- packages/core/src/human-feedback/dummy.ts | 34 +++++++++++++++++++++++ packages/core/src/human-feedback/index.ts | 1 + 2 files changed, 35 insertions(+) create mode 100644 packages/core/src/human-feedback/dummy.ts diff --git a/packages/core/src/human-feedback/dummy.ts b/packages/core/src/human-feedback/dummy.ts new file mode 100644 index 0000000..2a4f549 --- /dev/null +++ b/packages/core/src/human-feedback/dummy.ts @@ -0,0 +1,34 @@ +import { + HumanFeedbackMechanism, + HumanFeedbackType, + HumanFeedbackUserActions +} from './feedback' + +export class HumanFeedbackMechanismDummy< + T extends HumanFeedbackType, + TOutput +> extends HumanFeedbackMechanism { + protected async _select( + output: TOutput + ): Promise { + return output[0] as any + } + + protected async _multiselect( + output: TOutput + ): Promise { + return output as any + } + + protected async _annotate(): Promise { + return 'Default annotation' + } + + protected async _edit(output: string): Promise { + return output + } + + protected async _askUser(): Promise { + return HumanFeedbackUserActions.Accept + } +} diff --git a/packages/core/src/human-feedback/index.ts b/packages/core/src/human-feedback/index.ts index 105c876..593a175 100644 --- a/packages/core/src/human-feedback/index.ts +++ b/packages/core/src/human-feedback/index.ts @@ -2,3 +2,4 @@ export * from './cli' export * from './feedback' export * from './slack' export * from './twilio' +export * from './dummy'