diff --git a/troubleshooting/250916_rb8001_skill-rag-file_연동_구조.md b/troubleshooting/250916_rb8001_skill-rag-file_연동_구조.md index 8439a9c..850f6c1 100644 --- a/troubleshooting/250916_rb8001_skill-rag-file_연동_구조.md +++ b/troubleshooting/250916_rb8001_skill-rag-file_연동_구조.md @@ -15,15 +15,15 @@ - Company-X Team (T09C98KB933) - **Slack 스코프**: files:read 포함 (설치 URL에서 확인) -### 미구현 상태 -- **rb8001**: 파일 수신은 하지만 처리 로직 없음 - - slack_handler.py:244에서 `files = event.get("files", [])` 추출만 - - context에 파일 정보 포함 후 전달만 함 - - skill-rag-file 호출 코드 없음 +### 구현 완료 (2025-09-16) +- **rb8001**: 파일 처리 로직 추가됨 + - slack_handler.py:286-288: 파일 있으면 process_slack_files_async() 호출 + - slack_handler.py:50-97: Slack API로 파일 다운로드 후 skill-rag-file 전송 + - 임시 team_id 사용 중 (TODO: Slack team_id → DB UUID 매핑) ### skill-rag-file 구현 상태 (51124) - **구현 완료**: app/main.py, api/{upload.py,search.py}, services/* (텍스트 추출/청킹/임베딩/ChromaDB) -- **DB 모델**: app/models/database.py (team_document 테이블 정의) +- **DB 모델**: 실제 테이블과 동기화 완료 (file_size, mime_type, chunk_count, processing_status 추가) - **기본 경로**: DOCUMENT_BASE_PATH=/mnt/51123data/documents (app/core/config.py) ## 2. 실제 메시지 플로우 (확인됨) @@ -49,18 +49,13 @@ brain_service/llm_service (파일 처리 없이 텍스트만 처리) ## 3. rb8001 파일 처리 현황 (51124) -### 현재 코드 위치 및 상태 +### 구현 완료 코드 - **파일 추출**: rb8001/app/router/slack_handler.py:244 - ```python - files = event.get("files", []) # 파일 추출만 함 - ``` -- **context 전달**: 265행에서 context에 files 포함 -- **처리 로직**: 없음 (파일 다운로드, skill-rag-file 호출 코드 없음) - -### 수정 필요 위치 -- **rb8001/app/router/slack_handler.py**: 244행 이후 파일 처리 추가 -- skill-rag-file:8508 호출 구현 필요 -- bot_token 활용한 Slack 파일 다운로드 필요 +- **파일 처리 호출**: 286-288행에서 process_slack_files_async() 비동기 호출 +- **파일 다운로드 및 전송**: 50-97행 process_slack_files_async() 함수 + - Slack API로 파일 다운로드 (bot_token 사용) + - skill-rag-file:8508/api/upload로 전송 + - 임시 team UUID 사용 중 ## 4. skill-rag-file 현황 (51124) @@ -94,22 +89,22 @@ created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP ``` -**skill-rag-file 코드 모델** (app/models/database.py): +**skill-rag-file 코드 모델** (app/models/database.py - 수정 완료): ```python -# file_size, mime_type, chunk_count, processing_status 컬럼 없음 -# 파일 크기/타입은 metadata JSONB에 저장 -id, team_id, filename, file_hash, storage_path, -text_content, metadata, created_at, updated_at +# 실제 테이블과 동기화됨 +id, team_id, filename, file_hash, file_size, mime_type, +storage_path, text_content, chunk_count, processing_status, +metadata, created_at, updated_at ``` ## 6. 확인 완료 사항 -- ✅ team_document 테이블 생성됨 (단, 코드 모델과 스키마 차이 있음) +- ✅ team_document 테이블 생성됨 (코드 모델 동기화 완료) - ✅ /mnt/hdd/data/documents/ 디렉터리 생성됨 - - 코드 기본값: /mnt/51123data/documents (skill-rag-file/app/core/config.py) - ✅ Slack bot_token 2개 팀 보유 (Robeing, Company-X Team) -- ✅ files:read 스코프 포함 (설치 URL에서 확인) +- ✅ files:read 스코프 포함 - ✅ rb8001 → skill-rag-file:8508 네트워크 연결 가능 +- ✅ rb8001 파일 처리 로직 구현됨 +- ✅ skill-rag-file DB 모델 동기화 완료 -## 7. 로컬 개발자 작업 필요 -- rb8001/app/router/slack_handler.py:244 이후 skill-rag-file 호출 추가 -- skill-rag-file DB 모델과 실제 테이블 스키마 동기화 필요 \ No newline at end of file +## 7. 남은 작업 +- Slack team_id → DB team UUID 매핑 (현재 임시 UUID 사용) \ No newline at end of file