gijl/lv-storage / llama.cpp /tools /ui /src /lib /contexts /chat-message-actions.context.ts
gijl's picture
download
raw
730 Bytes
import { CONTEXT_KEY_CHAT_MESSAGE_ACTIONS } from '$lib/constants';
import type { ChatMessageActionsContext } from '$lib/types';
import { getContext, setContext } from 'svelte';
const CHAT_MESSAGE_ACTIONS_KEY = Symbol.for(CONTEXT_KEY_CHAT_MESSAGE_ACTIONS);
/**
* Sets the per-message actions context. Call this in the parent component (ChatMessage.svelte).
*/
export function setChatMessageActionsContext(
ctx: ChatMessageActionsContext
): ChatMessageActionsContext {
return setContext(CHAT_MESSAGE_ACTIONS_KEY, ctx);
}
/**
* Gets the per-message actions context. Call this in child components.
*/
export function getChatMessageActionsContext(): ChatMessageActionsContext {
return getContext(CHAT_MESSAGE_ACTIONS_KEY);
}

Xet Storage Details

Size:
730 Bytes
·
Xet hash:
7abbf11023f8a79b1e000849646557fab92df6185c7884273c8d466affeee8ec

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.