feat: 聊天室模型选择器 + 会话更新 API + 消息部件重构

- 新增 PATCH /api/projects/:id/conversations/:cid 端点,支持更新 modelId 和 title
- 聊天面板新增模型选择下拉框,切换模型自动持久化
- 新建会话时传入默认文本模型 modelId
- 将 ToolCallCard 拆分为 ReasoningPart / TextPart / ToolPart 独立部件
- ToolPart 增加流式状态图标、折叠面板自动展开、错误详情展示
- ReasoningPart 增加思考中/思考完成状态指示
- 补充 PATCH 端点测试:更新成功、跨项目 403、不存在 404、无效 modelId 400
This commit is contained in:
2026-05-31 21:56:50 +08:00
parent 3e1f3b554d
commit f2e3d84fb1
15 changed files with 536 additions and 122 deletions

View File

@@ -42,11 +42,6 @@ export interface CreateProjectRequest {
name: string;
}
// ==========================================
// 在此定义你的业务类型
// 前后端共享的类型都放在这个文件中
// ==========================================
export interface CreateProviderRequest {
apiKey: string;
baseUrl: string;
@@ -54,6 +49,11 @@ export interface CreateProviderRequest {
type: ProviderType;
}
// ==========================================
// 在此定义你的业务类型
// 前后端共享的类型都放在这个文件中
// ==========================================
export interface Message {
content: string;
conversationId: string;
@@ -104,6 +104,11 @@ export interface SendMessageRequest {
messages: Array<{ content: string; role: "assistant" | "system" | "user" }>;
}
export interface UpdateConversationRequest {
modelId?: string;
title?: string;
}
export const MODEL_CAPABILITIES: readonly ModelCapability[] = [
"audio-generation",
"audio-recognition",