Commit Graph

2 Commits

Author SHA1 Message Date
10a60300ae fix(phase2): 타로 interpret 견고성 — maxOutputTokens 8192 + wall-clock 가드로 호출 상한 축소
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 21:01:43 +09:00
3acc1dbbe6 feat(phase2): 타로 interpret API — Gemini strict JSON + 인증·일일제한·reroll
lib/tarot/prompt.ts에 TarotInterpretation 스키마·시스템 프롬프트·JSON
파싱/검증 유틸을 추가하고, app/api/tarot/interpret/route.ts에서 사주
analyze와 동일한 Gemini 모델 폴백(getGenerativeModel systemInstruction +
generationConfig) 패턴을 재사용해 인증(401)→일일제한(429)→입력검증(400)
→API키(503)→호출 순서로 처리한다. GEMINI_API_KEY 미설정 시 예시 데이터
대신 503을 반환해 실데이터 오염을 막고, 스키마 검증 실패 시 사유를
주입해 1회 reroll한다.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 20:53:53 +09:00