소형 건설업체(100억 미만)를 위한 AI 기반 토목공사 통합관리 플랫폼 Backend (FastAPI): - SQLAlchemy 모델 13개 (users, projects, wbs, tasks, daily_reports, reports, inspections, quality, weather, permits, rag, settings) - API 라우터 11개 (auth, projects, tasks, daily_reports, reports, inspections, weather, rag, kakao, permits, settings) - Services: Claude AI 래퍼, CPM Gantt 계산, 기상청 API, RAG(pgvector), 카카오 Skill API - Alembic 마이그레이션 (pgvector 포함) - pytest 테스트 (CPM, 날씨 경보) Frontend (Next.js 15): - 11개 페이지 (대시보드, 프로젝트, Gantt, 일보, 검측, 품질, 날씨, 인허가, RAG, 설정) - TanStack Query + Zustand + Tailwind CSS 인프라: - Docker Compose (PostgreSQL pgvector + backend + frontend) - 한국어 README 및 설치 가이드 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
42 lines
1.3 KiB
Python
42 lines
1.3 KiB
Python
"""AI-powered daily report generation."""
|
|
from app.services.ai_engine import complete
|
|
from app.services.prompts.daily_report import SYSTEM_PROMPT, build_prompt
|
|
|
|
|
|
async def generate_work_content(
|
|
project_name: str,
|
|
report_date: str,
|
|
weather_summary: str,
|
|
temperature_high: float | None,
|
|
temperature_low: float | None,
|
|
workers_count: dict,
|
|
equipment_list: list,
|
|
work_items: list[str],
|
|
issues: str | None,
|
|
) -> str:
|
|
"""Generate the work content text for a daily report."""
|
|
temp_str = ""
|
|
if temperature_high is not None and temperature_low is not None:
|
|
temp_str = f"최고 {temperature_high}°C / 최저 {temperature_low}°C"
|
|
elif temperature_high is not None:
|
|
temp_str = f"최고 {temperature_high}°C"
|
|
else:
|
|
temp_str = "기온 정보 없음"
|
|
|
|
prompt = build_prompt(
|
|
project_name=project_name,
|
|
report_date=report_date,
|
|
weather_summary=weather_summary or "맑음",
|
|
temperature=temp_str,
|
|
workers=workers_count or {},
|
|
equipment=equipment_list or [],
|
|
work_items=work_items,
|
|
issues=issues,
|
|
)
|
|
|
|
return await complete(
|
|
messages=[{"role": "user", "content": prompt}],
|
|
system=SYSTEM_PROMPT,
|
|
temperature=0.3,
|
|
)
|