@@ -865,10 +865,7 @@ async def _reply_to_audio_consumer(self) -> None:
865865 pcm , participant , conversation = self .conversation
866866 )
867867
868- if (
869- participant
870- and getattr (participant , "user_id" , None ) != self .agent_user .id
871- ):
868+ if participant and getattr (participant , "user_id" , None ) != self .agent_user .id :
872869 # first forward to processors
873870 # Extract audio bytes for processors using the proper PCM data structure
874871 # PCM data has: format, sample_rate, samples, pts, dts, time_base
@@ -1061,14 +1058,8 @@ async def _on_turn_event(self, event: TurnStartedEvent | TurnEndedEvent) -> None
10611058 f"🤖 Triggering LLM response after turn ended for { event .participant .user_id } "
10621059 )
10631060
1064- # Create participant object if we have metadata
1065- participant = None
1066- if hasattr (event , "custom" ) and event .custom :
1067- # Try to extract participant info from custom metadata
1068- participant = event .custom .get ("participant" )
1069-
10701061 # Trigger LLM response with the complete transcript
1071- await self .simple_response (transcript , participant )
1062+ await self .simple_response (transcript , event . participant )
10721063
10731064 # Clear the pending transcript for this speaker
10741065 self ._pending_user_transcripts [event .participant .user_id ] = ""
0 commit comments