Download src/components/dashboard/studioGenerationQueue.ts from asnannp/DocDoeAI: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/components/dashboard/studioGenerationQueue.ts
- Command line
-
hf download hf://spaces/asnannp/DocDoeAI/src/components/dashboard/studioGenerationQueue.ts
-
curl -L -o studioGenerationQueue.ts https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/components/dashboard/studioGenerationQueue.ts
1.27 kB
| import type { StudioToolId } from "@/components/dashboard/studioTools"; | |
| export type StudioGenerationRequestSummary = { | |
| key: string; | |
| toolId: StudioToolId; | |
| toolLabel: string; | |
| sourceIds: string[]; | |
| sourceTitle: string; | |
| prompt: string; | |
| isExpensive: boolean; | |
| autoRetryCount: number; | |
| }; | |
| const STUDIO_GENERATION_TOOL_ID_LIST: StudioToolId[] = [ | |
| "smart-notes", | |
| "ai-quiz", | |
| "flashcards", | |
| "exam-answer", | |
| "answer-correction", | |
| "study-plan", | |
| "last-night-prep", | |
| "study-videos", | |
| "what-to-study", | |
| "exam-war-mode", | |
| "pyq-intelligence", | |
| ]; | |
| export const STUDIO_GENERATION_TOOL_IDS = new Set<StudioToolId>(STUDIO_GENERATION_TOOL_ID_LIST); | |
| export function isStudioGenerationTool(toolId: StudioToolId) { | |
| return STUDIO_GENERATION_TOOL_IDS.has(toolId); | |
| } | |
| export function isExpensiveStudioTool(toolId: StudioToolId) { | |
| return toolId === "study-videos"; | |
| } | |
| export function normalizeStudioPrompt(prompt: string) { | |
| return prompt.trim().replace(/\s+/g, " "); | |
| } | |
| export function buildStudioRequestKey({ | |
| toolId, | |
| sourceIds, | |
| prompt, | |
| }: { | |
| toolId: StudioToolId; | |
| sourceIds: string[]; | |
| prompt: string; | |
| }) { | |
| return JSON.stringify({ | |
| toolId, | |
| sourceIds: [...sourceIds].sort(), | |
| prompt: normalizeStudioPrompt(prompt).toLowerCase(), | |
| }); | |
| } | |