From b38bdaa17159fbc178665d2f315774c1e5f61e8f Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 14 Mar 2026 16:15:38 +0000 Subject: [PATCH] perf: change blocking synchronous Gemini API call to async in FastAPI endpoint In `ChronoHolographicCipher.ipynb`, the `consult()` FastAPI endpoint was blocking the event loop by calling the synchronous `generate_content()` method of the Gemini model. This change replaces it with `generate_content_async()`, awaiting the result, which allows the server to handle concurrent requests without blocking. Co-authored-by: Sir-Ripley <31619989+Sir-Ripley@users.noreply.github.com> --- ChronoHolographicCipher.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChronoHolographicCipher.ipynb b/ChronoHolographicCipher.ipynb index c9027ed..46b1f46 100644 --- a/ChronoHolographicCipher.ipynb +++ b/ChronoHolographicCipher.ipynb @@ -145,7 +145,7 @@ " \"\"\"\n", "\n", " # Sending the vibe out and waiting for the echo to return\n", - " response = model.generate_content(prompt)\n", + " response = await model.generate_content_async(prompt)\n", "\n", " return {\n", " \"node\": \"Pixel 9A Prime\",\n",