This commit is contained in:
Timothy Jaeryang Baek 2024-11-12 15:46:44 -08:00
parent 3a541460df
commit ee05455155
8 changed files with 145 additions and 74 deletions

View File

@ -315,13 +315,15 @@ class Pipe:
</div>
<div class="flex-1">
<input
class="w-full text-2xl font-medium bg-transparent outline-none font-primary"
type="text"
placeholder={$i18n.t('Function Name (e.g. My Filter)')}
bind:value={name}
required
/>
<Tooltip content={$i18n.t('e.g. My Filter')} placement="top-start">
<input
class="w-full text-2xl font-medium bg-transparent outline-none font-primary"
type="text"
placeholder={$i18n.t('Function Name')}
bind:value={name}
required
/>
</Tooltip>
</div>
<div>
@ -329,31 +331,37 @@ class Pipe:
</div>
</div>
<div class=" flex gap-2 px-1">
<div class=" flex gap-2 px-1 items-center">
{#if edit}
<div class="text-sm text-gray-500 flex-shrink-0">
{id}
</div>
{:else}
<input
class="w-full text-sm disabled:text-gray-500 bg-transparent outline-none"
type="text"
placeholder={$i18n.t('Function ID (e.g. my_filter)')}
bind:value={id}
required
disabled={edit}
/>
<Tooltip className="w-full" content={$i18n.t('e.g. my_filter')} placement="top-start">
<input
class="w-full text-sm disabled:text-gray-500 bg-transparent outline-none"
type="text"
placeholder={$i18n.t('Function ID')}
bind:value={id}
required
disabled={edit}
/>
</Tooltip>
{/if}
<input
class="w-full text-sm bg-transparent outline-none"
type="text"
placeholder={$i18n.t(
'Function Description (e.g. A filter to remove profanity from text)'
)}
bind:value={meta.description}
required
/>
<Tooltip
className="w-full self-center items-center flex"
content={$i18n.t('e.g. A filter to remove profanity from text')}
placement="top-start"
>
<input
class="w-full text-sm bg-transparent outline-none"
type="text"
placeholder={$i18n.t('Function Description')}
bind:value={meta.description}
required
/>
</Tooltip>
</div>
</div>

View File

@ -203,13 +203,15 @@ class Tools:
</div>
<div class="flex-1">
<input
class="w-full text-2xl font-medium bg-transparent outline-none"
type="text"
placeholder={$i18n.t('Toolkit Name (e.g. My ToolKit)')}
bind:value={name}
required
/>
<Tooltip content={$i18n.t('e.g. My ToolKit')} placement="top-start">
<input
class="w-full text-2xl font-medium bg-transparent outline-none"
type="text"
placeholder={$i18n.t('Toolkit Name')}
bind:value={name}
required
/>
</Tooltip>
</div>
<div>
@ -217,31 +219,41 @@ class Tools:
</div>
</div>
<div class=" flex gap-2 px-1">
<div class=" flex gap-2 px-1 items-center">
{#if edit}
<div class="text-sm text-gray-500 flex-shrink-0">
{id}
</div>
{:else}
<input
class="w-full text-sm disabled:text-gray-500 bg-transparent outline-none"
type="text"
placeholder={$i18n.t('Toolkit ID (e.g. my_toolkit)')}
bind:value={id}
required
disabled={edit}
/>
<Tooltip
className="w-full"
content={$i18n.t('e.g. my_toolkit')}
placement="top-start"
>
<input
class="w-full text-sm disabled:text-gray-500 bg-transparent outline-none"
type="text"
placeholder={$i18n.t('Toolkit ID')}
bind:value={id}
required
disabled={edit}
/>
</Tooltip>
{/if}
<input
class="w-full text-sm bg-transparent outline-none"
type="text"
placeholder={$i18n.t(
'Toolkit Description (e.g. A toolkit for performing various operations)'
)}
bind:value={meta.description}
required
/>
<Tooltip
className="w-full self-center items-center flex"
content={$i18n.t('e.g. A toolkit for performing various operations')}
placement="top-start"
>
<input
class="w-full text-sm bg-transparent outline-none"
type="text"
placeholder={$i18n.t('Toolkit Description')}
bind:value={meta.description}
required
/>
</Tooltip>
</div>
</div>

View File

@ -30,24 +30,6 @@
await goto('/');
}
await Promise.all([
(async () => {
models.set(await getModels(localStorage.token));
})(),
(async () => {
knowledge.set(await getKnowledgeItems(localStorage.token));
})(),
(async () => {
prompts.set(await getPrompts(localStorage.token));
})(),
(async () => {
tools.set(await getTools(localStorage.token));
})(),
(async () => {
functions.set(await getFunctions(localStorage.token));
})()
]);
loaded = true;
});
</script>
@ -136,7 +118,7 @@
</div>
</div>
<div class=" pb-1 px-[18px] flex-1 max-h-full overflow-y-auto" id="workspace-container">
<div class=" -mt-1 pb-1 px-[18px] flex-1 max-h-full overflow-y-auto" id="workspace-container">
<slot />
</div>
</div>

View File

@ -1,5 +1,19 @@
<script>
import { onMount } from 'svelte';
import { functions } from '$lib/stores';
import { getFunctions } from '$lib/apis/functions';
import Functions from '$lib/components/workspace/Functions.svelte';
onMount(async () => {
await Promise.all([
(async () => {
functions.set(await getFunctions(localStorage.token));
})()
]);
});
</script>
<Functions />
{#if $functions !== null}
<Functions />
{/if}

View File

@ -1,5 +1,19 @@
<script>
import { onMount } from 'svelte';
import { knowledge } from '$lib/stores';
import { getKnowledgeItems } from '$lib/apis/knowledge';
import Knowledge from '$lib/components/workspace/Knowledge.svelte';
onMount(async () => {
await Promise.all([
(async () => {
knowledge.set(await getKnowledgeItems(localStorage.token));
})()
]);
});
</script>
<Knowledge />
{#if $knowledge !== null}
<Knowledge />
{/if}

View File

@ -1,5 +1,18 @@
<script>
import { onMount } from 'svelte';
import { models } from '$lib/stores';
import { getModels } from '$lib/apis';
import Models from '$lib/components/workspace/Models.svelte';
onMount(async () => {
await Promise.all([
(async () => {
models.set(await getModels(localStorage.token));
})()
]);
});
</script>
<Models />
{#if $models !== null}
<Models />
{/if}

View File

@ -1,5 +1,19 @@
<script>
import { onMount } from 'svelte';
import { prompts } from '$lib/stores';
import { getPrompts } from '$lib/apis/prompts';
import Prompts from '$lib/components/workspace/Prompts.svelte';
onMount(async () => {
await Promise.all([
(async () => {
prompts.set(await getPrompts(localStorage.token));
})()
]);
});
</script>
<Prompts />
{#if $prompts !== null}
<Prompts />
{/if}

View File

@ -1,5 +1,19 @@
<script>
import { onMount } from 'svelte';
import { tools } from '$lib/stores';
import { getTools } from '$lib/apis/tools';
import Tools from '$lib/components/workspace/Tools.svelte';
onMount(async () => {
await Promise.all([
(async () => {
tools.set(await getTools(localStorage.token));
})()
]);
});
</script>
<Tools />
{#if $tools !== null}
<Tools />
{/if}