이미지 업로드 때 task_id 생성으로 변경, 가사 생성시 task_id 받아오는 것으로 변경
This commit is contained in:
1 parent
f81d158f0f
commit
c6d9edbb42
4 files changed
+130
-53
No files matched your search
@@ -42,7 +42,6 @@ from app.lyric.schemas.lyric import (
|
||||
LyricStatusResponse,
|
||||
)
|
||||
from app.utils.chatgpt_prompt import ChatgptService
|
||||
from app.utils.common import generate_task_id
|
||||
from app.utils.pagination import PaginatedResponse, get_paginated
|
||||
|
||||
router = APIRouter(prefix="/lyric", tags=["lyric"])
|
||||
@@ -159,6 +158,7 @@ async def get_lyric_by_task_id(
|
||||
고객 정보를 기반으로 ChatGPT를 이용하여 가사를 생성합니다.
|
||||
|
||||
## 요청 필드
|
||||
- **task_id**: 작업 고유 식별자 (이미지 업로드 시 생성된 task_id, 필수)
|
||||
- **customer_name**: 고객명/가게명 (필수)
|
||||
- **region**: 지역명 (필수)
|
||||
- **detail_region_info**: 상세 지역 정보 (선택)
|
||||
@@ -180,6 +180,7 @@ async def get_lyric_by_task_id(
|
||||
```
|
||||
POST /lyric/generate
|
||||
{
|
||||
"task_id": "0694b716-dbff-7219-8000-d08cb5fce431",
|
||||
"customer_name": "스테이 머뭄",
|
||||
"region": "군산",
|
||||
"detail_region_info": "군산 신흥동 말랭이 마을",
|
||||
@@ -220,9 +221,10 @@ async def generate_lyric(
|
||||
session: AsyncSession = Depends(get_session),
|
||||
) -> GenerateLyricResponse:
|
||||
"""고객 정보를 기반으로 가사를 생성합니다."""
|
||||
task_id = await generate_task_id(session=session, table_name=Project)
|
||||
task_id = request_body.task_id
|
||||
print(
|
||||
f"[generate_lyric] START - task_id: {task_id}, customer_name: {request_body.customer_name}, region: {request_body.region}"
|
||||
f"[generate_lyric] START - task_id: {task_id}, "
|
||||
f"customer_name: {request_body.customer_name}, region: {request_body.region}"
|
||||
)
|
||||
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user