what is the possible values of turn_detection in l...
# ask-ai
r
what is the possible values of turn_detection in llm=openai.realtime.RealtimeModel( api_key=OPENAI_API_KEY, temperature=self.get_generated_session_config().temperature, turn_detection=self.get_generated_session_config().turn_detection, for example i want to set default one but not manually for example on old api i import it openai.realtime.DEFAULT_SERVER_VAD_OPTIONS
t
Thanks for reaching out, simo.dev. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The
turn_detection
parameter in
llm=openai.realtime.RealtimeModel()
can be configured with the following options: • *Server VAD (default):*`turn_detection=TurnDetection( type="server_vad", threshold=0.5, prefix_padding_ms=300, silence_duration_ms=500, create_response=True, interrupt_response=True, )` • *Semantic VAD:*`turn_detection=TurnDetection( type="semantic_vad", eagerness="auto", # can also be "low", "medium", or "high" create_response=True, interrupt_response=True, )` For
semantic_vad
, the
eagerness
property can be set to: •
auto
(default) - Equivalent to
medium
low
- Lets users take their time speaking •
medium
- Balanced approach •
high
- Chunks audio as soon as possible If you want to set the default option programmatically, you can use the
server_vad
configuration as shown above. Sources: OpenAI Realtime API integration guide | LiveKit Docs