修改前端架构到Electron ,增加llm_api页面,增加chat SSE渲染,修改若安按钮,卡片名称修改等小功能,增加agent-core,增加SQlite,增加llm UDS Pipe websocke
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import type { AgentSetting, Conversation, SettingMenu } from './types'
|
||||
|
||||
export const agentSettings: AgentSetting[] = [
|
||||
{ key: 'autoApprove', label: '自动批准工具执行', value: false },
|
||||
{ key: 'autoRetry', label: '失败自动重试', value: true },
|
||||
{ key: 'streamOutput', label: '流式输出', value: true },
|
||||
{ key: 'logTools', label: '记录工具调用日志', value: true },
|
||||
{ key: 'sandbox', label: '沙箱隔离执行', value: false }
|
||||
]
|
||||
|
||||
export const settingMenus: SettingMenu[] = [
|
||||
{ key: 'features', label: '功能开关', icon: '⚙' },
|
||||
{ key: 'api', label: '大模型 API 设置', icon: '🔑' },
|
||||
{ key: 'workflow', label: '日常工作流管理', icon: '🔄' }
|
||||
]
|
||||
|
||||
const mk = (id: number, content: string, time: string): Conversation => ({
|
||||
id: `conv-${id}`,
|
||||
title: content.slice(0, 14),
|
||||
model: 'gpt-4o-mini',
|
||||
updatedAt: time,
|
||||
messages: [
|
||||
{
|
||||
id: `m-${id}-1`,
|
||||
role: 'user',
|
||||
content,
|
||||
time,
|
||||
toolCalls: []
|
||||
},
|
||||
{
|
||||
id: `m-${id}-2`,
|
||||
role: 'assistant',
|
||||
content:
|
||||
'已收到并开始处理。我会按计划逐步执行,可在右侧实时查看文件与工具调用结果。',
|
||||
time,
|
||||
toolCalls: [
|
||||
{
|
||||
id: `t-${id}-1`,
|
||||
name: 'read_file',
|
||||
params: { path: `./data/file_${id}.md` },
|
||||
status: 'done',
|
||||
result: '读取成功,共 42 行',
|
||||
durationMs: 320
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
export const conversations: Conversation[] = [
|
||||
mk(1, '帮我整理今日经营数据报表', '10:24'),
|
||||
mk(2, '分析上季度成交量并生成图表', '09:58'),
|
||||
mk(3, '检查定时任务运行状态', '昨天 19:40'),
|
||||
mk(4, '批量更新员工排班表', '昨天 15:06'),
|
||||
mk(5, '生成门店巡检报告模板', '09-20 11:31')
|
||||
]
|
||||
Reference in New Issue
Block a user