HF / console /src /utils /sessionRoute.ts
mysticaldragon's picture
Deploy QwenPaw - Personal AI Assistant Platform
4e7644b
Raw History Blame Contribute Delete
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;
}