
    /j$                       % S SK Jr  S SKJrJr  S SKJr  SSKJr  SSK	J
r
  SSKJrJr  SSKJr   " S	 S
\5      r\S   \-  r  " S S\SS9rSSSS.rS\S'    " S S\SS9rSSSS SSS.rS\S'    " S S\SS9rSSSSS.rS\S '    " S! S"\SS9r S(   S)S$ jjrS(S*S% jjr S(   S+S& jjr\\\\\\\\\\\4                       S,S' jjrg#)-    )annotations)LiteralProtocol)	TypedDict   )LanguageCode)ChatContext)	NOT_GIVEN
NotGivenOris_givenc                  l    \ rS rSr\S
S j5       r\S
S j5       rSS jrSS jrSS.     SS jjr	S	r
g)_TurnDetector   c                    gNunknown selfs    J/app/agent/.venv/lib/python3.13/site-packages/livekit/agents/voice/turn.pymodel_TurnDetector.model           c                    gr   r   r   s    r   provider_TurnDetector.provider   r   r   c                   #    g 7fNr   r   languages     r   unlikely_threshold _TurnDetector.unlikely_threshold   s     WZ   c                   #    g 7fr    r   r!   s     r   supports_language_TurnDetector.supports_language   s     cr%   N)timeoutc                  #    g 7fr    r   )r   chat_ctxr)   s      r   predict_end_of_turn!_TurnDetector.predict_end_of_turn   s     r%   r   )returnstr)r"   LanguageCode | Noner.   float | None)r"   r0   r.   bool)r+   r	   r)   r1   r.   float)__name__
__module____qualname____firstlineno__propertyr   r   r#   r'   r,   __static_attributes__r   r   r   r   r      sZ        [Q AE#1=	 r   r   )sttvadrealtime_llmmanualc                  <    \ rS rSr% SrS\S'    S\S'    S\S'   Srg	)
EndpointingOptions/   zConfiguration for endpointing.

All keys are optional. Missing keys inherit from the session default
(at the ``Agent`` level) or use the documented defaults
(at the ``AgentSession`` level).
zLiteral['fixed', 'dynamic']moder3   	min_delay	max_delayr   Nr4   r5   r6   r7   __doc____annotations__r9   r   r   r   r?   r?   /   s(     &%r2r   r?   F)totalfixedg      ?g      @)rA   rB   rC   _ENDPOINTING_DEFAULTSc                  l    \ rS rSr% SrS\S'    S\S'    S\S'    S\S	'    S
\S'    S\S'    S\S'   Srg)InterruptionOptionsH   a  Configuration for interruption handling.

All keys are optional. Missing keys inherit from the session default
(at the ``Agent`` level) or use the documented defaults
(at the ``AgentSession`` level).

``mode`` absent means the session picks the best available strategy.
r2   enabledzLiteral['adaptive', 'vad']rA    discard_audio_if_uninterruptibler3   min_durationint	min_wordsresume_false_interruptionr1   false_interruption_timeoutr   NrD   r   r   r   rK   rK   H   sU     MB
$$! '+**N## ,,Dr   rK   Tg       @)rM   rN   rO   rQ   rR   rS   _INTERRUPTION_DEFAULTSc                  H    \ rS rSr% SrS\S'    S\S'    S\S'    S\S	'   S
rg)PreemptiveGenerationOptionss   z(Configuration for preemptive generation.r2   rM   preemptive_ttsr3   max_speech_durationrP   max_retriesr   NrD   r   r   r   rV   rV   s   s3    2MI6 /
 Fr   rV   g      $@   )rM   rX   rY   rZ   _PREEMPTIVE_GENERATION_DEFAULTSc                  H    \ rS rSr% SrS\S'    S\S'    S\S'    S	\S
'   Srg)TurnHandlingOptions   a^  Configuration for the turn handling system.

Can be passed as a plain dict::

    AgentSession(
        turn_handling={
            "endpointing": {"min_delay": 0.3},
            "interruption": {"enabled": False},
            "preemptive_generation": {"preemptive_tts": True},
        },
    )

All keys are optional and default to sensible values.
zTurnDetectionMode | Noneturn_detectionr?   endpointingrK   interruptionrV   preemptive_generationr   NrD   r   r   r   r^   r^      s/     -,.##Z%%U66Ur   r^   Nc                L    U c  [        S0 [        D6$ [        S0 0 [        EU ED6$ z"Fill in defaults for missing keys.r   )rV   r\   configs    r   _resolve_preemptive_generationrh      s2     ~*M-LMM&W)V,K)Vv)VWWr   c                L    U c  [        S0 [        D6$ [        S0 0 [        EU ED6$ re   )r?   rI   rf   s    r   _resolve_endpointingrj      s0    ~!:$9::D C#8 CF CDDr   c                L    U c  [        S0 [        D6$ [        S0 0 [        EU ED6$ )zJFill in defaults for missing keys (``mode`` stays absent if not provided).r   )rK   rT   rf   s    r   _resolve_interruptionrl      s2     ~"<%;<<F!E$:!Ef!EFFr   c                   [        U	5      (       a  U	n0 n0 n[        U 5      (       a  XS'   [        U5      (       a  XS'   U(       a  XS'   0 nUSL a  SUS'   [        U5      (       a  XMS'   [        U5      (       a  X]S'   [        U5      (       a  XmS'   [        U5      (       a  X-S	'   [        U5      (       a  XS
'   U(       a  XS'   [        U5      (       a  X;S'   [        U
5      (       a  SU
0US'   U$ )z>Build a TurnHandlingOptions from deprecated keyword arguments.rB   rC   ra   FrM   rN   rO   rQ   rS   rR   rb   r`   rc   r   )min_endpointing_delaymax_endpointing_delayrS   r`   rN   min_interruption_durationmin_interruption_wordsallow_interruptionsrR    agent_false_interruption_timeoutrc   resultendpointing_optsrb   s                 r   _migrate_turn_handlingrv      s    011%E""$F ,.%&&(=%%&&(=% 0} )+Le#"'Y011;[78)**'@^$&''$:[!*++5O12)**4M01!-~#1 %&&+46K*L&'Mr   r    )rg   z"PreemptiveGenerationOptions | Noner.   rV   )rg   zEndpointingOptions | Noner.   r?   )rg   zInterruptionOptions | Noner.   rK   )rn   NotGivenOr[float]ro   rw   rS   NotGivenOr[float | None]r`   z$NotGivenOr[TurnDetectionMode | None]rN   NotGivenOr[bool]rp   rw   rq   zNotGivenOr[int]rr   ry   rR   ry   rs   rx   rc   ry   r.   r^   )
__future__r   typingr   r   typing_extensionsr   r"   r   llmr	   typesr
   r   utilsr   r   TurnDetectionModer?   rI   rF   rK   rT   rV   r\   r^   rh   rj   rl   rv   r   r   r   <module>r      s   " $ ' #  ) H $ BCmS % & - ) D)5 DD (,!%"%/ + F)5 F. 	@ !< V)5 V8 26X.X XE *.G&GG 09/8;D;D9B3<.7,52;AJ.73,3,3 !93 9	3
 '73  13 ,3 *3  03 '?3 ,3 3r   