This commit is contained in:
Timothy Jaeryang Baek 2024-11-12 21:04:07 -08:00
parent 81f497c6e3
commit faf3e81bf0

View File

@ -14,6 +14,9 @@
import ActionsSelector from '$lib/components/workspace/Models/ActionsSelector.svelte';
import Capabilities from '$lib/components/workspace/Models/Capabilities.svelte';
import Textarea from '$lib/components/common/Textarea.svelte';
import { getTools } from '$lib/apis/tools';
import { getFunctions } from '$lib/apis/functions';
import { getKnowledgeItems } from '$lib/apis/knowledge';
const i18n = getContext('i18n');
@ -30,6 +33,8 @@
let showAdvanced = false;
let showPreview = false;
let loaded = false;
// ///////////
// model
// ///////////
@ -138,6 +143,10 @@
};
onMount(async () => {
await tools.set(await getTools(localStorage.token));
await functions.set(await getFunctions(localStorage.token));
await knowledgeCollections.set(await getKnowledgeItems(localStorage.token));
// Scroll to top 'workspace-container' element
const workspaceContainer = document.getElementById('workspace-container');
if (workspaceContainer) {
@ -215,10 +224,13 @@
console.log(model);
}
loaded = true;
});
</script>
<div class="w-full max-h-full flex justify-center">
{#if loaded}
<div class="w-full max-h-full flex justify-center">
<input
bind:this={filesInputElement}
bind:files={inputFiles}
@ -385,7 +397,8 @@
}}
required
>
<option value={null} class=" text-gray-900">{$i18n.t('Select a base model')}</option
<option value={null} class=" text-gray-900"
>{$i18n.t('Select a base model')}</option
>
{#each $models.filter((m) => (model ? m.id !== model.id : true) && !m?.preset && m?.owned_by !== 'arena') as model}
<option value={model.id} class=" text-gray-900">{model.name}</option>
@ -487,7 +500,9 @@
<div class="my-2">
<div class="flex w-full justify-between items-center">
<div class="flex w-full justify-between items-center">
<div class=" self-center text-sm font-semibold">{$i18n.t('Prompt suggestions')}</div>
<div class=" self-center text-sm font-semibold">
{$i18n.t('Prompt suggestions')}
</div>
<button
class="p-1 text-xs flex rounded transition"
@ -709,4 +724,5 @@
</div>
</form>
{/if}
</div>
</div>
{/if}