Commit
·
7391449
1
Parent(s):
3db2966
� FIX TYPE ERROR: Remove Duplicate Function Declaration
Browse files✅ 修复TypeScript编译错误:
- ❌ 删除重复的handleAssistantSelect函数声明
- ✅ 保留第一个完整的函数实现
- � 解决block-scoped variable重复声明错误
� 结果: TypeScript编译通过,Create New Assistant功能正常工作!
frontend/src/pages/MyDevice.tsx
CHANGED
|
@@ -132,63 +132,6 @@ export function MyDevice() {
|
|
| 132 |
const assistantConfigs = ASSISTANT_CONFIGS
|
| 133 |
const messages = currentSession?.messages || []
|
| 134 |
|
| 135 |
-
// Load assistant configuration when selected
|
| 136 |
-
const handleAssistantSelect = (assistantId: string) => {
|
| 137 |
-
if (assistantId === 'create-new') {
|
| 138 |
-
// Reset to blank configuration for new assistant
|
| 139 |
-
setDeviceConfig(prev => ({
|
| 140 |
-
...prev,
|
| 141 |
-
assistantId: 'create-new',
|
| 142 |
-
model: 'Qwen/Qwen3-30B-A3B',
|
| 143 |
-
temperature: 0.7,
|
| 144 |
-
maxTokens: 1024,
|
| 145 |
-
role: '',
|
| 146 |
-
goal: '',
|
| 147 |
-
description: ''
|
| 148 |
-
}))
|
| 149 |
-
|
| 150 |
-
// Reset chat settings
|
| 151 |
-
setSelectedModel('Qwen/Qwen3-30B-A3B')
|
| 152 |
-
setSystemPrompt('')
|
| 153 |
-
setTemperature(0.7)
|
| 154 |
-
setMaxTokens(1024)
|
| 155 |
-
|
| 156 |
-
// Set current assistant for RAG
|
| 157 |
-
setCurrentAssistant({
|
| 158 |
-
id: 'create-new',
|
| 159 |
-
name: 'New Custom Assistant',
|
| 160 |
-
type: 'new'
|
| 161 |
-
})
|
| 162 |
-
} else {
|
| 163 |
-
const config = assistantConfigs.find(c => c.id === assistantId)
|
| 164 |
-
if (config) {
|
| 165 |
-
setDeviceConfig(prev => ({
|
| 166 |
-
...prev,
|
| 167 |
-
assistantId,
|
| 168 |
-
model: config.model,
|
| 169 |
-
temperature: config.temperature,
|
| 170 |
-
maxTokens: config.maxTokens,
|
| 171 |
-
role: config.description,
|
| 172 |
-
goal: config.category,
|
| 173 |
-
description: config.systemPrompt
|
| 174 |
-
}))
|
| 175 |
-
|
| 176 |
-
// Also update chat settings for Step 2
|
| 177 |
-
setSelectedModel(config.model)
|
| 178 |
-
setSystemPrompt(config.systemPrompt)
|
| 179 |
-
setTemperature(config.temperature)
|
| 180 |
-
setMaxTokens(config.maxTokens)
|
| 181 |
-
|
| 182 |
-
// Set current assistant for RAG
|
| 183 |
-
setCurrentAssistant({
|
| 184 |
-
id: assistantId,
|
| 185 |
-
name: config.name,
|
| 186 |
-
type: 'template'
|
| 187 |
-
})
|
| 188 |
-
}
|
| 189 |
-
}
|
| 190 |
-
}
|
| 191 |
-
|
| 192 |
// Sync deviceConfig changes to chat settings
|
| 193 |
useEffect(() => {
|
| 194 |
setSelectedModel(deviceConfig.model)
|
|
|
|
| 132 |
const assistantConfigs = ASSISTANT_CONFIGS
|
| 133 |
const messages = currentSession?.messages || []
|
| 134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
// Sync deviceConfig changes to chat settings
|
| 136 |
useEffect(() => {
|
| 137 |
setSelectedModel(deviceConfig.model)
|
static/assets/index-6ef35175.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
static/assets/index-6ef35175.js.map
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
static/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Edge LLM</title>
|
| 8 |
-
<script type="module" crossorigin src="/assets/index-
|
| 9 |
<link rel="stylesheet" href="/assets/index-93afbc88.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
|
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Edge LLM</title>
|
| 8 |
+
<script type="module" crossorigin src="/assets/index-6ef35175.js"></script>
|
| 9 |
<link rel="stylesheet" href="/assets/index-93afbc88.css">
|
| 10 |
</head>
|
| 11 |
<body>
|