From 957b03102d121f87dff895cba5ac82fd05781988 Mon Sep 17 00:00:00 2001 From: happybell80 Date: Sun, 14 Sep 2025 14:57:12 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20IntentAnalyzer=20=ED=86=B5=ED=95=A9=20?= =?UTF-8?q?=EB=B0=A9=EC=95=88=20=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 - router.route_message() 레벨 통합 방안 추가 - DecisionEngine과 중복 기능 언급 - 영향 범위 확대 (모든 인터페이스) --- ...ybell80_IntentAnalyzer_미사용_문제.md | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/troubleshooting/250914_happybell80_IntentAnalyzer_미사용_문제.md b/troubleshooting/250914_happybell80_IntentAnalyzer_미사용_문제.md index e9c329a..41debb1 100644 --- a/troubleshooting/250914_happybell80_IntentAnalyzer_미사용_문제.md +++ b/troubleshooting/250914_happybell80_IntentAnalyzer_미사용_문제.md @@ -16,6 +16,7 @@ - "검색해줘" → "/search" 변환 기능 구현됨 - 어디서도 import/호출하지 않음 - slack_handler.py:81에서 router.route_message() 직접 호출 +- DecisionEngine(정규식 기반)만 사용 중, IntentAnalyzer(LLM 기반) 미사용 ``` ### 2. Slack 이벤트 처리 로직 @@ -31,23 +32,23 @@ if event_type == "app_mention" or (event_type == "message" and is_dm): ## 해결 방법 -### 1. IntentAnalyzer 연결 +### 1. IntentAnalyzer 연결 (두 가지 방안) + +#### 방안 A: slack_handler.py 수정 (문제: handler 객체 없음) ```python -# slack_handler.py 수정 -from app.llm.intent_analyzer import IntentAnalyzer +# slack_handler.py Line 78-81 사이 +# 문제: handler 객체 접근 불가로 구현 어려움 +``` -async def process_slack_message_async(text: str, user_id: str, context: dict): - # ... 기존 코드 ... - - # Line 78-81 사이에 추가 +#### 방안 B: router.route_message() 수정 (권장) +```python +# router.py의 route_message() 시작부 +async def route_message(self, text: str, user_id: str, ...): + # IntentAnalyzer로 전처리 analyzer = IntentAnalyzer() - analyzed = await analyzer.analyze_user_intent(text, handler) - if analyzed != text: - logger.info(f"Intent converted: '{text}' → '{analyzed}'") - text = analyzed + text = await analyzer.analyze_user_intent(text, self.llm_handler) - # 기존 router 호출 - result = await router.route_message(text, user_id, channel, thread_ts) + # 기존 처리 로직 계속... ``` ### 2. 채널 메시지 키워드 감지 @@ -72,6 +73,6 @@ response_text = response_text.replace("**", "*") # Slack 포맷 변환 3. **플랫폼별 포맷**: Slack mrkdwn ≠ Markdown ## 영향 범위 -- 모든 Slack 사용자의 검색 기능 UX 개선 -- 자연어 명령 지원으로 사용성 향상 -- 포맷 깨짐 문제 해결로 가독성 개선 \ No newline at end of file +- router 레벨 통합 시 Slack뿐 아니라 모든 인터페이스(frontend 등)에 자연어 지원 +- DecisionEngine과 IntentAnalyzer 중복 기능 정리 필요 +- 포맷 깨짐 문제 해결로 가독성 개선 ✅ \ No newline at end of file