File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ async def create(
5050 posthog_trace_id = uuid .uuid4 ()
5151
5252 if kwargs .get ("stream" , False ):
53- return self ._create_streaming (
53+ return await self ._create_streaming (
5454 posthog_distinct_id ,
5555 posthog_trace_id ,
5656 posthog_properties ,
@@ -84,14 +84,14 @@ async def _create_streaming(
8484 start_time = time .time ()
8585 usage_stats : Dict [str , int ] = {}
8686 final_content = []
87- response = super ().create (** kwargs )
87+ response = await super ().create (** kwargs )
8888
8989 async def async_generator ():
9090 nonlocal usage_stats
9191 nonlocal final_content
9292
9393 try :
94- for chunk in response :
94+ async for chunk in response :
9595 if hasattr (chunk , "type" ) and chunk .type == "response.completed" :
9696 res = chunk .response
9797 if res .output and len (res .output ) > 0 :
Original file line number Diff line number Diff line change @@ -541,7 +541,6 @@ def test_responses_api(mock_client):
541541
542542 call_args = mock_client .capture .call_args [1 ]
543543 props = call_args ["properties" ]
544- print (props )
545544 assert props ["$ai_provider" ] == "openai"
546545 assert props ["$ai_model" ] == "gpt-4o-mini"
547546 assert props ["$ai_input" ] == [{"role" : "user" , "content" : "Hello" }]
You can’t perform that action at this time.
0 commit comments