[DP-384] 수집 동향 LLM 서사 요약 구현 (collection_summary, 주/월 단위)#56
Merged
[DP-384] 수집 동향 LLM 서사 요약 구현 (collection_summary, 주/월 단위)#56
Conversation
- TrendSignals 데이터클래스 정의 (unit/period/content_count/top_tags/tfidf_keywords/prev_summary) - CollectionSummaryGenerator.generate(): daily → None, LLM 실패 → None, tool_use 없음 → AIInternalError - build_user_prompt(): 태그 빈도·증감 테이블 + 신규/급증 태그 + 수집 글 키워드 포함 - 이전 기간 prev_summary 주입 지원 (변화 비교 서술 유도) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
TrendSignals데이터클래스 신규 정의 —unit,period_start/end,cur/prev_content_count,top_tags(TagFrequency),tfidf_keywords,prev_summary필드 포함, 오케스트레이터(DP-386)가 조립app/core/prompts/trend_collection.py신규 — SYSTEM_PROMPT(수치 인용·키워드 자연 서술 원칙) +build_user_prompt(signals)+ Tool Use 스키마CollectionSummaryGenerator.generate(signals)신규 —unit="daily"→ None, LLM 실패 → None 반환,tool_use없음 →AIInternalError전파prev_summary옵셔널 주입으로 이전 기간 대비 차이점 서술 지원 (DP-404 패턴 동일)집계 방식
일 단위 집계 없이 주/월 범위 DB 직접 쿼리 채택 —
TrendDataLoader.load(start, end)가 임의 날짜 범위를 이미 지원하므로 별도 인프라 불필요.Test plan
pytest tests/test_trend_collection_summary.py— 7개 케이스 통과 확인pytest -q전체 406개 통과ruff check . && black --check .클린🤖 Generated with Claude Code