mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-10-27 08:21:30 +00:00
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>
This commit is contained in:
Binary file not shown.
@@ -2,6 +2,9 @@
|
||||
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) {
|
||||
@@ -9,6 +12,11 @@
|
||||
}
|
||||
|
||||
chatStore.clearActiveConversation();
|
||||
|
||||
if (qParam !== null) {
|
||||
await chatStore.createConversation();
|
||||
await chatStore.sendMessage(qParam);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user