new-feature: add bentoml_classifiy in utils
Some checks failed
Deploy to Staging / deploy (push) Has been cancelled
Lint Backend / lint-backend (push) Has been cancelled
Playwright Tests / changes (push) Has been cancelled
Playwright Tests / test-playwright (1, 4) (push) Has been cancelled
Playwright Tests / test-playwright (2, 4) (push) Has been cancelled
Playwright Tests / test-playwright (3, 4) (push) Has been cancelled
Playwright Tests / test-playwright (4, 4) (push) Has been cancelled
Playwright Tests / merge-playwright-reports (push) Has been cancelled
Playwright Tests / alls-green-playwright (push) Has been cancelled
Test Backend / test-backend (push) Has been cancelled
Test Docker Compose / test-docker-compose (push) Has been cancelled
Some checks failed
Deploy to Staging / deploy (push) Has been cancelled
Lint Backend / lint-backend (push) Has been cancelled
Playwright Tests / changes (push) Has been cancelled
Playwright Tests / test-playwright (1, 4) (push) Has been cancelled
Playwright Tests / test-playwright (2, 4) (push) Has been cancelled
Playwright Tests / test-playwright (3, 4) (push) Has been cancelled
Playwright Tests / test-playwright (4, 4) (push) Has been cancelled
Playwright Tests / merge-playwright-reports (push) Has been cancelled
Playwright Tests / alls-green-playwright (push) Has been cancelled
Test Backend / test-backend (push) Has been cancelled
Test Docker Compose / test-docker-compose (push) Has been cancelled
This commit is contained in:
@@ -29,3 +29,17 @@ def test_email(email_to: EmailStr) -> Message:
|
|||||||
@router.get("/health-check/")
|
@router.get("/health-check/")
|
||||||
async def health_check() -> bool:
|
async def health_check() -> bool:
|
||||||
return True
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user