Download tools/ui/src/lib/contexts/chat-message-edit.context.ts from Parakon/parakon-runtime: direct link, hf CLI and curl.
- Browser
- Download file 680 Bytes
-
https://huggingface.co/Parakon/parakon-runtime/resolve/main/tools/ui/src/lib/contexts/chat-message-edit.context.ts
- Command line
-
hf download hf://Parakon/parakon-runtime/tools/ui/src/lib/contexts/chat-message-edit.context.ts
-
curl -L -o chat-message-edit.context.ts https://huggingface.co/Parakon/parakon-runtime/resolve/main/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); | |
| } | |