Skip to content

Commit 5eb8f00

Browse files
authored
Use assistant avatar in conversation, if available (#776)
1 parent 9574269 commit 5eb8f00

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/lib/components/chat/ChatMessage.svelte

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
2020
import OpenWebSearchResults from "../OpenWebSearchResults.svelte";
2121
import type { WebSearchUpdate } from "$lib/types/MessageUpdate";
22+
import { base } from "$app/paths";
2223
2324
function sanitizeMd(md: string) {
2425
let ret = md
@@ -139,11 +140,19 @@
139140
on:click={() => (isTapped = !isTapped)}
140141
on:keypress={() => (isTapped = !isTapped)}
141142
>
142-
<img
143-
alt=""
144-
src="https://huggingface.co/avatars/2edb18bd0206c16b433841a47f53fa8e.svg"
145-
class="mt-5 h-3 w-3 flex-none select-none rounded-full shadow-lg"
146-
/>
143+
{#if $page.data?.assistant?.avatar}
144+
<img
145+
src="{base}/settings/assistants/{$page.data.assistant._id}/avatar.jpg"
146+
alt="Avatar"
147+
class="mt-5 h-3 w-3 flex-none select-none rounded-full shadow-lg"
148+
/>
149+
{:else}
150+
<img
151+
alt=""
152+
src="https://huggingface.co/avatars/2edb18bd0206c16b433841a47f53fa8e.svg"
153+
class="mt-5 h-3 w-3 flex-none select-none rounded-full shadow-lg"
154+
/>
155+
{/if}
147156
<div
148157
class="relative min-h-[calc(2rem+theme(spacing[3.5])*2)] min-w-[60px] break-words rounded-2xl border border-gray-100 bg-gradient-to-br from-gray-50 px-5 py-3.5 text-gray-600 prose-pre:my-2 dark:border-gray-800 dark:from-gray-800/40 dark:text-gray-300"
149158
>

0 commit comments

Comments
 (0)