Spaces:
Runtime error
Runtime error
Andrew
commited on
Commit
·
70c72fa
1
Parent(s):
69e900d
Add person lock field and occupation to jobSector rename
Browse files
src/lib/components/chat/ChatWindow.svelte
CHANGED
|
@@ -46,6 +46,7 @@
|
|
| 46 |
models: Model[];
|
| 47 |
preprompt?: string | undefined;
|
| 48 |
personaId?: string;
|
|
|
|
| 49 |
files?: File[];
|
| 50 |
onmessage?: (content: string) => void;
|
| 51 |
onstop?: () => void;
|
|
@@ -64,6 +65,7 @@
|
|
| 64 |
models,
|
| 65 |
preprompt = undefined,
|
| 66 |
personaId,
|
|
|
|
| 67 |
files = $bindable([]),
|
| 68 |
onmessage,
|
| 69 |
onstop,
|
|
@@ -356,20 +358,20 @@
|
|
| 356 |
{#if messages.length > 0}
|
| 357 |
<div class="flex h-max flex-col gap-8 pb-52">
|
| 358 |
{#each messages as message, idx (message.id)}
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
{/each}
|
| 374 |
{#if isReadOnly}
|
| 375 |
<ModelSwitch {models} {currentModel} />
|
|
@@ -492,7 +494,7 @@
|
|
| 492 |
"max-sm:hidden": focused && isVirtualKeyboard(),
|
| 493 |
}}
|
| 494 |
>
|
| 495 |
-
<PersonaSelector />
|
| 496 |
{#if models.find((m) => m.id === currentModel.id)}
|
| 497 |
{#if !currentModel.isRouter || !loading}
|
| 498 |
<a
|
|
|
|
| 46 |
models: Model[];
|
| 47 |
preprompt?: string | undefined;
|
| 48 |
personaId?: string;
|
| 49 |
+
lockedPersonaId?: string;
|
| 50 |
files?: File[];
|
| 51 |
onmessage?: (content: string) => void;
|
| 52 |
onstop?: () => void;
|
|
|
|
| 65 |
models,
|
| 66 |
preprompt = undefined,
|
| 67 |
personaId,
|
| 68 |
+
lockedPersonaId,
|
| 69 |
files = $bindable([]),
|
| 70 |
onmessage,
|
| 71 |
onstop,
|
|
|
|
| 358 |
{#if messages.length > 0}
|
| 359 |
<div class="flex h-max flex-col gap-8 pb-52">
|
| 360 |
{#each messages as message, idx (message.id)}
|
| 361 |
+
<ChatMessage
|
| 362 |
+
{loading}
|
| 363 |
+
{message}
|
| 364 |
+
alternatives={messagesAlternatives.find((a) => a.includes(message.id)) ?? []}
|
| 365 |
+
isAuthor={!shared}
|
| 366 |
+
readOnly={isReadOnly}
|
| 367 |
+
isLast={idx === messages.length - 1}
|
| 368 |
+
personaName={message.from === "assistant" && !message.personaResponses ? persona?.name : undefined}
|
| 369 |
+
personaOccupation={message.from === "assistant" && !message.personaResponses ? persona?.jobSector : undefined}
|
| 370 |
+
personaStance={message.from === "assistant" && !message.personaResponses ? persona?.stance : undefined}
|
| 371 |
+
bind:editMsdgId
|
| 372 |
+
onretry={(payload) => onretry?.(payload)}
|
| 373 |
+
onshowAlternateMsg={(payload) => onshowAlternateMsg?.(payload)}
|
| 374 |
+
/>
|
| 375 |
{/each}
|
| 376 |
{#if isReadOnly}
|
| 377 |
<ModelSwitch {models} {currentModel} />
|
|
|
|
| 494 |
"max-sm:hidden": focused && isVirtualKeyboard(),
|
| 495 |
}}
|
| 496 |
>
|
| 497 |
+
<PersonaSelector {lockedPersonaId} />
|
| 498 |
{#if models.find((m) => m.id === currentModel.id)}
|
| 499 |
{#if !currentModel.isRouter || !loading}
|
| 500 |
<a
|