diff --git a/app/Http/Controllers/Api/Admin/MeetingLogController.php b/app/Http/Controllers/Api/Admin/MeetingLogController.php index c8c6550c..80115369 100644 --- a/app/Http/Controllers/Api/Admin/MeetingLogController.php +++ b/app/Http/Controllers/Api/Admin/MeetingLogController.php @@ -216,22 +216,27 @@ public function summary(int $id): View|JsonResponse } /** - * 오디오 파일 업로드 및 처리 (회의록 AI 요약) + * 오디오 파일 업로드 및 처리 (회의록/업무협의록 AI 요약) */ public function uploadFile(Request $request): JsonResponse { $validated = $request->validate([ 'audio_file' => 'required|file|mimes:webm,wav,mp3,ogg,m4a,mp4|max:102400', 'title' => 'nullable|string|max:200', + 'summary_type' => 'nullable|string|in:meeting,work-memo', ]); + $summaryType = $validated['summary_type'] ?? 'meeting'; + $defaultTitle = $summaryType === 'work-memo' ? '업로드된 업무협의록' : '업로드된 회의록'; + $meeting = $this->meetingLogService->create([ - 'title' => $validated['title'] ?? '업로드된 회의록', + 'title' => $validated['title'] ?? $defaultTitle, ]); $result = $this->meetingLogService->processUploadedFile( $meeting, - $request->file('audio_file') + $request->file('audio_file'), + $summaryType ); if (! $result['ok']) { @@ -241,9 +246,11 @@ public function uploadFile(Request $request): JsonResponse ], 500); } + $message = $summaryType === 'work-memo' ? '업무협의록이 생성되었습니다.' : '회의록이 생성되었습니다.'; + return response()->json([ 'success' => true, - 'message' => '회의록이 생성되었습니다.', + 'message' => $message, 'data' => $result['meeting'], ]); } diff --git a/app/Services/MeetingLogService.php b/app/Services/MeetingLogService.php index ed41011d..85754ab0 100644 --- a/app/Services/MeetingLogService.php +++ b/app/Services/MeetingLogService.php @@ -137,8 +137,10 @@ public function processAudio(MeetingLog $meeting, string $audioBase64, int $dura /** * AI 요약 생성 (Claude API) + * + * @param string $summaryType meeting|work-memo */ - private function generateSummary(string $transcript): ?string + private function generateSummary(string $transcript, string $summaryType = 'meeting'): ?string { $apiKey = config('services.claude.api_key'); if (empty($apiKey)) { @@ -147,6 +149,10 @@ private function generateSummary(string $transcript): ?string return null; } + $prompt = $summaryType === 'work-memo' + ? $this->buildWorkMemoPrompt($transcript) + : $this->buildSummaryPrompt($transcript); + try { $response = Http::withHeaders([ 'x-api-key' => $apiKey, @@ -157,7 +163,7 @@ private function generateSummary(string $transcript): ?string 'messages' => [ [ 'role' => 'user', - 'content' => $this->buildSummaryPrompt($transcript), + 'content' => $prompt, ], ], ]); @@ -179,7 +185,7 @@ private function generateSummary(string $transcript): ?string } /** - * 요약 프롬프트 생성 + * 요약 프롬프트 생성 (일반 회의록) */ private function buildSummaryPrompt(string $transcript): string { @@ -200,6 +206,31 @@ private function buildSummaryPrompt(string $transcript): string PROMPT; } + /** + * 업무협의록 프롬프트 생성 (고객사 미팅용) + */ + private function buildWorkMemoPrompt(string $transcript): string + { + return <<update(['status' => MeetingLog::STATUS_PROCESSING]); @@ -298,8 +331,8 @@ public function processUploadedFile(MeetingLog $meeting, \Illuminate\Http\Upload $meeting->update(['transcript_text' => $transcript]); - // 3. AI 요약 생성 - $summary = $this->generateSummary($transcript); + // 3. AI 요약 생성 (summaryType에 따라 프롬프트 선택) + $summary = $this->generateSummary($transcript, $summaryType); $meeting->update([ 'summary_text' => $summary, diff --git a/resources/views/lab/ai/work-memo-summary.blade.php b/resources/views/lab/ai/work-memo-summary.blade.php index 0e735aeb..14bfca3b 100644 --- a/resources/views/lab/ai/work-memo-summary.blade.php +++ b/resources/views/lab/ai/work-memo-summary.blade.php @@ -4,59 +4,452 @@ @push('styles') @endpush @section('content') -
-
-
- - - -

업무협의록 AI 요약

-

- 고객사와의 미팅 녹음을 업로드하면 AI가 자동으로 - 업무 협의 내용을 정리하고 후속 조치를 추출합니다. -

-
AI/Automation
-
+
+ {{-- 헤더 --}} +
+

업무협의록 AI 요약

+

고객사 미팅 녹음을 업로드하면 AI가 업무 협의 내용을 정리합니다

+
-
-
-

- - - - - 예정 기능 -

-
-
-

협의록 생성

-
    -
  • • 고객 요구사항 추출
  • -
  • • 합의사항 정리
  • -
  • • 일정/담당자 매핑
  • -
-
-
-

후속 관리

-
    -
  • • To-Do 자동 생성
  • -
  • • 일정 캘린더 연동
  • -
  • • 이메일 발송
  • -
-
+ {{-- 안내 박스 --}} +
+
+ + + +
+

업무협의록 전용 AI 요약

+

고객 요구사항, 합의 사항, 후속 조치(To-Do) 등 업무 협의에 특화된 구조로 정리됩니다.

+
+
+
+ + {{-- 업로드 섹션 --}} +
+
+ @csrf + + + {{-- 제목 입력 --}} +
+ + +
+ + {{-- 파일 드롭존 --}} +
+ + + +

파일을 드래그하거나 클릭하여 업로드

+

지원 형식: WebM, WAV, MP3, OGG, M4A, MP4 (최대 100MB)

+ +
+ + {{-- 선택된 파일 정보 --}} + + + {{-- 업로드 버튼 --}} + +
+
+ + {{-- 처리 중 상태 --}} + + + {{-- 결과 섹션 --}} + + + {{-- 최근 협의록 목록 --}} +
+

+ + + + 최근 협의록 +

+ +
+
+
@endsection + +@push('scripts') + + +{{-- Markdown 파서 --}} + +@endpush