Skip to content

Commit 0eabcfe

Browse files
committed
fix(ai/anthropic): wrap streaming generator in AsyncStreamWrapper
1 parent e27d723 commit 0eabcfe

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

posthog/ai/anthropic/anthropic_async.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import time
1010
import uuid
11+
from posthog.ai.stream import AsyncStreamWrapper
1112
from typing import Any, Dict, List, Optional
1213

1314
from posthog import setup
@@ -225,7 +226,7 @@ async def generator():
225226
stop_reason=stop_reason,
226227
)
227228

228-
return generator()
229+
return AsyncStreamWrapper(generator())
229230

230231
async def _capture_streaming_event(
231232
self,

0 commit comments

Comments
 (0)