char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aleksander Grygierui: Linting & Formatting scripts (#26819)92d1bb0c9

char/aliceai-t5-moe
1.1 KiB51 linesraw
1<script lang="ts">
2	import {
3		useChatFormPickers,
4		type UseChatFormPickersReturn
5	} from '$lib/hooks/use-chat-form-pickers.svelte';
6
7	let value = $state('');
8	let caretOffset = $state(0);
9	const calls: string[] = [];
10
11	const pickers = useChatFormPickers({
12		focusInput: () => {},
13		getCaretOffset: () => caretOffset,
14		getCwd: () => null,
15		getPickersRef: () => undefined,
16		getServerHome: () => null,
17		getShowModelSelector: () => true,
18		getValue: () => value,
19		hasCwdTools: () => true,
20		hasPrompts: () => true,
21		openModelSelector: () => {
22			calls.push('openModelSelector');
23		},
24		setCaretOffset: (o) => {
25			caretOffset = o;
26		},
27		setValue: (v) => {
28			value = v;
29			calls.push(`setValue:${v}`);
30		}
31	});
32
33	// Simulate the user typing: update the buffer and run the input flow.
34	export function type(text: string) {
35		value = text;
36		caretOffset = text.length;
37		pickers.handleInput();
38	}
39
40	export function getValue() {
41		return value;
42	}
43
44	export function getCalls() {
45		return calls;
46	}
47
48	export function getPickers(): UseChatFormPickersReturn {
49		return pickers;
50	}
51</script>