From 68ddb0067bea08bde1858df77aeb9e93c84b9d07 Mon Sep 17 00:00:00 2001 From: Georgiy Tarasov Date: Wed, 30 Oct 2024 22:49:16 +0100 Subject: [PATCH] fix(product-assistant): use header to disable nginx buffering (#25907) --- posthog/api/query.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/posthog/api/query.py b/posthog/api/query.py index beb1415b8dc38..00d4548eeae37 100644 --- a/posthog/api/query.py +++ b/posthog/api/query.py @@ -206,7 +206,9 @@ def generate(): {"prompt": human_message.content, "response": last_message}, ) - return StreamingHttpResponse(generate(), content_type=ServerSentEventRenderer.media_type) + return StreamingHttpResponse( + generate(), content_type=ServerSentEventRenderer.media_type, headers={"X-Accel-Buffering": "no"} + ) def handle_column_ch_error(self, error): if getattr(error, "message", None):