From b9a90ca48fedf1f72e42612219ec900e0d5db4b0 Mon Sep 17 00:00:00 2001 From: happybell80 Date: Sun, 31 Aug 2025 15:04:31 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20rb8001=20PostgreSQL=20=ED=86=B5?= =?UTF-8?q?=ED=95=A9=20=EA=B3=84=ED=9A=8D=20-=20=ED=99=95=EC=9D=B8?= =?UTF-8?q?=EB=90=9C=20=EC=A0=95=EB=B3=B4=EB=A1=9C=20=EC=99=84=EC=A0=84=20?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 테이블 컬럼명 정정: message, response, timestamp - DB 파일 경로: /home/happybell80/ivada_project/rb8001/app/state/database.py - LLM: Gemini 2.5 Flash Lite 확인 - 핵심 문제: gemini_handler.py가 context 딕셔너리 무시 --- ...250831_rb8001_postgresql_context_integration.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plans/250831_rb8001_postgresql_context_integration.md b/plans/250831_rb8001_postgresql_context_integration.md index 27c5fbb..b282fa3 100644 --- a/plans/250831_rb8001_postgresql_context_integration.md +++ b/plans/250831_rb8001_postgresql_context_integration.md @@ -27,14 +27,14 @@ ## 3. 구현 계획 ### 3.1 PostgreSQL 조회 함수 추가 (신규 구현) -- 파일: `rb8001/app/state/database.py` +- 파일: `/home/happybell80/ivada_project/rb8001/app/state/database.py` - 함수명: `get_recent_conversations(user_id, limit=10)` -- 쿼리: `SELECT user_message, assistant_response FROM conversation_logs` +- 쿼리: `SELECT message, response, timestamp FROM conversation_logs WHERE user_id = %s ORDER BY timestamp DESC` -### 3.2 route_message 수정 (라인 115-119) -- 기존: `context = {"user_id", "channel", "robeing_id"}` -- 추가: `"recent_conversations": await db.get_recent_conversations(user_id)` -- LLM handler: Dict[str, Any] 타입 받음 (라인 270-276) +### 3.2 중요: gemini_handler.py 수정 필요 +- **문제**: router.py에서 전달한 context 딕셔너리는 무시됨 (gemini_handler.py:87) +- **해결**: gemini_handler.py에서 context['recent_conversations'] 사용하도록 수정 +- **프롬프트**: `{system}{memory}{recent_chats}\n\n사용자: {message}` ## 4. 주의사항 @@ -46,4 +46,4 @@ - ChromaDB telemetry 오류 발생 중 → `ANONYMIZED_TELEMETRY=false` 설정 필요 - user_id UUID 타입 처리 필요 (Frontend=UUID, Slack=변환) -- 현재 LLM은 "internal" 사용 (외부 서비스 아님) \ No newline at end of file +- LLM: Gemini 2.5 Flash Lite (DEFAULT_LLM_MODEL=gemini-2.5-flash-lite) \ No newline at end of file