fix: serialize object elements to JSON for messages

old-agentic-v1^2
Philipp Burckhardt 2023-06-15 11:55:00 -04:00
rodzic d02af15fbf
commit fd253b2ef0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: A2C3BCA4F31D1DDD
3 zmienionych plików z 10 dodań i 6 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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(',')

Wyświetl plik

@ -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(',')