✨ COMPLETE: Add template loading support in Assistant Studio
Browse files✅ Template Integration:
- Added localStorage template loading logic in Playground
- Templates from Templates page now properly load into Assistant Studio
- Automatic cleanup of loaded configuration after use
- Error handling for corrupted template data
� Cross-page workflow:
1. User selects template in Templates page → saves to localStorage
2. User navigates to Playground (Assistant Studio)
3. Playground detects saved template → auto-loads configuration
4. Configuration applied to system prompt, temperature, tokens, model
5. Template marked as loaded with proper assistant info
� Complete Integration:
- ✅ Templates page: 3 use case templates
- ✅ Assistant Studio: 3 use case presets
- ✅ Cross-page template loading: working
- ✅ All assistant functionality: maintained
� Result: Both Templates and Assistant Studio now consistently show only the 3 core use cases
|
@@ -340,6 +340,31 @@ export function Playground() {
|
|
| 340 |
useEffect(() => {
|
| 341 |
fetchModels()
|
| 342 |
loadSavedAssistants()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 343 |
}, [])
|
| 344 |
|
| 345 |
// Debug logs for Session issue
|
|
|
|
| 340 |
useEffect(() => {
|
| 341 |
fetchModels()
|
| 342 |
loadSavedAssistants()
|
| 343 |
+
|
| 344 |
+
// Check if there's a template configuration to load
|
| 345 |
+
const loadConfig = localStorage.getItem('loadAssistantConfig')
|
| 346 |
+
if (loadConfig) {
|
| 347 |
+
try {
|
| 348 |
+
const config = JSON.parse(loadConfig)
|
| 349 |
+
setSystemPrompt(config.systemPrompt || '')
|
| 350 |
+
setTemperature(config.temperature || 0.7)
|
| 351 |
+
setMaxTokens(config.maxTokens || 1024)
|
| 352 |
+
if (config.model) {
|
| 353 |
+
setSelectedModel(config.model)
|
| 354 |
+
}
|
| 355 |
+
setSelectedAssistant({
|
| 356 |
+
id: 'loaded_template',
|
| 357 |
+
name: config.name || 'Loaded Template',
|
| 358 |
+
type: 'template'
|
| 359 |
+
})
|
| 360 |
+
|
| 361 |
+
// Clear the config after loading
|
| 362 |
+
localStorage.removeItem('loadAssistantConfig')
|
| 363 |
+
} catch (error) {
|
| 364 |
+
console.error('Failed to load assistant config:', error)
|
| 365 |
+
localStorage.removeItem('loadAssistantConfig')
|
| 366 |
+
}
|
| 367 |
+
}
|
| 368 |
}, [])
|
| 369 |
|
| 370 |
// Debug logs for Session issue
|
|
The diff for this file is too large to render.
See raw diff
|
|
|
|
The diff for this file is too large to render.
See raw diff
|
|
|
|
@@ -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-3910a5a8.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-daab7b3c.js"></script>
|
| 9 |
<link rel="stylesheet" href="/assets/index-3910a5a8.css">
|
| 10 |
</head>
|
| 11 |
<body>
|