File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ def new_iterator():
270270 data_buf [0 ].append (x .delta or "" )
271271
272272 # OpenAI responses API end of streaming response
273- if x . __class__ . __name__ == " ResponseCompletedEvent" :
273+ if isinstance ( x , ResponseCompletedEvent ) :
274274 _calculate_token_usage (
275275 messages ,
276276 x .response ,
@@ -283,7 +283,7 @@ def new_iterator():
283283 yield x
284284
285285 if len (data_buf ) > 0 :
286- all_responses = list ( map ( lambda chunk : "" .join (chunk ), data_buf ))
286+ all_responses = [ "" .join (chunk ) for chunk in data_buf ]
287287 if should_send_default_pii () and integration .include_prompts :
288288 set_data_normalized (
289289 span , SPANDATA .GEN_AI_RESPONSE_TEXT , all_responses
@@ -338,7 +338,7 @@ async def new_iterator_async():
338338 yield x
339339
340340 if len (data_buf ) > 0 :
341- all_responses = list ( map ( lambda chunk : "" .join (chunk ), data_buf ))
341+ all_responses = [ "" .join (chunk ) for chunk in data_buf ]
342342 if should_send_default_pii () and integration .include_prompts :
343343 set_data_normalized (
344344 span , SPANDATA .GEN_AI_RESPONSE_TEXT , all_responses
You can’t perform that action at this time.
0 commit comments