From 4944855210671670380d7f51ba0fc4878533b236 Mon Sep 17 00:00:00 2001 From: cyjadela Date: Wed, 29 Oct 2025 17:45:37 +0900 Subject: [PATCH] =?UTF-8?q?Chore:=20ai-python=20=EC=84=9C=EB=B9=84?= =?UTF-8?q?=EC=8A=A4=20=ED=8F=AC=ED=8A=B8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ai-python/API-DOCUMENTATION.md | 8 ++++---- ai-python/README.md | 8 ++++---- ai-python/app/config.py | 2 +- ai-python/restart.sh | 32 ++++++++++++++++---------------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ai-python/API-DOCUMENTATION.md b/ai-python/API-DOCUMENTATION.md index 77fed86..50dd5d5 100644 --- a/ai-python/API-DOCUMENTATION.md +++ b/ai-python/API-DOCUMENTATION.md @@ -1,9 +1,9 @@ # AI Service API Documentation ## 서비스 정보 -- **Base URL**: `http://localhost:8086` -- **프로덕션 URL**: `http://{AKS-IP}:8086` (배포 후) -- **포트**: 8086 +- **Base URL**: `http://localhost:8087` +- **프로덕션 URL**: `http://{AKS-IP}:8087` (배포 후) +- **포트**: 8087 - **프로토콜**: HTTP - **CORS**: 모든 origin 허용 (개발 환경) @@ -285,7 +285,7 @@ A: Redis에 충분한 텍스트(10개 세그먼트)가 축적되어야 분석이 **요청 예시 (curl)**: ```bash -curl -X POST "http://localhost:8086/api/v1/ai/summary/generate" \ +curl -X POST "http://localhost:8087/api/v1/ai/summary/generate" \ -H "Content-Type: application/json" \ -d '{ "text": "오늘 회의에서는 프로젝트 일정과 예산에 대해 논의했습니다...", diff --git a/ai-python/README.md b/ai-python/README.md index 87fd8ad..2b8a796 100644 --- a/ai-python/README.md +++ b/ai-python/README.md @@ -56,10 +56,10 @@ python3 main.py ```bash # 헬스 체크 -curl http://localhost:8086/health +curl http://localhost:8087/health # SSE 스트림 테스트 -curl -N http://localhost:8086/api/v1/ai/suggestions/meetings/test-meeting/stream +curl -N http://localhost:8087/api/v1/ai/suggestions/meetings/test-meeting/stream ``` ## 📡 API 엔드포인트 @@ -123,7 +123,7 @@ ai-python/ | `REDIS_HOST` | Redis 호스트 | 20.249.177.114 | | `REDIS_PORT` | Redis 포트 | 6379 | | `EVENTHUB_CONNECTION_STRING` | Event Hub 연결 문자열 | (선택) | -| `PORT` | 서비스 포트 | 8086 | +| `PORT` | 서비스 포트 | 8087 | ## 🔍 동작 원리 @@ -136,7 +136,7 @@ ai-python/ ```bash # Event Hub 없이 SSE만 테스트 (Mock 데이터) -curl -N http://localhost:8086/api/v1/ai/suggestions/meetings/test-meeting/stream +curl -N http://localhost:8087/api/v1/ai/suggestions/meetings/test-meeting/stream # 5초마다 샘플 제안사항이 발행됩니다 ``` diff --git a/ai-python/app/config.py b/ai-python/app/config.py index f5a62de..ccfa815 100644 --- a/ai-python/app/config.py +++ b/ai-python/app/config.py @@ -10,7 +10,7 @@ class Settings(BaseSettings): # 서버 설정 app_name: str = "AI Service (Python)" host: str = "0.0.0.0" - port: int = 8086 + port: int = 8087 # Claude API claude_api_key: str = "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" diff --git a/ai-python/restart.sh b/ai-python/restart.sh index 78afc44..b166c1a 100755 --- a/ai-python/restart.sh +++ b/ai-python/restart.sh @@ -1,7 +1,7 @@ #!/bin/bash # AI Python 서비스 재시작 스크립트 -# 8086 포트로 깔끔하게 재시작 +# 8087 포트로 깔끔하게 재시작 echo "==================================" echo "AI Python 서비스 재시작" @@ -18,23 +18,23 @@ sleep 2 # 2. 포트 확인 echo "2️⃣ 포트 상태 확인..." -if lsof -i:8086 > /dev/null 2>&1; then - echo " ⚠️ 8086 포트가 아직 사용 중입니다." +if lsof -i:8087 > /dev/null 2>&1; then + echo " ⚠️ 8087 포트가 아직 사용 중입니다." echo " 강제 종료 시도..." - PID=$(lsof -ti:8086) + PID=$(lsof -ti:8087) if [ ! -z "$PID" ]; then kill -9 $PID sleep 2 fi fi -if lsof -i:8086 > /dev/null 2>&1; then - echo " ❌ 8086 포트를 해제할 수 없습니다." +if lsof -i:8087 > /dev/null 2>&1; then + echo " ❌ 8087 포트를 해제할 수 없습니다." echo " 시스템 재부팅 후 다시 시도하거나," echo " 다른 포트를 사용하세요." exit 1 else - echo " ✅ 8086 포트 사용 가능" + echo " ✅ 8087 포트 사용 가능" fi # 3. 가상환경 활성화 @@ -51,7 +51,7 @@ echo " ✅ 가상환경 활성화 완료" mkdir -p ../logs # 5. 서비스 시작 -echo "4️⃣ AI Python 서비스 시작 (포트: 8086)..." +echo "4️⃣ AI Python 서비스 시작 (포트: 8087)..." nohup python3 main.py > ../logs/ai-python.log 2>&1 & PID=$! @@ -76,16 +76,16 @@ else fi # 포트 확인 -if lsof -i:8086 > /dev/null 2>&1; then - echo " ✅ 8086 포트 리스닝 중" +if lsof -i:8087 > /dev/null 2>&1; then + echo " ✅ 8087 포트 리스닝 중" else - echo " ⚠️ 8086 포트 아직 준비 중..." + echo " ⚠️ 8087 포트 아직 준비 중..." fi # Health 체크 echo "7️⃣ Health Check..." sleep 2 -HEALTH=$(curl -s http://localhost:8086/health 2>/dev/null) +HEALTH=$(curl -s http://localhost:8087/health 2>/dev/null) if [ $? -eq 0 ]; then echo " ✅ Health Check 성공" @@ -103,13 +103,13 @@ echo "✅ AI Python 서비스 시작 완료" echo "==================================" echo "📊 서비스 정보:" echo " - PID: $PID" -echo " - 포트: 8086" +echo " - 포트: 8087" echo " - 로그: tail -f ../logs/ai-python.log" echo "" echo "📡 엔드포인트:" -echo " - Health: http://localhost:8086/health" -echo " - Root: http://localhost:8086/" -echo " - Swagger: http://localhost:8086/swagger-ui.html" +echo " - Health: http://localhost:8087/health" +echo " - Root: http://localhost:8087/" +echo " - Swagger: http://localhost:8087/swagger-ui.html" echo "" echo "🛑 서비스 중지: pkill -f 'python.*main.py'" echo "=================================="