feat: 템플릿(6종) + 강도 조절(3단계) + 커스텀 프롬프트

회의록 외 다양한 용도로 쓸 수 있도록 출력 구조와 요약 깊이를 분리.

템플릿:
- 🗂️ 회의록 (표준, 라이브 O)
- 🎓 강의·세미나 노트 (상세, 라이브 O)
- 🤝 1:1 미팅 (표준, 라이브 O)
- 💡 브레인스토밍 (상세, 라이브 O)
- 🎤 인터뷰 (표준, 라이브 X — Q&A 포맷)
- 📝 원문 정리 (상세 고정, 라이브 X — 요약 없이 문단화만)
- ⚙️ 커스텀 (자유 프롬프트)

강도: 간결 / 표준 / 상세 — 템플릿별 기본값 프리셋, 언제든 override.

변경:
- src/lib/templates.ts 신규 — 프리셋 + 프롬프트 빌더
- minutes-generator / live-summary 가 buildPrompt 공유
- /api/summarize{-live} 가 template/depth/customPrompt 파라미터 수용
- page.tsx UI: 템플릿 픽커, 강도 라디오, 커스텀 textarea
- LiveRecorder 가 설정을 useLiveSummary 로 전달 (ref 기반 최신값)
- 단순 변환 모드는 기존 동작 유지 (템플릿 미적용)
- 프롬프트 빌더 단위 테스트 19개 (총 57 tests)
This commit is contained in:
2026-04-21 19:38:24 +09:00
parent 6e104cbca1
commit 0101e4b0d2
9 changed files with 675 additions and 64 deletions
+10
View File
@@ -4,15 +4,22 @@ import { useEffect, useRef } from 'react'
import { useSpeechRecognition } from '@/hooks/useSpeechRecognition'
import { useLiveSummary } from '@/hooks/useLiveSummary'
import { formatTranscriptChunks } from '@/lib/transcript-formatter'
import type { SummaryDepth, TemplateId } from '@/lib/templates'
interface LiveRecorderProps {
onTranscriptReady: (transcript: string) => void
liveSummaryEnabled: boolean
template: TemplateId
depth: SummaryDepth
customPrompt?: string
}
export function LiveRecorder({
onTranscriptReady,
liveSummaryEnabled,
template,
depth,
customPrompt,
}: LiveRecorderProps) {
const {
isListening,
@@ -36,6 +43,9 @@ export function LiveRecorder({
cooldownUntil,
} = useLiveSummary(chunks, {
enabled: liveSummaryEnabled && isListening,
template,
depth,
customPrompt,
})
const transcriptEndRef = useRef<HTMLDivElement>(null)