From 0e08b16516de0fdf584e751bc9d27411cdf09420 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 14:56:58 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Auto=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../openapi_callbacks/tutorial002_py310.py | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/docs_src/openapi_callbacks/tutorial002_py310.py b/docs_src/openapi_callbacks/tutorial002_py310.py index baf4e4425a..81a64d30d1 100644 --- a/docs_src/openapi_callbacks/tutorial002_py310.py +++ b/docs_src/openapi_callbacks/tutorial002_py310.py @@ -10,7 +10,6 @@ class PassageProcessingRequest(BaseModel): callback_url: str - @app.post("/callback") async def callback(request: Request): """ @@ -27,9 +26,7 @@ async def callback(request: Request): print(data) - return { - "received": True - } + return {"received": True} async def send_processing_result(callback_url: str, generated_passage: str): @@ -40,17 +37,13 @@ async def send_processing_result(callback_url: str, generated_passage: str): async with httpx.AsyncClient() as client: await client.post( callback_url, - json={ - "processed_passage": generated_passage, - "status": "completed" - } + json={"processed_passage": generated_passage, "status": "completed"}, ) @app.post("/process-passage") async def process_passage( - data: PassageProcessingRequest, - background_tasks: BackgroundTasks + data: PassageProcessingRequest, background_tasks: BackgroundTasks ): """ Receives a passage processing request from the client. @@ -64,11 +57,7 @@ async def process_passage( """ background_tasks.add_task( - send_processing_result, - data.callback_url, - data.passage_topic + send_processing_result, data.callback_url, data.passage_topic ) - return { - "message": "Passage processing started" - } + return {"message": "Passage processing started"}