From 043863b25e4d713d0ebd84d50a61de15bfbb5a3e Mon Sep 17 00:00:00 2001 From: bbh Date: Wed, 13 Aug 2025 00:38:27 +0800 Subject: [PATCH] new-feature: add bentoml_classifiy in utils --- backend/app/api/routes/utils.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backend/app/api/routes/utils.py b/backend/app/api/routes/utils.py index fc09341..864e8e4 100644 --- a/backend/app/api/routes/utils.py +++ b/backend/app/api/routes/utils.py @@ -29,3 +29,17 @@ def test_email(email_to: EmailStr) -> Message: @router.get("/health-check/") async def health_check() -> bool: return True + +class ClassifyRequest(BaseModel): + text: str + +@router.post("/bentoml_classifiy") +async def bentoml_classifiy(data: ClassifyRequest): + async with httpx.AsyncClient() as client: + response = await client.post( + "http://localhost:3000/classify", + json={"text": "data.text"} + ) + result = response.json() + + return result