From 507f07ef10307758f434c42058c6fd3b7cfe9b65 Mon Sep 17 00:00:00 2001 From: samsja Date: Tue, 25 Apr 2023 17:10:41 +0200 Subject: [PATCH] docs: fix fastapi Signed-off-by: samsja --- docs/user_guide/sending/api/fastAPI.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user_guide/sending/api/fastAPI.md b/docs/user_guide/sending/api/fastAPI.md index 039af9b5aca..04df5e9497a 100644 --- a/docs/user_guide/sending/api/fastAPI.md +++ b/docs/user_guide/sending/api/fastAPI.md @@ -38,14 +38,14 @@ from fastapi import FastAPI from httpx import AsyncClient from docarray.documents import ImageDoc -from docarray.base_doc import DocumentResponse +from docarray.base_doc import DocArrayResponse input_doc = InputDoc(img=ImageDoc(tensor=np.zeros((3, 224, 224)))) app = FastAPI() -@app.post("/doc/", response_model=OutputDoc, response_class=DocumentResponse) +@app.post("/doc/", response_model=OutputDoc, response_class=DocArrayResponse) async def create_item(doc: InputDoc) -> OutputDoc: ## call my fancy model to generate the embeddings doc = OutputDoc(