kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: add dummy mechanism that bypasses human feedback
rodzic
7c1cb2eb7b
commit
d8a6f54400
|
@ -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
|
||||
}
|
||||
}
|
|
@ -2,3 +2,4 @@ export * from './cli'
|
|||
export * from './feedback'
|
||||
export * from './slack'
|
||||
export * from './twilio'
|
||||
export * from './dummy'
|
||||
|
|
Ładowanie…
Reference in New Issue