mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-11-09 10:17:06 +00:00
* webui: support q URL parameter Fixes #16722 I’ve checked that it works with Firefox’s AI tools * webui: apply suggestions from code review Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com> * chore: update webui static build --------- Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
28 lines
635 B
Svelte
28 lines
635 B
Svelte
<script lang="ts">
|
|
import { ChatScreen } from '$lib/components/app';
|
|
import { chatStore, isInitialized } from '$lib/stores/chat.svelte';
|
|
import { onMount } from 'svelte';
|
|
import { page } from '$app/state';
|
|
|
|
let qParam = $derived(page.url.searchParams.get('q'));
|
|
|
|
onMount(async () => {
|
|
if (!isInitialized) {
|
|
await chatStore.initialize();
|
|
}
|
|
|
|
chatStore.clearActiveConversation();
|
|
|
|
if (qParam !== null) {
|
|
await chatStore.createConversation();
|
|
await chatStore.sendMessage(qParam);
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<svelte:head>
|
|
<title>llama.cpp - AI Chat Interface</title>
|
|
</svelte:head>
|
|
|
|
<ChatScreen showCenteredEmpty={true} />
|