feat(question): support multi-select questions (#7386)

This commit is contained in:
Dax
2026-01-08 17:32:21 -05:00
committed by GitHub
parent b4f8de0c0a
commit 22dd70b75b
10 changed files with 1411 additions and 325 deletions

View File

@@ -15,7 +15,12 @@ export const QuestionTool = Tool.define("question", {
tool: ctx.callID ? { messageID: ctx.messageID, callID: ctx.callID } : undefined,
})
const formatted = params.questions.map((q, i) => `"${q.question}"="${answers[i] ?? "Unanswered"}"`).join(", ")
function format(answer: Question.Answer | undefined) {
if (!answer?.length) return "Unanswered"
return answer.join(", ")
}
const formatted = params.questions.map((q, i) => `"${q.question}"="${format(answers[i])}"`).join(", ")
return {
title: `Asked ${params.questions.length} question${params.questions.length > 1 ? "s" : ""}`,