Skip to content

Commit e06830e

Browse files
authored
fix(llma): missing await in OpenAI's streaming implementation (#342)
* fix(llma): missing async for OpenAI async * chore(llma): bump version * chore(llma): bump version
1 parent 465baea commit e06830e

File tree

4 files changed

+276
-106
lines changed

4 files changed

+276
-106
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 6.7.8 - 2025-10-16
2+
3+
- fix(llma): missing async for OpenAI's streaming implementation
4+
15
# 6.7.7 - 2025-10-14
26

37
- fix: remove deprecated attribute $exception_personURL from exception events

posthog/ai/openai/openai_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ async def _create_streaming(
128128
start_time = time.time()
129129
usage_stats: TokenUsage = TokenUsage()
130130
final_content = []
131-
response = self._original.create(**kwargs)
131+
response = await self._original.create(**kwargs)
132132

133133
async def async_generator():
134134
nonlocal usage_stats
@@ -345,7 +345,7 @@ async def _create_streaming(
345345
if "stream_options" not in kwargs:
346346
kwargs["stream_options"] = {}
347347
kwargs["stream_options"]["include_usage"] = True
348-
response = self._original.create(**kwargs)
348+
response = await self._original.create(**kwargs)
349349

350350
async def async_generator():
351351
nonlocal usage_stats
@@ -499,7 +499,7 @@ async def create(
499499
posthog_trace_id = str(uuid.uuid4())
500500

501501
start_time = time.time()
502-
response = self._original.create(**kwargs)
502+
response = await self._original.create(**kwargs)
503503
end_time = time.time()
504504

505505
# Extract usage statistics if available

0 commit comments

Comments
 (0)