char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
d86c7d62d
char/aliceai-t5-moe
1import { CONTEXT_KEY_CHAT_MESSAGE_ACTIONS } from '$lib/constants' ; 2import type { ChatMessageActionsContext } from '$lib/types' ; 3import { getContext , setContext } from 'svelte' ; 4 5const CHAT_MESSAGE_ACTIONS_KEY = Symbol . for ( CONTEXT_KEY_CHAT_MESSAGE_ACTIONS ); 6 7/** 8* Sets the per-message actions context. Call this in the parent component (ChatMessage.svelte). 9*/ 10export function setChatMessageActionsContext ( 11ctx :ChatMessageActionsContext 12) :ChatMessageActionsContext { 13return setContext ( CHAT_MESSAGE_ACTIONS_KEY , ctx ); 14} 15 16/** 17* Gets the per-message actions context. Call this in child components. 18*/ 19export function getChatMessageActionsContext () :ChatMessageActionsContext { 20return getContext ( CHAT_MESSAGE_ACTIONS_KEY ); 21}