diff --git a/src/human-feedback/cli.ts b/src/human-feedback/cli.ts index d67a5f7..134766b 100644 --- a/src/human-feedback/cli.ts +++ b/src/human-feedback/cli.ts @@ -52,7 +52,7 @@ export class HumanFeedbackMechanismCLI< } const choices = response.map((option) => ({ - name: String(option), + name: JSON.stringify(option), value: option })) return select({ message: 'Pick one output:', choices }) @@ -66,7 +66,7 @@ export class HumanFeedbackMechanismCLI< } const choices = response.map((option) => ({ - name: String(option), + name: JSON.stringify(option), value: option })) return checkbox({ message: 'Select outputs:', choices }) as any diff --git a/src/human-feedback/slack.ts b/src/human-feedback/slack.ts index 25b7f9a..81b7d75 100644 --- a/src/human-feedback/slack.ts +++ b/src/human-feedback/slack.ts @@ -82,7 +82,9 @@ export class HumanFeedbackMechanismSlack< await this._slackClient.sendAndWaitForReply({ text: 'Pick one output:' + - response.map((r, idx) => `\n*${idx}* - ${r}`).join('') + + response + .map((r, idx) => `\n*${idx}* - ${JSON.stringify(r)}`) + .join('') + '\n\nReply with the number of your choice.', validate: (slackMessage) => { const choice = parseInt(slackMessage.text) @@ -103,7 +105,9 @@ export class HumanFeedbackMechanismSlack< await this._slackClient.sendAndWaitForReply({ text: 'Select outputs:' + - response.map((r, idx) => `\n*${idx}* - ${r}`).join('') + + response + .map((r, idx) => `\n*${idx}* - ${JSON.stringify(r)}`) + .join('') + '\n\nReply with a comma-separated list of the output numbers of your choice.', validate: (slackMessage) => { const choices = slackMessage.text.split(',') diff --git a/src/human-feedback/twilio.ts b/src/human-feedback/twilio.ts index 72f8386..401ec8a 100644 --- a/src/human-feedback/twilio.ts +++ b/src/human-feedback/twilio.ts @@ -86,7 +86,7 @@ export class HumanFeedbackMechanismTwilio< name: 'human-feedback-select', text: 'Pick one output:' + - response.map((r, idx) => `\n${idx} - ${r}`).join('') + + response.map((r, idx) => `\n${idx} - ${JSON.stringify(r)}`).join('') + '\n\nReply with the number of your choice.', validate: (message) => { const choice = parseInt(message.body) @@ -108,7 +108,7 @@ export class HumanFeedbackMechanismTwilio< name: 'human-feedback-select', text: 'Select outputs:' + - response.map((r, idx) => `\n${idx} - ${r}`).join('') + + response.map((r, idx) => `\n${idx} - ${JSON.stringify(r)}`).join('') + '\n\nReply with a comma-separated list of the output numbers of your choice.', validate: (message) => { const choices = message.body.split(',')