feat: add dummy mechanism that bypasses human feedback

old-agentic-v1^2
Philipp Burckhardt 2023-06-29 22:43:30 -04:00
rodzic 7c1cb2eb7b
commit d8a6f54400
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: A2C3BCA4F31D1DDD
2 zmienionych plików z 35 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,34 @@
import {
HumanFeedbackMechanism,
HumanFeedbackType,
HumanFeedbackUserActions
} from './feedback'
export class HumanFeedbackMechanismDummy<
T extends HumanFeedbackType,
TOutput
> extends HumanFeedbackMechanism<T, TOutput> {
protected async _select(
output: TOutput
): Promise<TOutput extends any[] ? TOutput[0] : never> {
return output[0] as any
}
protected async _multiselect(
output: TOutput
): Promise<TOutput extends any[] ? TOutput : never> {
return output as any
}
protected async _annotate(): Promise<string> {
return 'Default annotation'
}
protected async _edit(output: string): Promise<string> {
return output
}
protected async _askUser(): Promise<HumanFeedbackUserActions> {
return HumanFeedbackUserActions.Accept
}
}

Wyświetl plik

@ -2,3 +2,4 @@ export * from './cli'
export * from './feedback'
export * from './slack'
export * from './twilio'
export * from './dummy'