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