Spaces:
Running
Running
fix: upload of files on multimodal assistant on first message (#1513)
Browse filesthere was a bug that prevented users from uploading images to assistants before starting a conversation
src/lib/components/chat/ChatIntroduction.svelte
CHANGED
@@ -6,17 +6,10 @@
|
|
6 |
import AnnouncementBanner from "../AnnouncementBanner.svelte";
|
7 |
import type { Model } from "$lib/types/Model";
|
8 |
import ModelCardMetadata from "../ModelCardMetadata.svelte";
|
9 |
-
import { findCurrentModel } from "$lib/utils/models";
|
10 |
import { base } from "$app/paths";
|
11 |
-
import { useSettingsStore } from "$lib/stores/settings";
|
12 |
import JSON5 from "json5";
|
13 |
|
14 |
export let currentModel: Model;
|
15 |
-
export let models: Model[];
|
16 |
-
|
17 |
-
const settings = useSettingsStore();
|
18 |
-
|
19 |
-
$: currentModelMetadata = findCurrentModel(models, $settings.activeModel);
|
20 |
|
21 |
const announcementBanners = envPublic.PUBLIC_ANNOUNCEMENT_BANNERS
|
22 |
? JSON5.parse(envPublic.PUBLIC_ANNOUNCEMENT_BANNERS)
|
@@ -79,11 +72,11 @@
|
|
79 |
<ModelCardMetadata variant="dark" model={currentModel} />
|
80 |
</div>
|
81 |
</div>
|
82 |
-
{#if
|
83 |
<div class="lg:col-span-3 lg:mt-6">
|
84 |
<p class="mb-3 text-gray-600 dark:text-gray-300">Examples</p>
|
85 |
<div class="grid gap-3 lg:grid-cols-3 lg:gap-5">
|
86 |
-
{#each
|
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 max-xl:text-sm xl:p-3.5"
|
|
|
6 |
import AnnouncementBanner from "../AnnouncementBanner.svelte";
|
7 |
import type { Model } from "$lib/types/Model";
|
8 |
import ModelCardMetadata from "../ModelCardMetadata.svelte";
|
|
|
9 |
import { base } from "$app/paths";
|
|
|
10 |
import JSON5 from "json5";
|
11 |
|
12 |
export let currentModel: Model;
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
const announcementBanners = envPublic.PUBLIC_ANNOUNCEMENT_BANNERS
|
15 |
? JSON5.parse(envPublic.PUBLIC_ANNOUNCEMENT_BANNERS)
|
|
|
72 |
<ModelCardMetadata variant="dark" model={currentModel} />
|
73 |
</div>
|
74 |
</div>
|
75 |
+
{#if currentModel.promptExamples}
|
76 |
<div class="lg:col-span-3 lg:mt-6">
|
77 |
<p class="mb-3 text-gray-600 dark:text-gray-300">Examples</p>
|
78 |
<div class="grid gap-3 lg:grid-cols-3 lg:gap-5">
|
79 |
+
{#each currentModel.promptExamples as example}
|
80 |
<button
|
81 |
type="button"
|
82 |
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 max-xl:text-sm xl:p-3.5"
|
src/lib/components/chat/ChatWindow.svelte
CHANGED
@@ -303,7 +303,6 @@
|
|
303 |
/>
|
304 |
{:else if !assistant}
|
305 |
<ChatIntroduction
|
306 |
-
{models}
|
307 |
{currentModel}
|
308 |
on:message={(ev) => {
|
309 |
if ($page.data.loginRequired) {
|
|
|
303 |
/>
|
304 |
{:else if !assistant}
|
305 |
<ChatIntroduction
|
|
|
306 |
{currentModel}
|
307 |
on:message={(ev) => {
|
308 |
if ($page.data.loginRequired) {
|
src/routes/+page.svelte
CHANGED
@@ -78,6 +78,13 @@
|
|
78 |
const query = $page.url.searchParams.get("q");
|
79 |
if (query) createConversation(query);
|
80 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
</script>
|
82 |
|
83 |
<svelte:head>
|
@@ -88,7 +95,7 @@
|
|
88 |
on:message={(ev) => createConversation(ev.detail)}
|
89 |
{loading}
|
90 |
assistant={data.assistant}
|
91 |
-
currentModel
|
92 |
models={data.models}
|
93 |
bind:files
|
94 |
/>
|
|
|
78 |
const query = $page.url.searchParams.get("q");
|
79 |
if (query) createConversation(query);
|
80 |
});
|
81 |
+
|
82 |
+
$: currentModel = findCurrentModel(
|
83 |
+
[...data.models, ...data.oldModels],
|
84 |
+
!$settings.assistants.includes($settings.activeModel)
|
85 |
+
? $settings.activeModel
|
86 |
+
: data.assistant?.modelId
|
87 |
+
);
|
88 |
</script>
|
89 |
|
90 |
<svelte:head>
|
|
|
95 |
on:message={(ev) => createConversation(ev.detail)}
|
96 |
{loading}
|
97 |
assistant={data.assistant}
|
98 |
+
{currentModel}
|
99 |
models={data.models}
|
100 |
bind:files
|
101 |
/>
|