Skip to content

[#17] Gemini를 기본 AI provider로 연결한다#18

Merged
opficdev merged 2 commits into
developfrom
feat/#17-gemini
Jun 22, 2026
Merged

[#17] Gemini를 기본 AI provider로 연결한다#18
opficdev merged 2 commits into
developfrom
feat/#17-gemini

Conversation

@opficdev

Copy link
Copy Markdown
Owner

🔗 연관된 이슈

🎯 의도

Gemini API를 Watcher의 기본 AI provider로 연결하기 위한 기반 구성

📝 작업 내용

📌 요약

  • Gemini prediction client 구성
  • GEMINI_API_KEY 기반 secret 계약 반영
  • Gemini structured output 응답 처리 구성
  • 기본 AI provider factory 구성
  • OpenAI 기본 전제 제거

🔍 상세

  • src/ai/geminiPredictionClient.tsGeminiPredictionClient 추가
  • DEFAULT_GEMINI_PREDICTION_MODELgemini-3.5-flash로 구성
  • GEMINI_API_KEY_ENV_NAME을 통해 Gemini API key environment variable 명시
  • Gemini REST generateContent endpoint 호출 구성
  • system_instruction, contents, generationConfig.responseFormat 기반 JSON 응답 요청 구성
  • Gemini 응답의 candidates[].content.parts[].text를 JSON으로 parse하도록 구성
  • Gemini HTTP 실패와 빈 응답을 명확한 error로 노출
  • createDefaultAiPredictionClient()를 통해 기본 AI provider가 Gemini임을 코드 레벨에서 표현
  • src/index.ts에서 Gemini client, 기본 model, API key env 이름, default factory export
  • tests/ai/geminiPredictionClient.test.ts에 API key 누락, request payload, response parse, request 실패, 빈 응답, default factory 테스트 추가
  • README.md에 Gemini API와 GEMINI_API_KEY secret 사용 기준 추가
  • AGENTS.md에서 OpenAI 기본 전제를 Gemini 기준으로 정리

✅ 검증

  • npm run build
  • npm test

📸 영상 / 이미지 (Optional)

없음

@opficdev opficdev self-assigned this Jun 22, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 풀 요청은 기존 OpenAI 대신 Gemini API를 기본 AI 예측 프로바이더로 도입하기 위해 GeminiPredictionClient를 추가하고 관련 문서 및 테스트 코드를 작성한 변경사항을 담고 있습니다. 리뷰어 피드백에 따르면, Gemini v1beta API 명세에 맞게 generationConfig 구조와 systemInstruction 필드명을 수정해야 하며, 스키마 정의 시 타입명을 대문자(OBJECT, STRING 등)로 변경해야 API 호출 오류를 방지할 수 있습니다. 또한 존재하지 않는 gemini-3.5-flash 모델명을 실제 존재하는 모델명으로 변경하고, 이에 맞춰 테스트 코드의 검증 로직도 함께 수정할 것을 권장합니다.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/ai/geminiPredictionClient.ts
Comment thread src/ai/geminiPredictionClient.ts
Comment thread src/ai/geminiPredictionClient.ts
Comment thread tests/ai/geminiPredictionClient.test.ts
@opficdev opficdev merged commit 36037c2 into develop Jun 22, 2026
3 checks passed
@opficdev opficdev deleted the feat/#17-gemini branch June 22, 2026 08:23
@opficdev opficdev changed the title [#17] [#17] Gemini를 기본 AI provider로 연결한다 Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gemini를 기본 AI provider로 연결한다

1 participant