Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/amitranjanmaurya_campus-tools-backend.json
OpenCode 68a9071cf1 feat: reconcile local master with origin (exa/hot-platform hunters, leaks ledger, latest results)
Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
2026-08-07 12:53:47 +08:00

1 line
2.7 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "amitranjanmaurya/campus-tools-backend", "files": {"src/app/api/deepseek-summary/route.ts": {"32d133efa492eaeb72e5933f73a791fcb914b394": {"t": 1786067737.3757546, "n": 2464, "h": "a6c868e6ad702b82", "c": "import { NextRequest, NextResponse } from 'next/server';\n\nexport async function POST(req: NextRequest) {\n const { input, detailLevel, language, outputType } = await req.json();\n const apiKey = process.env.DEEPSEEK_API_KEY;\n\n if (!apiKey) {\n return NextResponse.json({ error: 'API key missing' }, { status: 500 });\n }\n\n // DeepSeek API endpoint\n const endpoint = 'https://api.deepseek.com/v1/chat/completions';\n\n // Build prompt for study guide with explicit section formatting\n const prompt = `You are an expert AI tutor. Your task is to generate a complete, student-friendly, and organized study guide for the given topic or subject.\\n\\nRequirements:\\n1. Topic Overview: Start with a short introduction of the topic (3-5 lines).\\n2. Key Concepts: List all major sub-topics and explain them clearly.\\n3. Definitions: Include important definitions with examples if necessary.\\n4. Formulas / Equations (if applicable): List all important formulas and where to use them.\\n5. Flowcharts / Diagrams (text-based): Describe important processes with numbered steps or diagrams in text.\\n6. Bullet Summary: Provide a crisp bullet-point summary at the end.\\n7. Exam Tips: Share 3-5 short exam tips for remembering the topic or scoring high.\\n8. MCQs or Practice Questions: Add 5 sample multiple-choice questions (with correct answers).\\n9. Language: Keep the language simple and easy for students to understand (class 10–12 level or beginner college level).\\n\\nInput Topic: ${input}\\n\\nFormat your response using headings, bullet points, and spacing for readability.`;\n\n const body = {\n model: \"deepseek-chat\",\n messages: [\n {\n role: \"user\",\n content: prompt\n }\n ]\n };\n\n try {\n const response = await fetch(endpoint, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${apiKey}`,\n },\n body: JSON.stringify(body),\n });\n const data = await response.json();\n if (!response.ok) {\n console.error('DeepSeek API error:', data.error || data);\n return NextResponse.json({ error: data.error || 'Failed to generate summary' }, { status: 500 });\n }\n // DeepSeek returns output in choices[0].message.content\n return NextResponse.json({ result: data.choices?.[0]?.message?.content || '' });\n } catch (err) {\n console.error('API route error:', err);\n return NextResponse.json({ error: 'Server error' }, { status: 500 });\n }\n}\n"}}}}