feat: add configurable generation timeout
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -63,6 +63,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
<span class="text-sm font-medium font-semibold text-primary-700"
|
||||
>Generation</span
|
||||
>
|
||||
<div class="flex flex-col md:flex-row pl-1 gap-4 justify-between">
|
||||
<div class="w-full md:w-1/3">
|
||||
<label
|
||||
for="textGenerationTimeout"
|
||||
class="text-sm font-medium text-primary-700"
|
||||
>Chat Timeout</label
|
||||
>
|
||||
<select
|
||||
id="textGenerationTimeout"
|
||||
name="textGenerationTimeout"
|
||||
x-model.number="settings.text_generation_timeout_minutes"
|
||||
class="mt-1 p-1 block w-full rounded-md border-primary-400 shadow focus:border-secondary-500 focus:ring-secondary-500 sm:text-sm text-primary-900"
|
||||
>
|
||||
<template x-for="minutes in timeoutOptions" x-bind:key="minutes">
|
||||
<option x-bind:value="minutes" x-text="`${minutes}m`"></option>
|
||||
</template>
|
||||
</select>
|
||||
<p class="mt-2 text-xs text-primary-500">
|
||||
Maximum time a chat response can stream before timing out
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
x-show="error"
|
||||
class="bg-tertiary-50 border border-tertiary-200 rounded-md p-4"
|
||||
|
||||
@@ -4,12 +4,14 @@ import { Settings } from '../types';
|
||||
|
||||
Alpine.data('settingsManager', () => ({
|
||||
settings: {} as Settings,
|
||||
timeoutOptions: [1, 5, 10, 15, 30],
|
||||
loading: false,
|
||||
saved: false,
|
||||
error: '',
|
||||
|
||||
async init() {
|
||||
this.settings = await getSettings();
|
||||
this.settings.text_generation_timeout_minutes ||= 5;
|
||||
},
|
||||
|
||||
async saveSettings() {
|
||||
|
||||
@@ -41,6 +41,7 @@ export interface Settings {
|
||||
image_edit_selector?: string;
|
||||
image_generation_selector?: string;
|
||||
text_generation_selector?: string;
|
||||
text_generation_timeout_minutes?: number;
|
||||
}
|
||||
|
||||
export interface ImageRecord {
|
||||
|
||||
Reference in New Issue
Block a user