Spaces:
Sleeping
Sleeping
improve UI
Browse files
src/lib/components/chat/markdown/Code.svelte
CHANGED
|
@@ -128,7 +128,7 @@
|
|
| 128 |
</Button>
|
| 129 |
<iframe
|
| 130 |
srcDoc={text}
|
| 131 |
-
class="h-[
|
| 132 |
title="Preview"
|
| 133 |
sandbox="allow-scripts allow-popups"
|
| 134 |
referrerpolicy="no-referrer"
|
|
|
|
| 128 |
</Button>
|
| 129 |
<iframe
|
| 130 |
srcDoc={text}
|
| 131 |
+
class="h-[90dvh] w-full"
|
| 132 |
title="Preview"
|
| 133 |
sandbox="allow-scripts allow-popups"
|
| 134 |
referrerpolicy="no-referrer"
|
src/lib/components/model/ComboBoxModels.svelte
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<script lang="ts">
|
| 2 |
-
import { Plus, Info, ChevronLeft
|
| 3 |
|
| 4 |
import * as Command from '$lib/components/ui/command/';
|
| 5 |
import { Button } from '$lib/components/ui/button/';
|
|
@@ -7,6 +7,7 @@
|
|
| 7 |
import { MAX_TRENDING_MODELS } from '$lib';
|
| 8 |
import Spinner from '../loading/Spinner.svelte';
|
| 9 |
import { mode } from 'mode-watcher';
|
|
|
|
| 10 |
|
| 11 |
interface Props {
|
| 12 |
onSelect?: (model: string) => void;
|
|
@@ -79,12 +80,7 @@
|
|
| 79 |
/>
|
| 80 |
<span>{model.id.split('/').pop() ?? model.id}</span>
|
| 81 |
{#if model.architecture?.input_modalities?.includes('image')}
|
| 82 |
-
<
|
| 83 |
-
class="flex h-[18px] items-center justify-center gap-1 rounded bg-gray-500/10 px-1 text-xs text-muted-foreground"
|
| 84 |
-
>
|
| 85 |
-
<Image class="size-3!" />
|
| 86 |
-
Image supported in input
|
| 87 |
-
</span>
|
| 88 |
{/if}
|
| 89 |
</Command.Item>
|
| 90 |
{/each}
|
|
@@ -105,12 +101,7 @@
|
|
| 105 |
/>
|
| 106 |
<span>{model.id.split('/').pop() ?? model.id}</span>
|
| 107 |
{#if model.architecture?.input_modalities?.includes('image')}
|
| 108 |
-
<
|
| 109 |
-
class="flex h-[18px] items-center justify-center gap-1 rounded bg-gray-500/10 px-1 text-xs text-muted-foreground"
|
| 110 |
-
>
|
| 111 |
-
<Image class="size-3!" />
|
| 112 |
-
Image supported in input
|
| 113 |
-
</span>
|
| 114 |
{/if}
|
| 115 |
</Command.Item>
|
| 116 |
{/each}
|
|
|
|
| 1 |
<script lang="ts">
|
| 2 |
+
import { Plus, Info, ChevronLeft } from '@lucide/svelte';
|
| 3 |
|
| 4 |
import * as Command from '$lib/components/ui/command/';
|
| 5 |
import { Button } from '$lib/components/ui/button/';
|
|
|
|
| 7 |
import { MAX_TRENDING_MODELS } from '$lib';
|
| 8 |
import Spinner from '../loading/Spinner.svelte';
|
| 9 |
import { mode } from 'mode-watcher';
|
| 10 |
+
import ModelImageInput from './ModelImageInput.svelte';
|
| 11 |
|
| 12 |
interface Props {
|
| 13 |
onSelect?: (model: string) => void;
|
|
|
|
| 80 |
/>
|
| 81 |
<span>{model.id.split('/').pop() ?? model.id}</span>
|
| 82 |
{#if model.architecture?.input_modalities?.includes('image')}
|
| 83 |
+
<ModelImageInput />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
{/if}
|
| 85 |
</Command.Item>
|
| 86 |
{/each}
|
|
|
|
| 101 |
/>
|
| 102 |
<span>{model.id.split('/').pop() ?? model.id}</span>
|
| 103 |
{#if model.architecture?.input_modalities?.includes('image')}
|
| 104 |
+
<ModelImageInput />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
{/if}
|
| 106 |
</Command.Item>
|
| 107 |
{/each}
|
src/lib/components/model/ListModels.svelte
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
<script lang="ts">
|
| 2 |
-
import {
|
| 3 |
|
| 4 |
import { Button } from '$lib/components/ui/button';
|
| 5 |
import SettingsModel from './SettingsModel.svelte';
|
| 6 |
import { modelsState } from '$lib/state/models.svelte';
|
| 7 |
-
import * as Tooltip from '$lib/components/ui/tooltip/index.js';
|
| 8 |
import { mode } from 'mode-watcher';
|
|
|
|
| 9 |
|
| 10 |
let {
|
| 11 |
selectedModels,
|
|
@@ -31,18 +31,7 @@
|
|
| 31 |
/>
|
| 32 |
{model.split('/').pop() ?? model}
|
| 33 |
{#if modelData?.architecture?.input_modalities?.includes('image')}
|
| 34 |
-
<
|
| 35 |
-
<Tooltip.Trigger>
|
| 36 |
-
<span
|
| 37 |
-
class="flex size-[18px] items-center justify-center rounded bg-gray-500/10 text-xs text-gray-500"
|
| 38 |
-
>
|
| 39 |
-
<Image class="size-3" />
|
| 40 |
-
</span>
|
| 41 |
-
</Tooltip.Trigger>
|
| 42 |
-
<Tooltip.Content>
|
| 43 |
-
<p>This model supports image input.</p>
|
| 44 |
-
</Tooltip.Content>
|
| 45 |
-
</Tooltip.Root>
|
| 46 |
{/if}
|
| 47 |
</div>
|
| 48 |
{:else}
|
|
@@ -59,18 +48,7 @@
|
|
| 59 |
/>
|
| 60 |
{model.split('/').pop() ?? model}
|
| 61 |
{#if modelData?.architecture?.input_modalities?.includes('image')}
|
| 62 |
-
<
|
| 63 |
-
<Tooltip.Trigger>
|
| 64 |
-
<span
|
| 65 |
-
class="flex size-[18px] items-center justify-center rounded bg-gray-500/10 text-xs text-gray-500"
|
| 66 |
-
>
|
| 67 |
-
<Image class="size-3" />
|
| 68 |
-
</span>
|
| 69 |
-
</Tooltip.Trigger>
|
| 70 |
-
<Tooltip.Content>
|
| 71 |
-
<p>This model supports image input.</p>
|
| 72 |
-
</Tooltip.Content>
|
| 73 |
-
</Tooltip.Root>
|
| 74 |
{/if}
|
| 75 |
<Button
|
| 76 |
variant="default"
|
|
|
|
| 1 |
<script lang="ts">
|
| 2 |
+
import { X } from '@lucide/svelte';
|
| 3 |
|
| 4 |
import { Button } from '$lib/components/ui/button';
|
| 5 |
import SettingsModel from './SettingsModel.svelte';
|
| 6 |
import { modelsState } from '$lib/state/models.svelte';
|
|
|
|
| 7 |
import { mode } from 'mode-watcher';
|
| 8 |
+
import ModelImageInput from './ModelImageInput.svelte';
|
| 9 |
|
| 10 |
let {
|
| 11 |
selectedModels,
|
|
|
|
| 31 |
/>
|
| 32 |
{model.split('/').pop() ?? model}
|
| 33 |
{#if modelData?.architecture?.input_modalities?.includes('image')}
|
| 34 |
+
<ModelImageInput />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
{/if}
|
| 36 |
</div>
|
| 37 |
{:else}
|
|
|
|
| 48 |
/>
|
| 49 |
{model.split('/').pop() ?? model}
|
| 50 |
{#if modelData?.architecture?.input_modalities?.includes('image')}
|
| 51 |
+
<ModelImageInput />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
{/if}
|
| 53 |
<Button
|
| 54 |
variant="default"
|
src/lib/components/model/ModelImageInput.svelte
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script lang="ts">
|
| 2 |
+
import { Image } from '@lucide/svelte';
|
| 3 |
+
|
| 4 |
+
import * as Tooltip from '$lib/components/ui/tooltip/index.js';
|
| 5 |
+
</script>
|
| 6 |
+
|
| 7 |
+
<Tooltip.Root delayDuration={0}>
|
| 8 |
+
<Tooltip.Trigger>
|
| 9 |
+
<span
|
| 10 |
+
class="flex size-[18px] items-center justify-center rounded bg-indigo-500/10 text-xs text-indigo-500 dark:bg-indigo-500/20 dark:text-indigo-400"
|
| 11 |
+
>
|
| 12 |
+
<Image class="size-3" />
|
| 13 |
+
</span>
|
| 14 |
+
</Tooltip.Trigger>
|
| 15 |
+
<Tooltip.Content>
|
| 16 |
+
<p>This model supports image input.</p>
|
| 17 |
+
</Tooltip.Content>
|
| 18 |
+
</Tooltip.Root>
|
src/lib/components/model/SettingsModel.svelte
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<script lang="ts">
|
| 2 |
import type { Snippet } from 'svelte';
|
| 3 |
-
import { ExternalLink, Frown, MessageCircle, Save, X
|
| 4 |
|
| 5 |
import type { ChatModel } from '$lib/helpers/types';
|
| 6 |
import { formatPricingPerToken, getProviderName } from '$lib/index.js';
|
|
@@ -16,6 +16,7 @@
|
|
| 16 |
import Spinner from '../loading/Spinner.svelte';
|
| 17 |
import { modelsState, saveModelSettings } from '$lib/state/models.svelte';
|
| 18 |
import * as Tooltip from '$lib/components/ui/tooltip/index.js';
|
|
|
|
| 19 |
|
| 20 |
let {
|
| 21 |
model: modelId,
|
|
@@ -146,26 +147,17 @@
|
|
| 146 |
</span>
|
| 147 |
<div class="flex items-center gap-0.5">
|
| 148 |
{#if mdl.architecture?.input_modalities?.includes('image')}
|
| 149 |
-
<
|
| 150 |
-
<Tooltip.Trigger>
|
| 151 |
-
<span
|
| 152 |
-
class="flex size-[18px] items-center justify-center rounded bg-gray-500/10 text-gray-500"
|
| 153 |
-
>
|
| 154 |
-
<Image class="size-3" />
|
| 155 |
-
</span>
|
| 156 |
-
</Tooltip.Trigger>
|
| 157 |
-
<Tooltip.Content>
|
| 158 |
-
<p class="flex items-center gap-1">This model supports image input</p>
|
| 159 |
-
</Tooltip.Content>
|
| 160 |
-
</Tooltip.Root>
|
| 161 |
{/if}
|
| 162 |
{#if selectedModels.includes(mdl.id)}
|
| 163 |
<Tooltip.Root delayDuration={0}>
|
| 164 |
<Tooltip.Trigger>
|
| 165 |
<span
|
| 166 |
-
class="flex size-[18px] items-center justify-center rounded bg-
|
| 167 |
>
|
| 168 |
-
<MessageCircle
|
|
|
|
|
|
|
| 169 |
</span>
|
| 170 |
</Tooltip.Trigger>
|
| 171 |
<Tooltip.Content>
|
|
|
|
| 1 |
<script lang="ts">
|
| 2 |
import type { Snippet } from 'svelte';
|
| 3 |
+
import { ExternalLink, Frown, MessageCircle, Save, X } from '@lucide/svelte';
|
| 4 |
|
| 5 |
import type { ChatModel } from '$lib/helpers/types';
|
| 6 |
import { formatPricingPerToken, getProviderName } from '$lib/index.js';
|
|
|
|
| 16 |
import Spinner from '../loading/Spinner.svelte';
|
| 17 |
import { modelsState, saveModelSettings } from '$lib/state/models.svelte';
|
| 18 |
import * as Tooltip from '$lib/components/ui/tooltip/index.js';
|
| 19 |
+
import ModelImageInput from './ModelImageInput.svelte';
|
| 20 |
|
| 21 |
let {
|
| 22 |
model: modelId,
|
|
|
|
| 147 |
</span>
|
| 148 |
<div class="flex items-center gap-0.5">
|
| 149 |
{#if mdl.architecture?.input_modalities?.includes('image')}
|
| 150 |
+
<ModelImageInput />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
{/if}
|
| 152 |
{#if selectedModels.includes(mdl.id)}
|
| 153 |
<Tooltip.Root delayDuration={0}>
|
| 154 |
<Tooltip.Trigger>
|
| 155 |
<span
|
| 156 |
+
class="flex size-[18px] items-center justify-center rounded bg-neutral-900/10 text-neutral-900 dark:bg-neutral-100/10 dark:text-neutral-100"
|
| 157 |
>
|
| 158 |
+
<MessageCircle
|
| 159 |
+
class="0 size-2.5 fill-neutral-900 dark:fill-neutral-100"
|
| 160 |
+
/>
|
| 161 |
</span>
|
| 162 |
</Tooltip.Trigger>
|
| 163 |
<Tooltip.Content>
|