5f5edb1e6d
- 상담 기록 분석 및 요약 - 상담 기록 db 저장 - 상담 평가 - 상담 평가 db 저장
18 lines
643 B
Python
18 lines
643 B
Python
from fastapi import APIRouter, Depends
|
|
from backend.schemas.summary_schema import SummaryRequest, CallSummary, CallRequest
|
|
from backend.services.call_service import summary_call, create_call_history
|
|
from sqlalchemy.orm import Session
|
|
from backend.repository.db_init import get_db
|
|
|
|
|
|
router = APIRouter(prefix="/api/calls", tags=["Summary"])
|
|
|
|
# 요약 라우터
|
|
@router.post("", response_model=CallSummary)
|
|
def generate_summary(req:SummaryRequest):
|
|
return summary_call(req.transcript)
|
|
|
|
@router.post("/save", response_model=CallSummary)
|
|
def create_call(req: CallRequest, db:Session = Depends(get_db)):
|
|
return create_call_history(req, db)
|