Spaces:
Paused
Paused
Download console/src/utils/sessionRoute.ts from mysticaldragon/HF: direct link, hf CLI and curl.
- Browser
- Download file 332 Bytes
-
https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/utils/sessionRoute.ts
- Command line
-
hf download hf://spaces/mysticaldragon/HF/console/src/utils/sessionRoute.ts
-
curl -L -o sessionRoute.ts https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/utils/sessionRoute.ts
332 Bytes
| export function getSessionIdFromPath(pathname: string): string | undefined { | |
| const match = pathname.match(/^\/chat\/(.+)$/); | |
| return match?.[1]; | |
| } | |
| export const CHAT_BASE_PATH = "/chat"; | |
| export function buildChatPath(sessionId?: string | null): string { | |
| return sessionId ? `${CHAT_BASE_PATH}/${sessionId}` : CHAT_BASE_PATH; | |
| } | |