## 💼 작업 설명 Gemini API 다중 키 round-robin 로테이션을 도입해, 한 파이프라인에서 연속 호출(Planner LLM → Embedding → Pin LLM 등) 시 rate limit 부담을 여러 계정에 분산한다. - `GEMINI_API_KEYS`(콤마 구분)로 N개 키 설정, `GEMINI_API_KEY` 단일 키 하위 호환 - 호출마다 키 순환 + 429 시 다른 키로 즉시 failover - `generate_content`(LLM/VLM) 및 embedding(VectorStore, RAG rerank) 경로에 공통 `GeminiKeyPool` 적용 - 키 1개일 때는 기존과 동일하게 동작 (로테이션 비활성) ## 🛠 하위 태스크 - [x] `resolved_gemini_api_keys()` 및 `GEMINI_API_KEYS` 설정 추가 (`app/core/config.py`) - [x] `GeminiKeyPool` 구현 — round-robin, client 캐시, 429 failover (`app/services/internal/ai/gemini_key_pool.py`) - [x] `generate_content_with_retry`에 key pool 연동 (`app/services/internal/ai/gemini_retry.py`) - [x] embedding 로테이션 — `RotatingGoogleGenAIEmbedding` (`VectorStoreService`, `RagRerankService`) - [x] factory / main lifespan / deps / `PolicyCardnewsImageService` wiring - [x] 단위 테스트 추가 (`tests/test_gemini_key_pool.py`) - [x] README env 예시 보완 ## ✅ 추가 사항 **환경 변수 예시** ```env # 다중 키 (권장) GEMINI_API_KEYS=key1,key2 # 단일 키 (기존) GEMINI_API_KEY=only_one_key
Activity