mirror of
https://github.com/hwanny1128/HGZero.git
synced 2026-06-13 01:19:11 +00:00
Merge: AI 요약 재생성 기능 및 포트 8087 통일
- AI 텍스트 요약 API 추가 (POST /api/v1/ai/summary/generate) - 불릿 포인트 및 단락형 스타일 지원 - 포트 8087로 통일 - 압축률, 핵심 포인트 추출 기능 포함 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,10 @@ from .response import (
|
||||
SimpleSuggestion,
|
||||
RealtimeSuggestionsResponse
|
||||
)
|
||||
from .summary import (
|
||||
SummaryRequest,
|
||||
SummaryResponse
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"ConsolidateRequest",
|
||||
@@ -19,4 +23,6 @@ __all__ = [
|
||||
"ExtractedTodo",
|
||||
"SimpleSuggestion",
|
||||
"RealtimeSuggestionsResponse",
|
||||
"SummaryRequest",
|
||||
"SummaryResponse",
|
||||
]
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
"""요약 관련 모델"""
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SummaryRequest(BaseModel):
|
||||
"""요약 요청 모델"""
|
||||
text: str = Field(
|
||||
...,
|
||||
description="요약할 텍스트",
|
||||
example="오늘 회의에서는 프로젝트 일정과 예산에 대해 논의했습니다. 첫째, 개발 일정은 3개월로 확정되었고, 디자인 단계는 2주, 개발 단계는 8주, 테스트 단계는 2주로 배분하기로 했습니다. 둘째, 예산은 총 5천만원으로 책정되었으며, 인건비 3천만원, 인프라 비용 1천만원, 기타 비용 1천만원으로 배분됩니다. 셋째, 주간 회의는 매주 화요일 오전 10시에 진행하기로 했습니다."
|
||||
)
|
||||
language: str = Field(
|
||||
default="ko",
|
||||
description="요약 언어 (ko: 한국어, en: 영어)",
|
||||
example="ko"
|
||||
)
|
||||
style: str = Field(
|
||||
default="bullet",
|
||||
description="요약 스타일 (bullet: 불릿 포인트, paragraph: 단락형)",
|
||||
example="bullet"
|
||||
)
|
||||
max_length: Optional[int] = Field(
|
||||
default=None,
|
||||
description="최대 요약 길이 (단어 수)",
|
||||
example=100
|
||||
)
|
||||
|
||||
|
||||
class SummaryResponse(BaseModel):
|
||||
"""요약 응답 모델"""
|
||||
summary: str = Field(
|
||||
...,
|
||||
description="생성된 요약",
|
||||
example="• 프로젝트 일정: 총 3개월 (디자인 2주, 개발 8주, 테스트 2주)\n• 예산: 총 5천만원 (인건비 3천만원, 인프라 1천만원, 기타 1천만원)\n• 주간 회의: 매주 화요일 오전 10시"
|
||||
)
|
||||
key_points: List[str] = Field(
|
||||
...,
|
||||
description="핵심 포인트 리스트",
|
||||
example=[
|
||||
"프로젝트 일정 3개월 확정",
|
||||
"총 예산 5천만원 책정",
|
||||
"주간 회의 화요일 10시"
|
||||
]
|
||||
)
|
||||
word_count: int = Field(
|
||||
...,
|
||||
description="요약 단어 수",
|
||||
example=42
|
||||
)
|
||||
original_word_count: int = Field(
|
||||
...,
|
||||
description="원본 텍스트 단어 수",
|
||||
example=156
|
||||
)
|
||||
compression_ratio: float = Field(
|
||||
...,
|
||||
description="압축률 (요약 길이 / 원본 길이)",
|
||||
example=0.27
|
||||
)
|
||||
generated_at: datetime = Field(
|
||||
default_factory=datetime.now,
|
||||
description="생성 시간"
|
||||
)
|
||||
|
||||
class Config:
|
||||
json_schema_extra = {
|
||||
"example": {
|
||||
"summary": "• 프로젝트 일정: 총 3개월 (디자인 2주, 개발 8주, 테스트 2주)\n• 예산: 총 5천만원 (인건비 3천만원, 인프라 1천만원, 기타 1천만원)\n• 주간 회의: 매주 화요일 오전 10시",
|
||||
"key_points": [
|
||||
"프로젝트 일정 3개월 확정",
|
||||
"총 예산 5천만원 책정",
|
||||
"주간 회의 화요일 10시"
|
||||
],
|
||||
"word_count": 42,
|
||||
"original_word_count": 156,
|
||||
"compression_ratio": 0.27,
|
||||
"generated_at": "2024-10-29T17:15:30.123456"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user