feat: 支持 AskUserQuestion 多问题和多选功能
- 新增 QuestionItem 类型支持单个问题配置(question/options/multiSelect)
- AskUserEvent 改为 questions 数组支持多问题
- AnswerRequest 新增 answers 字段支持多问题答案提交
- 前端渲染支持单选按钮(radio)和多选复选框(checkbox)
- 答案格式:{\"0\": [\"选项1\"], \"1\": [\"选项A\", \"选项B\"]}
- 保持向后兼容旧的单问题格式
This commit is contained in:
@ -469,10 +469,11 @@ async function handleUserMessageWithBackend(
|
||||
export async function handleUserAnswer(
|
||||
askId: string,
|
||||
selected?: string[],
|
||||
customInput?: string
|
||||
customInput?: string,
|
||||
answers?: { [questionIndex: string]: string[] }
|
||||
): Promise<void> {
|
||||
if (currentSession) {
|
||||
await currentSession.submitAnswer(askId, selected, customInput);
|
||||
await currentSession.submitAnswer(askId, selected, customInput, answers);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user