feat(ui): 实现 ask_user_question 工具的前端支持

- 添加 AskUserQuestion 组件,支持单选/多选和自定义输入
- 添加 Question 相关类型定义 (QuestionOption, Question, QuestionMessagePart)
- 在 useChat 中处理 ask_user_question 工具完成事件,转换为问题 UI
- 添加 answerQuestion 回调用于提交用户回答
- 更新 ChatMessage 组件支持渲染问题类型的消息部分
This commit is contained in:
2025-12-16 23:14:25 +08:00
parent 791c4a4616
commit 3b170738ee
8 changed files with 556 additions and 12 deletions
+4
View File
@@ -131,6 +131,10 @@ export type {
FileSearchResponse,
// Agent mode types
AgentModeType,
// Question types (for ask_user_question tool)
QuestionOption,
Question,
QuestionMessagePart,
} from './types.js';
// API Configuration