Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a _to_text helper function in app/services/summarizer.py to normalize structured LLM outputs, such as lists and dictionaries, into plain strings for the NoticeSummaryData model. A new test file has been added to verify this normalization logic. The review feedback suggests refining the _to_text implementation to filter out empty or null values within collections, which prevents the generation of empty keys or unnecessary newlines in the final string output.
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.
유형
작업 내용
공지 요약 결과 생성 시 LLM 응답의 일부 필드가 문자열이 아닌 dict/list 형태로 반환되면서
NoticeSummaryData검증에 실패하는 문제를 수정했습니다.target_info,schedule_info,caution_info등 DB에 문자열로 저장되는 필드는NoticeSummaryData생성 전에 문자열로 정규화하도록 처리했습니다.변경 사항 (있다면)
summarizer.py에_to_text()정규화 함수 추가summary,target_info,schedule_info,caution_info필드에 문자열 정규화 적용리뷰 포인트
None값이 빈 문자열로 변환된 뒤 기존 Pydantic validator에서None으로 정리되는 흐름이 적절한지 봐주세요.테스트
/docs수동 확인pytest실행스크린샷