From beb1d98f34302b3f229f9588b17ed82f967ed911 Mon Sep 17 00:00:00 2001 From: Hassieb Pakzad <68423100+hassiebp@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:04:21 +0100 Subject: [PATCH] fix(openai): implement aclose on async stream responses --- langfuse/openai.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/langfuse/openai.py b/langfuse/openai.py index d780e0de..7ab464d1 100644 --- a/langfuse/openai.py +++ b/langfuse/openai.py @@ -977,3 +977,10 @@ async def close(self) -> None: Automatically called if the response body is read to completion. """ await self.response.close() + + async def aclose(self) -> None: + """Close the response and release the connection. + + Automatically called if the response body is read to completion. + """ + await self.response.aclose()