feat: 支持服务等级动态切换

- 添加 ServiceTier 类型定义
- 修改 dialogService 接收 serviceTier 参数
- 修改 messageHandler 传递 serviceTier 参数
- 修改 ICHelperPanel 传递 UI 选择的服务等级
This commit is contained in:
XiaoFeng
2026-01-07 16:13:56 +08:00
parent 251289a340
commit 9281d1d724
5 changed files with 37 additions and 11 deletions

View File

@ -16,6 +16,15 @@ import { CompactedMemory, CompactedMessage } from './memory';
*/
export type RunMode = 'plan' | 'ask' | 'agent' | 'auto';
/**
* 服务等级类型
* - lite: 轻量级
* - syntaxic: 语法级
* - max: 最大性能
* - auto: 自动选择
*/
export type ServiceTier = 'lite' | 'syntaxic' | 'max' | 'auto';
/**
* 对话请求
* POST /api/dialog/stream
@ -29,6 +38,8 @@ export interface DialogRequest {
userId: string;
/** 运行模式 */
mode: RunMode;
/** 服务等级 */
serviceTier?: ServiceTier;
/** 压缩后的记忆数据(用于后端重启后恢复) */
compactedData?: CompactedMemory;
/** 压缩后产生的新消息 */
@ -59,7 +70,8 @@ export type SSEEventType =
| 'error' // 错误
| 'warning' // 警告
| 'notification' // 通知
| 'depth_update'; // 深度更新
| 'depth_update' // 深度更新
| 'heartbeat'; // 心跳
/** text_delta 事件数据 */
export interface TextDeltaEvent {