Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,17 @@ public class AiEntryParser {
|
|||||||
return apiKey != null && !apiKey.isBlank();
|
return apiKey != null && !apiKey.isBlank();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 시작 시 AI 파서 활성 여부·키 로딩 상태를 로그로 남겨 진단을 쉽게 한다(키는 앞부분만 마스킹). */
|
||||||
|
@jakarta.annotation.PostConstruct
|
||||||
|
void logConfig() {
|
||||||
|
if (enabled()) {
|
||||||
|
String masked = apiKey.length() > 14 ? apiKey.substring(0, 14) + "…(len=" + apiKey.length() + ")" : "(len=" + apiKey.length() + ")";
|
||||||
|
log.info("[ai-parse] 활성화됨 — model={}, key={}", model, masked);
|
||||||
|
} else {
|
||||||
|
log.warn("[ai-parse] 비활성(ANTHROPIC_API_KEY 미설정) — 규칙기반 파서만 사용");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 자유 텍스트 → 파싱 결과. 실패/미설정 시 empty. */
|
/** 자유 텍스트 → 파싱 결과. 실패/미설정 시 empty. */
|
||||||
public Optional<ParsedEntryResponse> parse(String text, LocalDate today) {
|
public Optional<ParsedEntryResponse> parse(String text, LocalDate today) {
|
||||||
if (!enabled() || text == null || text.isBlank()) return Optional.empty();
|
if (!enabled() || text == null || text.isBlank()) return Optional.empty();
|
||||||
|
|||||||
Reference in New Issue
Block a user