feat(report): 리포트 생성 로그에 LLM 토큰 사용량 기록 추가#190
Open
1Seob wants to merge 7 commits into
Open
Conversation
report_generation_logs에 input_tokens, output_tokens, total_tokens 컬럼을 추가하고 ReportGenerationLog의 토큰 기록 경로를 확장함. ReportGenerationLogService와 ReportGenerationLogRecorder에서 별도 트랜잭션 기반 토큰 사용량 기록을 지원하며, nullable usage 저장 케이스와 repository 매핑 테스트를 보강함
Spring AI ChatResponse의 Usage를 내부 LlmTokenUsage로 변환하는 공통 추출기를 추가하고, LLM 결과와 토큰 사용량을 함께 전달하기 위한 LlmGenerationResult를 추가함
DailyReportLlmClient가 Spring AI ChatResponse에서 본문과 Usage를 함께 추출하도록 변경하고, DailyReportService에서 생성 로그에 input/output/total token 사용량을 기록함
report_generation_logs에 thinking_tokens 컬럼을 추가하고 Spring AI GoogleGenAiUsage의 thoughtsTokenCount를 LlmTokenUsage로 추출하도록 확장함. 주간 리포트 생성과 rewrite usage를 합산해 기록
MonthlyReportLlmClient와 MonthlyReportLlmClientV2가 ChatResponse 기반으로 LLM 응답 본문과 토큰 사용량을 함께 반환하도록 변경하고, 월간 리포트 생성 로그에 input_tokens, output_tokens, total_tokens, thinking_tokens를 기록하도록 추가
유형 리포트의 Evidence Cards, Pattern Extraction, Type Selection, Content Generation 단계에서 ChatResponse 기반 토큰 사용량을 추출하고 각 generation log에 기록하도록 추가
유형 리포트의 단계별 LLM 토큰 사용량 기록 순서를 검증하고, 월간 V2 listener 테스트에서 토큰 기록 후 성공 처리 순서를 확인하도록 보강
Collaborator
|
LGTM! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 요약(Summary)
리포트 생성 로그에서 LLM 토큰 사용량을 추적할 수 있도록
report_generation_logs에 토큰 관련 컬럼을 추가하고,일간·주간·월간·유형 리포트 생성 흐름에 Spring AI
ChatResponse기반 usage 기록을 연결했습니다.주요 변경 사항
report_generation_logs에input_tokens,output_tokens,total_tokens,thinking_tokens컬럼 추가ChatResponse에서 공통 토큰 사용량을 추출하는LlmTokenUsage,LlmGenerationResult,LlmTokenUsageExtractor추가thoughtsTokenCount를thinking_tokens로 분리 저장검증
compileJavagit diff --check🔗 Related Issue
💬 공유사항
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.