-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
215 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from motor.motor_asyncio import AsyncIOMotorClient | ||
|
||
from app.config import MONGODB_URL | ||
|
||
client = AsyncIOMotorClient(MONGODB_URL) | ||
db = client.deening | ||
recipe_collection = db.recipes | ||
cooking_step_collection = db.cooking_steps | ||
ingredient_collection = db.ingredients |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
from pydantic import BaseModel | ||
from typing import List | ||
|
||
from fastapi import UploadFile | ||
from pydantic import BaseModel | ||
|
||
|
||
class IngredientDetectRequest(BaseModel): | ||
image: UploadFile | ||
|
||
|
||
class DetectedIngredient(BaseModel): | ||
ingredient_name: str | ||
|
||
|
||
class IngredientDetectResponse(BaseModel): | ||
ingredients: List[DetectedIngredient] | ||
|
||
|
||
class NoIngredientsFoundResponse(BaseModel): | ||
message: str = "No ingredients found in the image" | ||
message: str = "No ingredients found in the image" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from pydantic import BaseModel | ||
|
||
|
||
class PingResponse(BaseModel): | ||
message: str | ||
message: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from fastapi import APIRouter | ||
|
||
from app.models.ping_models import PingResponse | ||
|
||
router = APIRouter() | ||
|
||
|
||
@router.get("/ping", response_model=PingResponse) | ||
async def ping(): | ||
""" | ||
Health check endpoint | ||
""" | ||
return {"message": "pong"} | ||
return {"message": "pong"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.