mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-23 06:00:42 -05:00
15 lines
513 B
TypeScript
15 lines
513 B
TypeScript
import { getContext, setContext } from 'svelte';
|
|
import { chatId, models, temporaryChatEnabled, audioQueue } from '$lib/stores';
|
|
import type { ChatContext } from '$lib/types';
|
|
|
|
export const setChatContext = (context: ChatContext) => setContext('chat', context);
|
|
|
|
/** The enclosing chat's state, or the main chat's stores outside any chat. */
|
|
export const getChatContext = (): ChatContext =>
|
|
getContext<ChatContext | undefined>('chat') ?? {
|
|
chatId,
|
|
models,
|
|
temporary: temporaryChatEnabled,
|
|
audioQueue
|
|
};
|