Spaces:
Runtime error
Runtime error
Revert "chore(deps): update major versions on svelte, sveltekit & node (#1281)"
Browse files- package-lock.json +0 -0
- package.json +5 -5
- src/lib/components/ExpandNavigation.svelte +1 -1
- src/lib/components/MobileNav.svelte +1 -1
- src/lib/components/NavMenu.svelte +2 -2
- src/lib/components/Pagination.svelte +1 -1
- src/lib/components/chat/AssistantIntroduction.svelte +3 -3
- src/lib/components/chat/ChatIntroduction.svelte +1 -1
- src/lib/components/chat/ChatMessage.svelte +10 -10
- src/lib/components/chat/ChatWindow.svelte +4 -4
- src/lib/server/endpoints/anthropic/utils.ts +1 -1
- src/lib/server/endpoints/cohere/endpointCohere.ts +1 -1
- src/routes/+layout.svelte +1 -1
- src/routes/assistants/+page.svelte +4 -4
- src/routes/settings/(nav)/+page.svelte +1 -1
- svelte.config.js +1 -1
package-lock.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
package.json
CHANGED
|
@@ -19,8 +19,8 @@
|
|
| 19 |
"@faker-js/faker": "^8.4.1",
|
| 20 |
"@iconify-json/carbon": "^1.1.16",
|
| 21 |
"@iconify-json/eos-icons": "^1.1.6",
|
| 22 |
-
"@sveltejs/adapter-node": "^
|
| 23 |
-
"@sveltejs/kit": "^
|
| 24 |
"@tailwindcss/typography": "^0.5.9",
|
| 25 |
"@types/express": "^4.17.21",
|
| 26 |
"@types/js-yaml": "^4.0.9",
|
|
@@ -40,14 +40,14 @@
|
|
| 40 |
"prettier-plugin-svelte": "^2.10.1",
|
| 41 |
"prettier-plugin-tailwindcss": "^0.2.7",
|
| 42 |
"prom-client": "^15.1.2",
|
| 43 |
-
"svelte": "^4.2.
|
| 44 |
"svelte-check": "^3.6.2",
|
| 45 |
"ts-node": "^10.9.1",
|
| 46 |
"tslib": "^2.4.1",
|
| 47 |
"typescript": "^5.0.0",
|
| 48 |
"unplugin-icons": "^0.16.1",
|
| 49 |
-
"vite": "^5.
|
| 50 |
-
"vite-node": "^1.
|
| 51 |
"vitest": "^0.31.0"
|
| 52 |
},
|
| 53 |
"type": "module",
|
|
|
|
| 19 |
"@faker-js/faker": "^8.4.1",
|
| 20 |
"@iconify-json/carbon": "^1.1.16",
|
| 21 |
"@iconify-json/eos-icons": "^1.1.6",
|
| 22 |
+
"@sveltejs/adapter-node": "^1.3.1",
|
| 23 |
+
"@sveltejs/kit": "^1.30.4",
|
| 24 |
"@tailwindcss/typography": "^0.5.9",
|
| 25 |
"@types/express": "^4.17.21",
|
| 26 |
"@types/js-yaml": "^4.0.9",
|
|
|
|
| 40 |
"prettier-plugin-svelte": "^2.10.1",
|
| 41 |
"prettier-plugin-tailwindcss": "^0.2.7",
|
| 42 |
"prom-client": "^15.1.2",
|
| 43 |
+
"svelte": "^4.2.8",
|
| 44 |
"svelte-check": "^3.6.2",
|
| 45 |
"ts-node": "^10.9.1",
|
| 46 |
"tslib": "^2.4.1",
|
| 47 |
"typescript": "^5.0.0",
|
| 48 |
"unplugin-icons": "^0.16.1",
|
| 49 |
+
"vite": "^4.5.3",
|
| 50 |
+
"vite-node": "^1.3.1",
|
| 51 |
"vitest": "^0.31.0"
|
| 52 |
},
|
| 53 |
"type": "module",
|
src/lib/components/ExpandNavigation.svelte
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
|
| 6 |
<button
|
| 7 |
on:click
|
| 8 |
-
class="{classNames} group flex h-16 w-6 flex-col items-center justify-center -space-y-1 outline-none *:h-3 *:w-1 *:rounded-full *:hover:bg-gray-300 dark:*:hover:bg-gray-600
|
| 9 |
? '*:bg-gray-200/70 dark:*:bg-gray-800'
|
| 10 |
: '*:bg-gray-200 dark:*:bg-gray-700'}"
|
| 11 |
>
|
|
|
|
| 5 |
|
| 6 |
<button
|
| 7 |
on:click
|
| 8 |
+
class="{classNames} group flex h-16 w-6 flex-col items-center justify-center -space-y-1 outline-none *:h-3 *:w-1 *:rounded-full *:hover:bg-gray-300 max-md:hidden dark:*:hover:bg-gray-600 {!isCollapsed
|
| 9 |
? '*:bg-gray-200/70 dark:*:bg-gray-800'
|
| 10 |
: '*:bg-gray-200 dark:*:bg-gray-700'}"
|
| 11 |
>
|
src/lib/components/MobileNav.svelte
CHANGED
|
@@ -31,7 +31,7 @@
|
|
| 31 |
</script>
|
| 32 |
|
| 33 |
<nav
|
| 34 |
-
class="flex h-12 items-center justify-between border-b bg-gray-50 px-3 dark:border-gray-800 dark:bg-gray-800/70
|
| 35 |
>
|
| 36 |
<button
|
| 37 |
type="button"
|
|
|
|
| 31 |
</script>
|
| 32 |
|
| 33 |
<nav
|
| 34 |
+
class="flex h-12 items-center justify-between border-b bg-gray-50 px-3 md:hidden dark:border-gray-800 dark:bg-gray-800/70"
|
| 35 |
>
|
| 36 |
<button
|
| 37 |
type="button"
|
src/lib/components/NavMenu.svelte
CHANGED
|
@@ -63,7 +63,7 @@
|
|
| 63 |
</a>
|
| 64 |
</div>
|
| 65 |
<div
|
| 66 |
-
class="scrollbar-custom flex flex-col gap-1 overflow-y-auto rounded-r-xl from-gray-50 px-3 pb-3 pt-2
|
| 67 |
>
|
| 68 |
{#each Object.entries(groupedConversations) as [group, convs]}
|
| 69 |
{#if convs.length}
|
|
@@ -92,7 +92,7 @@
|
|
| 92 |
{#if !user.logoutDisabled}
|
| 93 |
<button
|
| 94 |
type="submit"
|
| 95 |
-
class="ml-auto h-6 flex-none items-center gap-1.5 rounded-md border bg-white px-2 text-gray-700 shadow-sm group-hover:flex hover:shadow-none dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400 dark:hover:text-gray-300
|
| 96 |
>
|
| 97 |
Sign Out
|
| 98 |
</button>
|
|
|
|
| 63 |
</a>
|
| 64 |
</div>
|
| 65 |
<div
|
| 66 |
+
class="scrollbar-custom flex flex-col gap-1 overflow-y-auto rounded-r-xl from-gray-50 px-3 pb-3 pt-2 max-sm:bg-gradient-to-t md:bg-gradient-to-l dark:from-gray-800/30"
|
| 67 |
>
|
| 68 |
{#each Object.entries(groupedConversations) as [group, convs]}
|
| 69 |
{#if convs.length}
|
|
|
|
| 92 |
{#if !user.logoutDisabled}
|
| 93 |
<button
|
| 94 |
type="submit"
|
| 95 |
+
class="ml-auto h-6 flex-none items-center gap-1.5 rounded-md border bg-white px-2 text-gray-700 shadow-sm group-hover:flex hover:shadow-none md:hidden dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400 dark:hover:text-gray-300"
|
| 96 |
>
|
| 97 |
Sign Out
|
| 98 |
</button>
|
src/lib/components/Pagination.svelte
CHANGED
|
@@ -57,7 +57,7 @@
|
|
| 57 |
{#if numTotalPages > 1}
|
| 58 |
<nav>
|
| 59 |
<ul
|
| 60 |
-
class="flex select-none items-center justify-between space-x-2 text-gray-700 dark:text-gray-300
|
| 61 |
>
|
| 62 |
<li>
|
| 63 |
<PaginationArrow
|
|
|
|
| 57 |
{#if numTotalPages > 1}
|
| 58 |
<nav>
|
| 59 |
<ul
|
| 60 |
+
class="flex select-none items-center justify-between space-x-2 text-gray-700 sm:justify-center dark:text-gray-300 {classNames}"
|
| 61 |
>
|
| 62 |
<li>
|
| 63 |
<PaginationArrow
|
src/lib/components/chat/AssistantIntroduction.svelte
CHANGED
|
@@ -67,7 +67,7 @@
|
|
| 67 |
/>
|
| 68 |
{:else}
|
| 69 |
<div
|
| 70 |
-
class="flex size-12 flex-none items-center justify-center rounded-full bg-gray-300 object-cover text-xl font-bold uppercase text-gray-500
|
| 71 |
>
|
| 72 |
{assistant?.name[0]}
|
| 73 |
</div>
|
|
@@ -116,7 +116,7 @@
|
|
| 116 |
<div class="absolute right-3 top-3 md:right-4 md:top-4">
|
| 117 |
<div class="flex flex-row items-center gap-1">
|
| 118 |
<button
|
| 119 |
-
class="flex h-7 items-center gap-1.5 rounded-full border bg-white px-2.5 py-1 text-gray-800 shadow-sm hover:shadow-inner dark:border-gray-700 dark:bg-gray-700 dark:text-gray-300/90 dark:hover:bg-gray-800
|
| 120 |
on:click={() => {
|
| 121 |
if (!isCopied) {
|
| 122 |
share(shareUrl, assistant.name);
|
|
@@ -137,7 +137,7 @@
|
|
| 137 |
</button>
|
| 138 |
<a
|
| 139 |
href="{base}/settings/assistants/{assistant._id.toString()}"
|
| 140 |
-
class="flex h-7 items-center gap-1.5 rounded-full border bg-white px-2.5 py-1 text-gray-800 shadow-sm hover:shadow-inner dark:border-gray-700 dark:bg-gray-700 dark:text-gray-300/90 dark:hover:bg-gray-800
|
| 141 |
><IconGear class="text-xxs" />Settings</a
|
| 142 |
>
|
| 143 |
</div>
|
|
|
|
| 67 |
/>
|
| 68 |
{:else}
|
| 69 |
<div
|
| 70 |
+
class="flex size-12 flex-none items-center justify-center rounded-full bg-gray-300 object-cover text-xl font-bold uppercase text-gray-500 max-sm:self-start sm:text-4xl md:size-32 dark:bg-gray-600"
|
| 71 |
>
|
| 72 |
{assistant?.name[0]}
|
| 73 |
</div>
|
|
|
|
| 116 |
<div class="absolute right-3 top-3 md:right-4 md:top-4">
|
| 117 |
<div class="flex flex-row items-center gap-1">
|
| 118 |
<button
|
| 119 |
+
class="flex h-7 items-center gap-1.5 rounded-full border bg-white px-2.5 py-1 text-gray-800 shadow-sm hover:shadow-inner max-sm:px-1.5 md:text-sm dark:border-gray-700 dark:bg-gray-700 dark:text-gray-300/90 dark:hover:bg-gray-800"
|
| 120 |
on:click={() => {
|
| 121 |
if (!isCopied) {
|
| 122 |
share(shareUrl, assistant.name);
|
|
|
|
| 137 |
</button>
|
| 138 |
<a
|
| 139 |
href="{base}/settings/assistants/{assistant._id.toString()}"
|
| 140 |
+
class="flex h-7 items-center gap-1.5 rounded-full border bg-white px-2.5 py-1 text-gray-800 shadow-sm hover:shadow-inner md:text-sm dark:border-gray-700 dark:bg-gray-700 dark:text-gray-300/90 dark:hover:bg-gray-800"
|
| 141 |
><IconGear class="text-xxs" />Settings</a
|
| 142 |
>
|
| 143 |
</div>
|
src/lib/components/chat/ChatIntroduction.svelte
CHANGED
|
@@ -86,7 +86,7 @@
|
|
| 86 |
{#each currentModelMetadata.promptExamples as example}
|
| 87 |
<button
|
| 88 |
type="button"
|
| 89 |
-
class="rounded-xl border bg-gray-50 p-3 text-gray-600 hover:bg-gray-100 dark:border-gray-800 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700
|
| 90 |
on:click={() => dispatch("message", example.prompt)}
|
| 91 |
>
|
| 92 |
{example.title}
|
|
|
|
| 86 |
{#each currentModelMetadata.promptExamples as example}
|
| 87 |
<button
|
| 88 |
type="button"
|
| 89 |
+
class="rounded-xl border bg-gray-50 p-3 text-gray-600 hover:bg-gray-100 max-xl:text-sm xl:p-3.5 dark:border-gray-800 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700"
|
| 90 |
on:click={() => dispatch("message", example.prompt)}
|
| 91 |
>
|
| 92 |
{example.title}
|
src/lib/components/chat/ChatMessage.svelte
CHANGED
|
@@ -298,7 +298,7 @@
|
|
| 298 |
{/if}
|
| 299 |
|
| 300 |
<div
|
| 301 |
-
class="prose max-w-none
|
| 302 |
bind:this={contentEl}
|
| 303 |
>
|
| 304 |
{#if isLast && loading && reducedMotionMode}
|
|
@@ -344,7 +344,7 @@
|
|
| 344 |
>
|
| 345 |
{#if isAuthor}
|
| 346 |
<button
|
| 347 |
-
class="btn rounded-sm p-1 text-sm text-gray-400 hover:text-gray-500
|
| 348 |
{message.score && message.score > 0
|
| 349 |
? 'text-green-500 hover:text-green-500 dark:text-green-400 hover:dark:text-green-400'
|
| 350 |
: ''}"
|
|
@@ -356,7 +356,7 @@
|
|
| 356 |
<CarbonThumbsUp class="h-[1.14em] w-[1.14em]" />
|
| 357 |
</button>
|
| 358 |
<button
|
| 359 |
-
class="btn rounded-sm p-1 text-sm text-gray-400 hover:text-gray-500
|
| 360 |
{message.score && message.score < 0
|
| 361 |
? 'text-red-500 hover:text-red-500 dark:text-red-400 hover:dark:text-red-400'
|
| 362 |
: ''}"
|
|
@@ -369,7 +369,7 @@
|
|
| 369 |
</button>
|
| 370 |
{/if}
|
| 371 |
<button
|
| 372 |
-
class="btn rounded-sm p-1 text-sm text-gray-400 hover:text-gray-500
|
| 373 |
title="Retry"
|
| 374 |
type="button"
|
| 375 |
on:click={() => dispatch("retry", { id: message.id })}
|
|
@@ -440,7 +440,7 @@
|
|
| 440 |
class="btn rounded-lg px-3 py-1.5 text-sm
|
| 441 |
{loading
|
| 442 |
? 'bg-gray-300 text-gray-400 dark:bg-gray-700 dark:text-gray-600'
|
| 443 |
-
: 'bg-gray-200 text-gray-600 hover:text-gray-800
|
| 444 |
"
|
| 445 |
disabled={loading}
|
| 446 |
>
|
|
@@ -448,7 +448,7 @@
|
|
| 448 |
</button>
|
| 449 |
<button
|
| 450 |
type="button"
|
| 451 |
-
class="btn rounded-sm p-2 text-sm text-gray-400 hover:text-gray-500
|
| 452 |
on:click={() => {
|
| 453 |
$convTreeStore.editing = null;
|
| 454 |
}}
|
|
@@ -470,7 +470,7 @@
|
|
| 470 |
<div class="mx-auto flex flex-row flex-nowrap gap-2">
|
| 471 |
{#if downloadLink}
|
| 472 |
<a
|
| 473 |
-
class="rounded-lg border border-gray-100 bg-gray-100 p-1 text-xs text-gray-400 group-hover:block hover:text-gray-500 dark:border-gray-800 dark:bg-gray-800 dark:text-gray-400 dark:hover:text-gray-300
|
| 474 |
title="Download prompt and parameters"
|
| 475 |
type="button"
|
| 476 |
target="_blank"
|
|
@@ -481,7 +481,7 @@
|
|
| 481 |
{/if}
|
| 482 |
{#if !readOnly}
|
| 483 |
<button
|
| 484 |
-
class="cursor-pointer rounded-lg border border-gray-100 bg-gray-100 p-1 text-xs text-gray-400 group-hover:block hover:text-gray-500 dark:border-gray-800 dark:bg-gray-800 dark:text-gray-400 dark:hover:text-gray-300
|
| 485 |
title="Branch"
|
| 486 |
type="button"
|
| 487 |
on:click={() => ($convTreeStore.editing = message.id)}
|
|
@@ -516,7 +516,7 @@
|
|
| 516 |
class="font-white group/navbranch z-10 -mt-1 ml-3.5 mr-auto flex h-6 w-fit select-none flex-row items-center justify-center gap-1 text-sm"
|
| 517 |
>
|
| 518 |
<button
|
| 519 |
-
class="inline text-lg font-thin text-gray-400
|
| 520 |
on:click={() => (childrenToRender = Math.max(0, childrenToRender - 1))}
|
| 521 |
disabled={childrenToRender === 0 || loading}
|
| 522 |
>
|
|
@@ -526,7 +526,7 @@
|
|
| 526 |
{childrenToRender + 1} / {nChildren}
|
| 527 |
</span>
|
| 528 |
<button
|
| 529 |
-
class="inline text-lg font-thin text-gray-400
|
| 530 |
on:click={() =>
|
| 531 |
(childrenToRender = Math.min(
|
| 532 |
message?.children?.length ?? 1 - 1,
|
|
|
|
| 298 |
{/if}
|
| 299 |
|
| 300 |
<div
|
| 301 |
+
class="prose max-w-none max-sm:prose-sm dark:prose-invert prose-headings:font-semibold prose-h1:text-lg prose-h2:text-base prose-h3:text-base prose-pre:bg-gray-800 dark:prose-pre:bg-gray-900"
|
| 302 |
bind:this={contentEl}
|
| 303 |
>
|
| 304 |
{#if isLast && loading && reducedMotionMode}
|
|
|
|
| 344 |
>
|
| 345 |
{#if isAuthor}
|
| 346 |
<button
|
| 347 |
+
class="btn rounded-sm p-1 text-sm text-gray-400 focus:ring-0 hover:text-gray-500 dark:text-gray-400 dark:hover:text-gray-300
|
| 348 |
{message.score && message.score > 0
|
| 349 |
? 'text-green-500 hover:text-green-500 dark:text-green-400 hover:dark:text-green-400'
|
| 350 |
: ''}"
|
|
|
|
| 356 |
<CarbonThumbsUp class="h-[1.14em] w-[1.14em]" />
|
| 357 |
</button>
|
| 358 |
<button
|
| 359 |
+
class="btn rounded-sm p-1 text-sm text-gray-400 focus:ring-0 hover:text-gray-500 dark:text-gray-400 dark:hover:text-gray-300
|
| 360 |
{message.score && message.score < 0
|
| 361 |
? 'text-red-500 hover:text-red-500 dark:text-red-400 hover:dark:text-red-400'
|
| 362 |
: ''}"
|
|
|
|
| 369 |
</button>
|
| 370 |
{/if}
|
| 371 |
<button
|
| 372 |
+
class="btn rounded-sm p-1 text-sm text-gray-400 focus:ring-0 hover:text-gray-500 dark:text-gray-400 dark:hover:text-gray-300"
|
| 373 |
title="Retry"
|
| 374 |
type="button"
|
| 375 |
on:click={() => dispatch("retry", { id: message.id })}
|
|
|
|
| 440 |
class="btn rounded-lg px-3 py-1.5 text-sm
|
| 441 |
{loading
|
| 442 |
? 'bg-gray-300 text-gray-400 dark:bg-gray-700 dark:text-gray-600'
|
| 443 |
+
: 'bg-gray-200 text-gray-600 focus:ring-0 hover:text-gray-800 dark:bg-gray-800 dark:text-gray-300 dark:hover:text-gray-200'}
|
| 444 |
"
|
| 445 |
disabled={loading}
|
| 446 |
>
|
|
|
|
| 448 |
</button>
|
| 449 |
<button
|
| 450 |
type="button"
|
| 451 |
+
class="btn rounded-sm p-2 text-sm text-gray-400 focus:ring-0 hover:text-gray-500 dark:text-gray-400 dark:hover:text-gray-300"
|
| 452 |
on:click={() => {
|
| 453 |
$convTreeStore.editing = null;
|
| 454 |
}}
|
|
|
|
| 470 |
<div class="mx-auto flex flex-row flex-nowrap gap-2">
|
| 471 |
{#if downloadLink}
|
| 472 |
<a
|
| 473 |
+
class="rounded-lg border border-gray-100 bg-gray-100 p-1 text-xs text-gray-400 group-hover:block hover:text-gray-500 max-sm:!hidden md:hidden dark:border-gray-800 dark:bg-gray-800 dark:text-gray-400 dark:hover:text-gray-300"
|
| 474 |
title="Download prompt and parameters"
|
| 475 |
type="button"
|
| 476 |
target="_blank"
|
|
|
|
| 481 |
{/if}
|
| 482 |
{#if !readOnly}
|
| 483 |
<button
|
| 484 |
+
class="cursor-pointer rounded-lg border border-gray-100 bg-gray-100 p-1 text-xs text-gray-400 group-hover:block hover:text-gray-500 md:hidden lg:-right-2 dark:border-gray-800 dark:bg-gray-800 dark:text-gray-400 dark:hover:text-gray-300"
|
| 485 |
title="Branch"
|
| 486 |
type="button"
|
| 487 |
on:click={() => ($convTreeStore.editing = message.id)}
|
|
|
|
| 516 |
class="font-white group/navbranch z-10 -mt-1 ml-3.5 mr-auto flex h-6 w-fit select-none flex-row items-center justify-center gap-1 text-sm"
|
| 517 |
>
|
| 518 |
<button
|
| 519 |
+
class="inline text-lg font-thin text-gray-400 disabled:pointer-events-none disabled:opacity-25 hover:text-gray-800 dark:text-gray-500 dark:hover:text-gray-200"
|
| 520 |
on:click={() => (childrenToRender = Math.max(0, childrenToRender - 1))}
|
| 521 |
disabled={childrenToRender === 0 || loading}
|
| 522 |
>
|
|
|
|
| 526 |
{childrenToRender + 1} / {nChildren}
|
| 527 |
</span>
|
| 528 |
<button
|
| 529 |
+
class="inline text-lg font-thin text-gray-400 disabled:pointer-events-none disabled:opacity-25 hover:text-gray-800 dark:text-gray-500 dark:hover:text-gray-200"
|
| 530 |
on:click={() =>
|
| 531 |
(childrenToRender = Math.min(
|
| 532 |
message?.children?.length ?? 1 - 1,
|
src/lib/components/chat/ChatWindow.svelte
CHANGED
|
@@ -271,7 +271,7 @@
|
|
| 271 |
/>
|
| 272 |
</div>
|
| 273 |
<div
|
| 274 |
-
class="dark:via-gray-80 pointer-events-none absolute inset-x-0 bottom-0 z-0 mx-auto flex w-full max-w-3xl flex-col items-center justify-center bg-gradient-to-t from-white via-white/80 to-white/0 px-3.5 py-4 dark:border-gray-800 dark:from-gray-900 dark:to-gray-900/0 max-md:
|
| 275 |
>
|
| 276 |
{#if sources?.length}
|
| 277 |
<div class="flex flex-row flex-wrap justify-center gap-2.5 max-md:pb-3">
|
|
@@ -366,19 +366,19 @@
|
|
| 366 |
|
| 367 |
{#if loading}
|
| 368 |
<button
|
| 369 |
-
class="btn mx-1 my-1 inline-block h-[2.4rem] self-end rounded-lg bg-transparent p-1 px-[0.7rem] text-gray-400 enabled:hover:text-gray-700 disabled:opacity-
|
| 370 |
on:click={() => dispatch("stop")}
|
| 371 |
>
|
| 372 |
<CarbonStopFilledAlt />
|
| 373 |
</button>
|
| 374 |
<div
|
| 375 |
-
class="mx-1 my-1 hidden h-[2.4rem] items-center p-1 px-[0.7rem] text-gray-400 enabled:hover:text-gray-700 disabled:opacity-
|
| 376 |
>
|
| 377 |
<EosIconsLoading />
|
| 378 |
</div>
|
| 379 |
{:else}
|
| 380 |
<button
|
| 381 |
-
class="btn mx-1 my-1 h-[2.4rem] self-end rounded-lg bg-transparent p-1 px-[0.7rem] text-gray-400 enabled:hover:text-gray-700 disabled:opacity-
|
| 382 |
disabled={!message || isReadOnly}
|
| 383 |
type="submit"
|
| 384 |
>
|
|
|
|
| 271 |
/>
|
| 272 |
</div>
|
| 273 |
<div
|
| 274 |
+
class="dark:via-gray-80 pointer-events-none absolute inset-x-0 bottom-0 z-0 mx-auto flex w-full max-w-3xl flex-col items-center justify-center bg-gradient-to-t from-white via-white/80 to-white/0 px-3.5 py-4 max-md:border-t max-md:bg-white sm:px-5 md:py-8 xl:max-w-4xl dark:border-gray-800 dark:from-gray-900 dark:to-gray-900/0 max-md:dark:bg-gray-900 [&>*]:pointer-events-auto"
|
| 275 |
>
|
| 276 |
{#if sources?.length}
|
| 277 |
<div class="flex flex-row flex-wrap justify-center gap-2.5 max-md:pb-3">
|
|
|
|
| 366 |
|
| 367 |
{#if loading}
|
| 368 |
<button
|
| 369 |
+
class="btn mx-1 my-1 inline-block h-[2.4rem] self-end rounded-lg bg-transparent p-1 px-[0.7rem] text-gray-400 disabled:opacity-60 enabled:hover:text-gray-700 md:hidden dark:disabled:opacity-40 enabled:dark:hover:text-gray-100"
|
| 370 |
on:click={() => dispatch("stop")}
|
| 371 |
>
|
| 372 |
<CarbonStopFilledAlt />
|
| 373 |
</button>
|
| 374 |
<div
|
| 375 |
+
class="mx-1 my-1 hidden h-[2.4rem] items-center p-1 px-[0.7rem] text-gray-400 disabled:opacity-60 enabled:hover:text-gray-700 md:flex dark:disabled:opacity-40 enabled:dark:hover:text-gray-100"
|
| 376 |
>
|
| 377 |
<EosIconsLoading />
|
| 378 |
</div>
|
| 379 |
{:else}
|
| 380 |
<button
|
| 381 |
+
class="btn mx-1 my-1 h-[2.4rem] self-end rounded-lg bg-transparent p-1 px-[0.7rem] text-gray-400 disabled:opacity-60 enabled:hover:text-gray-700 dark:disabled:opacity-40 enabled:dark:hover:text-gray-100"
|
| 382 |
disabled={!message || isReadOnly}
|
| 383 |
type="submit"
|
| 384 |
>
|
src/lib/server/endpoints/anthropic/utils.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import type { ImageBlockParam, MessageParam } from "@anthropic-ai/sdk/resources
|
| 2 |
import { makeImageProcessor, type ImageProcessorOptions } from "../images";
|
| 3 |
import type { EndpointMessage } from "../endpoints";
|
| 4 |
import type { MessageFile } from "$lib/types/Message";
|
|
|
|
| 1 |
+
import type { ImageBlockParam, MessageParam } from "@anthropic-ai/sdk/resources";
|
| 2 |
import { makeImageProcessor, type ImageProcessorOptions } from "../images";
|
| 3 |
import type { EndpointMessage } from "../endpoints";
|
| 4 |
import type { MessageFile } from "$lib/types/Message";
|
src/lib/server/endpoints/cohere/endpointCohere.ts
CHANGED
|
@@ -74,7 +74,7 @@ export async function endpointCohere(
|
|
| 74 |
const formattedMessages = messages
|
| 75 |
.filter((message) => message.from !== "system")
|
| 76 |
.map((message) => ({
|
| 77 |
-
role:
|
| 78 |
message: message.content,
|
| 79 |
})) satisfies Cohere.ChatMessage[];
|
| 80 |
|
|
|
|
| 74 |
const formattedMessages = messages
|
| 75 |
.filter((message) => message.from !== "system")
|
| 76 |
.map((message) => ({
|
| 77 |
+
role: message.from === "user" ? "USER" : "CHATBOT",
|
| 78 |
message: message.content,
|
| 79 |
})) satisfies Cohere.ChatMessage[];
|
| 80 |
|
src/routes/+layout.svelte
CHANGED
|
@@ -197,7 +197,7 @@
|
|
| 197 |
<div
|
| 198 |
class="grid h-full w-screen grid-cols-1 grid-rows-[auto,1fr] overflow-hidden text-smd {!isNavCollapsed
|
| 199 |
? 'md:grid-cols-[280px,1fr]'
|
| 200 |
-
: 'md:grid-cols-[0px,1fr]'} transition-[300ms] [transition-property:grid-template-columns]
|
| 201 |
>
|
| 202 |
<MobileNav isOpen={isNavOpen} on:toggle={(ev) => (isNavOpen = ev.detail)} title={mobileNavTitle}>
|
| 203 |
<NavMenu
|
|
|
|
| 197 |
<div
|
| 198 |
class="grid h-full w-screen grid-cols-1 grid-rows-[auto,1fr] overflow-hidden text-smd {!isNavCollapsed
|
| 199 |
? 'md:grid-cols-[280px,1fr]'
|
| 200 |
+
: 'md:grid-cols-[0px,1fr]'} transition-[300ms] [transition-property:grid-template-columns] md:grid-rows-[1fr] dark:text-gray-300"
|
| 201 |
>
|
| 202 |
<MobileNav isOpen={isNavOpen} on:toggle={(ev) => (isNavOpen = ev.detail)} title={mobileNavTitle}>
|
| 203 |
<NavMenu
|
src/routes/assistants/+page.svelte
CHANGED
|
@@ -195,7 +195,7 @@
|
|
| 195 |
{/if}
|
| 196 |
{/if}
|
| 197 |
<div
|
| 198 |
-
class="relative ml-auto flex h-[30px] w-40 items-center rounded-full border px-2 has-[:focus]:border-gray-400 dark:border-gray-600
|
| 199 |
>
|
| 200 |
<CarbonSearch class="pointer-events-none absolute left-2 text-xs text-gray-400" />
|
| 201 |
<input
|
|
@@ -227,7 +227,7 @@
|
|
| 227 |
!!assistant?.dynamicPrompt}
|
| 228 |
|
| 229 |
<button
|
| 230 |
-
class="relative flex flex-col items-center justify-center overflow-hidden text-balance rounded-xl border bg-gray-50/50 px-4 py-6 text-center shadow hover:bg-gray-50 hover:shadow-inner dark:border-gray-800/70 dark:bg-gray-950/20 dark:hover:bg-gray-950/40
|
| 231 |
on:click={() => {
|
| 232 |
if (data.settings.assistants.includes(assistant._id.toString())) {
|
| 233 |
settings.instantSet({ activeModel: assistant._id.toString() });
|
|
@@ -263,7 +263,7 @@
|
|
| 263 |
/>
|
| 264 |
{:else}
|
| 265 |
<div
|
| 266 |
-
class="mb-2 flex aspect-square size-12 flex-none items-center justify-center rounded-full bg-gray-300 text-2xl font-bold uppercase text-gray-500
|
| 267 |
>
|
| 268 |
{assistant.name[0]}
|
| 269 |
</div>
|
|
@@ -273,7 +273,7 @@
|
|
| 273 |
>
|
| 274 |
{assistant.name}
|
| 275 |
</h3>
|
| 276 |
-
<p class="line-clamp-4 text-xs text-gray-700 dark:text-gray-400
|
| 277 |
{assistant.description}
|
| 278 |
</p>
|
| 279 |
{#if assistant.createdByName}
|
|
|
|
| 195 |
{/if}
|
| 196 |
{/if}
|
| 197 |
<div
|
| 198 |
+
class="relative ml-auto flex h-[30px] w-40 items-center rounded-full border px-2 has-[:focus]:border-gray-400 sm:w-64 dark:border-gray-600"
|
| 199 |
>
|
| 200 |
<CarbonSearch class="pointer-events-none absolute left-2 text-xs text-gray-400" />
|
| 201 |
<input
|
|
|
|
| 227 |
!!assistant?.dynamicPrompt}
|
| 228 |
|
| 229 |
<button
|
| 230 |
+
class="relative flex flex-col items-center justify-center overflow-hidden text-balance rounded-xl border bg-gray-50/50 px-4 py-6 text-center shadow hover:bg-gray-50 hover:shadow-inner max-sm:px-4 sm:h-64 sm:pb-4 xl:pt-8 dark:border-gray-800/70 dark:bg-gray-950/20 dark:hover:bg-gray-950/40"
|
| 231 |
on:click={() => {
|
| 232 |
if (data.settings.assistants.includes(assistant._id.toString())) {
|
| 233 |
settings.instantSet({ activeModel: assistant._id.toString() });
|
|
|
|
| 263 |
/>
|
| 264 |
{:else}
|
| 265 |
<div
|
| 266 |
+
class="mb-2 flex aspect-square size-12 flex-none items-center justify-center rounded-full bg-gray-300 text-2xl font-bold uppercase text-gray-500 sm:mb-6 sm:size-20 dark:bg-gray-800"
|
| 267 |
>
|
| 268 |
{assistant.name[0]}
|
| 269 |
</div>
|
|
|
|
| 273 |
>
|
| 274 |
{assistant.name}
|
| 275 |
</h3>
|
| 276 |
+
<p class="line-clamp-4 text-xs text-gray-700 sm:line-clamp-2 dark:text-gray-400">
|
| 277 |
{assistant.description}
|
| 278 |
</p>
|
| 279 |
{#if assistant.createdByName}
|
src/routes/settings/(nav)/+page.svelte
CHANGED
|
@@ -88,7 +88,7 @@
|
|
| 88 |
</p>
|
| 89 |
<button
|
| 90 |
type="submit"
|
| 91 |
-
class="mt-2 rounded-full bg-red-700 px-5 py-2 text-lg font-semibold text-gray-100 ring-gray-400 ring-offset-1 transition-all
|
| 92 |
>
|
| 93 |
Confirm deletion
|
| 94 |
</button>
|
|
|
|
| 88 |
</p>
|
| 89 |
<button
|
| 90 |
type="submit"
|
| 91 |
+
class="mt-2 rounded-full bg-red-700 px-5 py-2 text-lg font-semibold text-gray-100 ring-gray-400 ring-offset-1 transition-all focus-visible:outline-none focus-visible:ring hover:ring"
|
| 92 |
>
|
| 93 |
Confirm deletion
|
| 94 |
</button>
|
svelte.config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import adapter from "@sveltejs/adapter-node";
|
| 2 |
-
import { vitePreprocess } from "@sveltejs/vite
|
| 3 |
import dotenv from "dotenv";
|
| 4 |
|
| 5 |
dotenv.config({ path: "./.env.local" });
|
|
|
|
| 1 |
import adapter from "@sveltejs/adapter-node";
|
| 2 |
+
import { vitePreprocess } from "@sveltejs/kit/vite";
|
| 3 |
import dotenv from "dotenv";
|
| 4 |
|
| 5 |
dotenv.config({ path: "./.env.local" });
|