Skip to content

Commit

Permalink
Use assistant avatar in conversation, if available (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin authored Feb 5, 2024
1 parent 9574269 commit 5eb8f00
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/lib/components/chat/ChatMessage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import OpenWebSearchResults from "../OpenWebSearchResults.svelte";
import type { WebSearchUpdate } from "$lib/types/MessageUpdate";
import { base } from "$app/paths";
function sanitizeMd(md: string) {
let ret = md
Expand Down Expand Up @@ -139,11 +140,19 @@
on:click={() => (isTapped = !isTapped)}
on:keypress={() => (isTapped = !isTapped)}
>
<img
alt=""
src="https://huggingface.co/avatars/2edb18bd0206c16b433841a47f53fa8e.svg"
class="mt-5 h-3 w-3 flex-none select-none rounded-full shadow-lg"
/>
{#if $page.data?.assistant?.avatar}
<img
src="{base}/settings/assistants/{$page.data.assistant._id}/avatar.jpg"
alt="Avatar"
class="mt-5 h-3 w-3 flex-none select-none rounded-full shadow-lg"
/>
{:else}
<img
alt=""
src="https://huggingface.co/avatars/2edb18bd0206c16b433841a47f53fa8e.svg"
class="mt-5 h-3 w-3 flex-none select-none rounded-full shadow-lg"
/>
{/if}
<div
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"
>
Expand Down

0 comments on commit 5eb8f00

Please sign in to comment.