Fastembed Server: Add health check endpoint

This commit is contained in:
Lain Soykaf 2024-05-27 14:15:04 +04:00
parent 8b76f56050
commit ec3f3fef77
1 changed files with 4 additions and 0 deletions

View File

@ -17,6 +17,10 @@ def embeddings(request: EmbeddingRequest):
embeddings = next(model.embed(request.input)).tolist() embeddings = next(model.embed(request.input)).tolist()
return {"data": [{"embedding": embeddings}]} return {"data": [{"embedding": embeddings}]}
@app.get("/health")
def health():
return {"status": "ok"}
if __name__ == "__main__": if __name__ == "__main__":
import uvicorn import uvicorn