feat: add support for customizing output label

old-agentic-v1^2
Philipp Burckhardt 2023-06-15 13:07:07 -04:00
rodzic 83e35144b5
commit 77cd195a9a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: A2C3BCA4F31D1DDD
1 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -67,6 +67,11 @@ export type HumanFeedbackOptions<T extends HumanFeedbackType, TOutput> = {
* The human feedback mechanism to use for this task. * The human feedback mechanism to use for this task.
*/ */
mechanism?: HumanFeedbackMechanismConstructor<T, TOutput> mechanism?: HumanFeedbackMechanismConstructor<T, TOutput>
/**
* Custom label to be displayed along with the output when requesting feedback.
*/
outputLabel?: string
} }
export interface BaseHumanFeedbackMetadata { export interface BaseHumanFeedbackMetadata {
@ -173,8 +178,12 @@ export abstract class HumanFeedbackMechanism<
public async interact(output: TOutput): Promise<FeedbackTypeToMetadata<T>> { public async interact(output: TOutput): Promise<FeedbackTypeToMetadata<T>> {
const stringified = JSON.stringify(output, null, 2) const stringified = JSON.stringify(output, null, 2)
const taskDetails = `${this._task.nameForHuman} (ID: ${this._task.id})`
const outputLabel =
this._options.outputLabel || 'The following output was generated:'
const msg = [ const msg = [
'The following output was generated:', taskDetails,
outputLabel,
'```', '```',
stringified, stringified,
'```', '```',