Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,5 @@ dist
cypress/videos
cypress/screenshots
.vscode/settings.json

npm_rebuild.sh
1 change: 0 additions & 1 deletion backend/data/readme.txt

This file was deleted.

36 changes: 36 additions & 0 deletions src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

export let admin = false;

export let keepAlive: string | null = null;

export let params = {
// Advanced
stream_response: null, // Set stream responses for this model individually
Expand Down Expand Up @@ -41,6 +43,9 @@
$: if (params) {
dispatch('change', params);
}
$: {
dispatch('change', keepAlive);
}
</script>

<div class=" space-y-1 text-xs pb-safe-bottom">
Expand Down Expand Up @@ -1139,6 +1144,37 @@
{/if}
</div>

<div class=" py-1 w-full justify-between">
<div class="flex w-full justify-between">
<div class=" self-center text-xs font-medium">{$i18n.t('Keep Alive')}</div>

<button
class="p-1 px-3 text-xs flex rounded transition"
type="button"
on:click={() => {
keepAlive = keepAlive === null ? '5m' : null;
}}
>
{#if keepAlive === null}
<span class="ml-2 self-center"> {$i18n.t('Default')} </span>
{:else}
<span class="ml-2 self-center"> {$i18n.t('Custom')} </span>
{/if}
</button>
</div>

{#if keepAlive !== null}
<div class="flex mt-1 space-x-2">
<input
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
type="text"
placeholder={$i18n.t("e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.")}
bind:value={keepAlive}
/>
</div>
{/if}
</div>

<!-- <div class=" py-0.5 w-full justify-between">
<div class="flex w-full justify-between">
<div class=" self-center text-xs font-medium">{$i18n.t('Template')}</div>
Expand Down
33 changes: 1 addition & 32 deletions src/lib/components/chat/Settings/General.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -256,40 +256,9 @@
</div>

{#if showAdvanced}
<AdvancedParams admin={$user?.role === 'admin'} bind:params />
<AdvancedParams admin={$user?.role === 'admin'} bind:params bind:keepAlive />
<hr class=" dark:border-gray-850" />

<div class=" py-1 w-full justify-between">
<div class="flex w-full justify-between">
<div class=" self-center text-xs font-medium">{$i18n.t('Keep Alive')}</div>

<button
class="p-1 px-3 text-xs flex rounded transition"
type="button"
on:click={() => {
keepAlive = keepAlive === null ? '5m' : null;
}}
>
{#if keepAlive === null}
<span class="ml-2 self-center"> {$i18n.t('Default')} </span>
{:else}
<span class="ml-2 self-center"> {$i18n.t('Custom')} </span>
{/if}
</button>
</div>

{#if keepAlive !== null}
<div class="flex mt-1 space-x-2">
<input
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
type="text"
placeholder={$i18n.t("e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.")}
bind:value={keepAlive}
/>
</div>
{/if}
</div>

<div>
<div class=" py-1 flex w-full justify-between">
<div class=" self-center text-sm font-medium">{$i18n.t('Request Mode')}</div>
Expand Down