llama-cpp-K2-FAST2 / tools /ui /src /lib /contexts /chat-form-actions.context.ts
VladHong's picture
llama.cpp k2-fast2: MBZUAI model/K2Horizon + FAST2 sliding-window override
c59fd93 verified
Raw History Blame Contribute Delete
684 Bytes
import { CONTEXT_KEY_CHAT_FORM_ACTIONS } from '$lib/constants';
import type { ChatFormActionsContext } from '$lib/types';
import { getContext, setContext } from 'svelte';
const CHAT_FORM_ACTIONS_KEY = Symbol.for(CONTEXT_KEY_CHAT_FORM_ACTIONS);
/**
* Sets the chat form actions context. Call in the parent component (ChatFormActions.svelte).
*/
export function setChatFormActionsContext(ctx: ChatFormActionsContext): ChatFormActionsContext {
return setContext(CHAT_FORM_ACTIONS_KEY, ctx);
}
/**
* Gets the chat form actions context. Call in child components.
*/
export function getChatFormActionsContext(): ChatFormActionsContext {
return getContext(CHAT_FORM_ACTIONS_KEY);
}