Controls.svelte 1.61 KB
Newer Older
Timothy J. Baek's avatar
Timothy J. Baek committed
1
<script>
2
	import { createEventDispatcher, getContext } from 'svelte';
Timothy J. Baek's avatar
Timothy J. Baek committed
3
	const dispatch = createEventDispatcher();
4
5
	const i18n = getContext('i18n');

Timothy J. Baek's avatar
Timothy J. Baek committed
6
	import XMark from '$lib/components/icons/XMark.svelte';
7
	import AdvancedParams from '../Settings/Advanced/AdvancedParams.svelte';
Timothy J. Baek's avatar
Timothy J. Baek committed
8
	import Valves from '$lib/components/common/Valves.svelte';
9

Timothy J. Baek's avatar
Timothy J. Baek committed
10
11
	export let models = [];
	export let valves = {};
12
	export let params = {};
Timothy J. Baek's avatar
Timothy J. Baek committed
13
14
15
</script>

<div class=" dark:text-white">
16
17
18
19
20
21
22
23
24
25
26
	<div class=" flex justify-between dark:text-gray-100 mb-2">
		<div class=" text-lg font-medium self-center font-primary">{$i18n.t('Chat Controls')}</div>
		<button
			class="self-center"
			on:click={() => {
				dispatch('close');
			}}
		>
			<XMark className="size-4" />
		</button>
	</div>
Timothy J. Baek's avatar
Timothy J. Baek committed
27

28
	<div class=" dark:text-gray-200 text-sm font-primary">
Timothy J. Baek's avatar
Timothy J. Baek committed
29
30
31
32
33
34
35
36
37
38
39
40
		{#if models.length === 1 && models[0]?.pipe?.valves_spec}
			<div>
				<div class=" font-medium">Valves</div>

				<div>
					<Valves valvesSpec={models[0]?.pipe?.valves_spec} bind:valves />
				</div>
			</div>

			<hr class="my-2 border-gray-100 dark:border-gray-800" />
		{/if}

Timothy J. Baek's avatar
Timothy J. Baek committed
41
		<div>
42
43
44
45
46
			<div class="mb-1.5 font-medium">System Prompt</div>

			<div>
				<textarea
					bind:value={params.system}
Timothy J. Baek's avatar
Timothy J. Baek committed
47
					class="w-full rounded-lg px-4 py-3 text-sm dark:text-gray-300 dark:bg-gray-850 border border-gray-100 dark:border-gray-800 outline-none resize-none"
48
49
50
51
					rows="3"
					placeholder="Enter system prompt"
				/>
			</div>
Timothy J. Baek's avatar
Timothy J. Baek committed
52
53
		</div>

Timothy J. Baek's avatar
Timothy J. Baek committed
54
		<hr class="my-2 border-gray-100 dark:border-gray-800" />
55
56
57
58
59
60
61
62
63

		<div>
			<div class="mb-1.5 font-medium">Advanced Params</div>

			<div>
				<AdvancedParams bind:params />
			</div>
		</div>
	</div>
Timothy J. Baek's avatar
Timothy J. Baek committed
64
</div>