Files
llama.cpp/tools/server/webui/src/routes/+page.svelte
Florian Badie 69e9ff0103 webui: support q URL parameter (#16728)
* 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>
2025-10-24 14:10:29 +02:00

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} />