mimamo / source /third_party /llama.cpp-1.0.0 /tools /ui /src /lib /contexts /chat-message-edit.context.ts
Download source/third_party/llama.cpp-1.0.0/tools/ui/src/lib/contexts/chat-message-edit.context.ts from Yakimask/mimamo: direct link, hf CLI and curl.
- Browser
- Download file 680 Bytes
-
https://huggingface.co/Yakimask/mimamo/resolve/main/source/third_party/llama.cpp-1.0.0/tools/ui/src/lib/contexts/chat-message-edit.context.ts
- Command line
-
hf download hf://Yakimask/mimamo/source/third_party/llama.cpp-1.0.0/tools/ui/src/lib/contexts/chat-message-edit.context.ts
-
curl -L -o chat-message-edit.context.ts https://huggingface.co/Yakimask/mimamo/resolve/main/source/third_party/llama.cpp-1.0.0/tools/ui/src/lib/contexts/chat-message-edit.context.ts
680 Bytes
| import { CONTEXT_KEY_CHAT_MESSAGE_EDIT } from '$lib/constants'; | |
| import type { ChatMessageEditContext } from '$lib/types'; | |
| import { getContext, setContext } from 'svelte'; | |
| const CHAT_MESSAGE_EDIT_KEY = Symbol.for(CONTEXT_KEY_CHAT_MESSAGE_EDIT); | |
| /** | |
| * Sets the message edit context. Call this in the parent component (ChatMessage.svelte). | |
| */ | |
| export function setChatMessageEditContext(ctx: ChatMessageEditContext): ChatMessageEditContext { | |
| return setContext(CHAT_MESSAGE_EDIT_KEY, ctx); | |
| } | |
| /** | |
| * Gets the message edit context. Call this in child components. | |
| */ | |
| export function getChatMessageEditContext(): ChatMessageEditContext { | |
| return getContext(CHAT_MESSAGE_EDIT_KEY); | |
| } | |