feat: 提取常量配置
This commit is contained in:
63
src/views/AgentChat/constants/models.ts
Normal file
63
src/views/AgentChat/constants/models.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
// src/views/AgentChat/constants/models.ts
|
||||
// 可用模型配置
|
||||
|
||||
import React from 'react';
|
||||
import { Brain, Zap, TrendingUp } from 'lucide-react';
|
||||
|
||||
/**
|
||||
* 模型配置接口
|
||||
*/
|
||||
export interface ModelConfig {
|
||||
/** 模型唯一标识 */
|
||||
id: string;
|
||||
/** 模型显示名称 */
|
||||
name: string;
|
||||
/** 模型描述 */
|
||||
description: string;
|
||||
/** 模型图标(React 元素)*/
|
||||
icon: React.ReactNode;
|
||||
/** 颜色主题 */
|
||||
color: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 可用模型配置列表
|
||||
* 包含所有可供用户选择的 AI 模型
|
||||
*/
|
||||
export const AVAILABLE_MODELS: ModelConfig[] = [
|
||||
{
|
||||
id: 'kimi-k2-thinking',
|
||||
name: 'Kimi K2 Thinking',
|
||||
description: '深度思考模型,适合复杂分析',
|
||||
icon: React.createElement(Brain, { className: 'w-5 h-5' }),
|
||||
color: 'purple',
|
||||
},
|
||||
{
|
||||
id: 'kimi-k2',
|
||||
name: 'Kimi K2',
|
||||
description: '快速响应模型,适合简单查询',
|
||||
icon: React.createElement(Zap, { className: 'w-5 h-5' }),
|
||||
color: 'blue',
|
||||
},
|
||||
{
|
||||
id: 'deepmoney',
|
||||
name: 'DeepMoney',
|
||||
description: '金融专业模型',
|
||||
icon: React.createElement(TrendingUp, { className: 'w-5 h-5' }),
|
||||
color: 'green',
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 默认选中的模型 ID
|
||||
*/
|
||||
export const DEFAULT_MODEL_ID = 'kimi-k2-thinking';
|
||||
|
||||
/**
|
||||
* 根据 ID 查找模型配置
|
||||
* @param modelId 模型 ID
|
||||
* @returns 模型配置对象,未找到则返回 undefined
|
||||
*/
|
||||
export const findModelById = (modelId: string): ModelConfig | undefined => {
|
||||
return AVAILABLE_MODELS.find((model) => model.id === modelId);
|
||||
};
|
||||
Reference in New Issue
Block a user