Skip to content

Commit

Permalink
feat: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sspzoa committed Oct 1, 2024
1 parent a718fbe commit 5fa3ce0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
app = FastAPI(
title="Deening API",
description="Best Recipe Service powered by AI.",
version="0.1.0"
version="0.1.0",
contact={
"name": "Seungpyo Suh",
"url": "https://sspzoa.io/",
"email": "me@sspzoa.io",
},
license_info={
"name": "GNU Affero General Public License v3.0",
"url": "https://www.gnu.org/licenses/agpl-3.0.en.html",
},
)

app.include_router(ping.router)
Expand Down
3 changes: 3 additions & 0 deletions app/routes/cooking_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class ErrorResponse(BaseModel):

@router.post("/cooking_step", response_model=CookingStepResponse, responses={400: {"model": ErrorResponse}, 404: {"model": ErrorResponse}})
async def get_cooking_step_info(request: CookingStepRequest):
"""
레시피의 특정 조리 단계에 대한 상세 정보를 생성합니다.
"""
if request.recipe_id not in recipe_store:
raise HTTPException(status_code=404, detail="레시피를 찾을 수 없습니다.")

Expand Down
3 changes: 3 additions & 0 deletions app/routes/ingredient.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class ErrorResponse(BaseModel):

@router.post("/ingredient", response_model=IngredientResponse, responses={400: {"model": ErrorResponse}})
async def get_ingredient_info(request: IngredientRequest):
"""
식재료 정보와 이미지를 생성합니다.
"""
try:
# 식재료 정보 생성 프롬프트
ingredient_prompt = f"""제공된 식재료에 대한 정보를 JSON 형식으로 생성해주세요. 다음 구조를 따라주세요:
Expand Down
3 changes: 3 additions & 0 deletions app/routes/ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@

@router.get("/ping", response_model=PingResponse)
async def ping():
"""
Health check endpoint
"""
return {"message": "pong"}
6 changes: 6 additions & 0 deletions app/routes/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class ErrorResponse(BaseModel):

@router.post("/recipe", response_model=RecipeResponse, responses={400: {"model": ErrorResponse}})
async def get_recipe(request: RecipeRequest):
"""
주어진 음식 이름에 대한 레시피를 생성합니다.
"""
try:
# 레시피 생성 프롬프트
recipe_prompt = f"""제공된 음식 이름에 대한 레시피를 JSON 형식으로 생성해주세요. 다음 구조를 따라주세요:
Expand Down Expand Up @@ -106,6 +109,9 @@ async def get_recipe(request: RecipeRequest):

@router.get("/recipe/{recipe_id}", response_model=RecipeResponse, responses={404: {"model": ErrorResponse}})
async def get_recipe_by_id(recipe_id: str):
"""
주어진 ID에 대한 레시피를 반환합니다.
"""
if recipe_id not in recipe_store:
raise HTTPException(status_code=404, detail="레시피를 찾을 수 없습니다.")

Expand Down

0 comments on commit 5fa3ce0

Please sign in to comment.