Spaces:
Sleeping
Sleeping
Andrew
commited on
Commit
·
c729f58
1
Parent(s):
9a5b276
refactor(ui): update home page for multi-persona chat context
Browse files- src/routes/+page.svelte +9 -3
src/routes/+page.svelte
CHANGED
|
@@ -3,16 +3,16 @@
|
|
| 3 |
import { base } from "$app/paths";
|
| 4 |
import { page } from "$app/state";
|
| 5 |
import { usePublicConfig } from "$lib/utils/PublicConfig.svelte";
|
| 6 |
-
|
| 7 |
-
const publicConfig = usePublicConfig();
|
| 8 |
-
|
| 9 |
import ChatWindow from "$lib/components/chat/ChatWindow.svelte";
|
| 10 |
import { ERROR_MESSAGES, error } from "$lib/stores/errors";
|
| 11 |
import { pendingMessage } from "$lib/stores/pendingMessage";
|
| 12 |
import { useSettingsStore } from "$lib/stores/settings.js";
|
| 13 |
import { findCurrentModel } from "$lib/utils/models";
|
|
|
|
| 14 |
import { onMount } from "svelte";
|
| 15 |
|
|
|
|
|
|
|
| 16 |
let { data } = $props();
|
| 17 |
|
| 18 |
let hasModels = $derived(Boolean(data.models?.length));
|
|
@@ -25,6 +25,12 @@
|
|
| 25 |
try {
|
| 26 |
loading = true;
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
// check if $settings.activeModel is a valid model
|
| 29 |
// else check if it's an assistant, and use that model
|
| 30 |
// else use the first model
|
|
|
|
| 3 |
import { base } from "$app/paths";
|
| 4 |
import { page } from "$app/state";
|
| 5 |
import { usePublicConfig } from "$lib/utils/PublicConfig.svelte";
|
|
|
|
|
|
|
|
|
|
| 6 |
import ChatWindow from "$lib/components/chat/ChatWindow.svelte";
|
| 7 |
import { ERROR_MESSAGES, error } from "$lib/stores/errors";
|
| 8 |
import { pendingMessage } from "$lib/stores/pendingMessage";
|
| 9 |
import { useSettingsStore } from "$lib/stores/settings.js";
|
| 10 |
import { findCurrentModel } from "$lib/utils/models";
|
| 11 |
+
import { resetActivePersonasToDefaults } from "$lib/utils/personaDefaults";
|
| 12 |
import { onMount } from "svelte";
|
| 13 |
|
| 14 |
+
const publicConfig = usePublicConfig();
|
| 15 |
+
|
| 16 |
let { data } = $props();
|
| 17 |
|
| 18 |
let hasModels = $derived(Boolean(data.models?.length));
|
|
|
|
| 25 |
try {
|
| 26 |
loading = true;
|
| 27 |
|
| 28 |
+
await resetActivePersonasToDefaults(
|
| 29 |
+
settings,
|
| 30 |
+
$settings.personas,
|
| 31 |
+
$settings.activePersonas
|
| 32 |
+
);
|
| 33 |
+
|
| 34 |
// check if $settings.activeModel is a valid model
|
| 35 |
// else check if it's an assistant, and use that model
|
| 36 |
// else use the first model
|