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

@ -10,6 +10,9 @@ type Environment = "dev" | "test" | "prod";
/** 当前环境 - 修改这里切换环境 */
const CURRENT_ENV: Environment = "dev";
/** 服务等级类型 */
export type ServiceTier = 'lite' | 'syntaxic' | 'max' | 'auto';
/** 配置项接口 */
export interface IccoderConfig {
/** 后端服务地址 */
@ -18,6 +21,8 @@ export interface IccoderConfig {
timeout: number;
/** 用户ID临时使用后续对接认证 */
userId: string;
/** 服务等级 */
serviceTier: ServiceTier;
}
/** 环境配置 */
@ -25,20 +30,23 @@ const ENV_CONFIG: Record<Environment, IccoderConfig> = {
/** 本地开发环境 */
dev: {
backendUrl: "http://localhost:2233",
timeout: 300000, // 5分钟与子智能体超时一致
timeout: 300000,
userId: "default-user",
serviceTier: "max", // 默认使用 max
},
/** 测试服务器环境 */
test: {
backendUrl: "http://192.168.1.108:2233",
timeout: 60000,
userId: "default-user",
serviceTier: "max",
},
/** 生产环境 */
prod: {
backendUrl: "https://api.iccoder.com", // TODO: 替换为实际生产地址
backendUrl: "https://api.iccoder.com",
timeout: 60000,
userId: "default-user",
serviceTier: "auto",
},
};