
    CjD                    h   S SK Jr  S SKrS SKJrJr  S SKJr  S SKJ	r	J
r
  SSKJrJr  SSKJrJr  SS	KJr  S
rSr\
S   r \ " S S5      5       r " S S\R.                  5      r " S S\R.                  5      r\ " S S5      5       r " S S\R.                  5      r " S S\R.                  5      rg)    )annotationsN)AsyncIteratorCallable)	dataclass)AnyLiteral   )npnpt)
AudioInputStreamedAudioInput)get_sentence_based_splitterzYYou will receive partial sentences. Do not complete the sentence, just read out the text.x   )	alloyashcoralechofableonyxnovasageshimmerc                      \ rS rSr% SrSrS\S'    SrS\S'    \R                  r
S	\S
'    SrS\S'    SrS\S'    \" 5       rS\S'    SrS\S'   Srg)TTSModelSettings   zSettings for a TTS model.NzTTSVoice | Nonevoicer   intbuffer_sizeznpt.DTypeLikedtypezYCallable[[npt.NDArray[np.int16 | np.float32]], npt.NDArray[np.int16 | np.float32]] | Nonetransform_datazXYou will receive partial sentences. Do not complete the sentence just read out the text.strinstructionsz Callable[[str], tuple[str, str]]text_splitterfloat | Nonespeed )__name__
__module____qualname____firstlineno____doc__r   __annotations__r   r
   int16r   r    r"   r   r#   r%   __static_attributes__r&       d/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/agents/voice/model.pyr   r      s    #!E?!
 KS88E=#= 	 a 	c # 
 7R6SM3S E<Vr/   r   c                  r    \ rS rSrSr\\R                  SS j5       5       r\R                  SS j5       r	Sr
g)	TTSModel@   z?A text-to-speech model that can convert text into audio output.c                    g)zThe name of the TTS model.Nr&   selfs    r0   
model_nameTTSModel.model_nameC        	r/   c                    g)zGiven a text string, produces a stream of audio bytes, in PCM format.

Args:
    text: The text to convert to audio.

Returns:
    An async iterator of audio bytes, in PCM format.
Nr&   )r6   textsettingss      r0   runTTSModel.runI        	r/   r&   Nreturnr!   )r;   r!   r<   r   rA   zAsyncIterator[bytes])r'   r(   r)   r*   r+   propertyabcabstractmethodr7   r=   r.   r&   r/   r0   r2   r2   @   s?    I   		 	r/   r2   c                  h    \ rS rSrSr\R                  SS j5       r\R                  SS j5       rSr	g)	StreamedTranscriptionSessionV   z(A streamed transcription of audio input.c                    g)zYields a stream of text transcriptions. Each transcription is a turn in the conversation.

This method is expected to return only after `close()` is called.
Nr&   r5   s    r0   transcribe_turns-StreamedTranscriptionSession.transcribe_turnsY   s     	r/   c                   #    g7f)zCloses the session.Nr&   r5   s    r0   close"StreamedTranscriptionSession.closea   s
      	   r&   N)rA   zAsyncIterator[str])rA   None)
r'   r(   r)   r*   r+   rC   rD   rI   rL   r.   r&   r/   r0   rF   rF   V   s7    2  	 r/   rF   c                  X    \ rS rSr% SrSrS\S'    SrS\S'    SrS\S'    Sr	S	\S
'   Sr
g)STTModelSettingsg   z$Settings for a speech-to-text model.N
str | Nonepromptlanguager$   temperaturezdict[str, Any] | Noneturn_detectionr&   )r'   r(   r)   r*   r+   rT   r,   rU   rV   rW   r.   r&   r/   r0   rQ   rQ   g   s:    .FJ/Hj* $K$',0N)0Tr/   rQ   c                      \ rS rSrSr\\R                  SS j5       5       r\R                            S	S j5       r	\R                            S
S j5       r
Srg)STTModelr   z>A speech-to-text model that can convert audio input into text.c                    g)zThe name of the STT model.Nr&   r5   s    r0   r7   STTModel.model_name{   r9   r/   c                   #    g7f)a  Given an audio input, produces a text transcription.

Args:
    input: The audio input to transcribe.
    settings: The settings to use for the transcription.
    trace_include_sensitive_data: Whether to include sensitive data in traces.
    trace_include_sensitive_audio_data: Whether to include sensitive audio data in traces.

Returns:
    The text transcription of the audio input.
Nr&   r6   inputr<   trace_include_sensitive_data"trace_include_sensitive_audio_datas        r0   
transcribeSTTModel.transcribe   s
     & 	rN   c                   #    g7f)a  Creates a new transcription session, which you can push audio to, and receive a stream
of text transcriptions.

Args:
    input: The audio input to transcribe.
    settings: The settings to use for the transcription.
    trace_include_sensitive_data: Whether to include sensitive data in traces.
    trace_include_sensitive_audio_data: Whether to include sensitive audio data in traces.

Returns:
    A new transcription session.
Nr&   r]   s        r0   create_sessionSTTModel.create_session   s
     ( 	rN   r&   Nr@   )
r^   r   r<   rQ   r_   boolr`   rf   rA   r!   )
r^   r   r<   rQ   r_   rf   r`   rf   rA   rF   )r'   r(   r)   r*   r+   rB   rC   rD   r7   ra   rd   r.   r&   r/   r0   rY   rY   x   s    H   	 # '+	
 -1 
 ( 	! # '+	
 -1 
& r/   rY   c                  h    \ rS rSrSr\R                  SS j5       r\R                  SS j5       rSr	g)	VoiceModelProvider   zThe base interface for a voice model provider.

A model provider is responsible for creating speech-to-text and text-to-speech models, given a
name.
c                    g)zGet a speech-to-text model by name.

Args:
    model_name: The name of the model to get.

Returns:
    The speech-to-text model.
Nr&   r6   r7   s     r0   get_stt_model VoiceModelProvider.get_stt_model   r?   r/   c                    g)z#Get a text-to-speech model by name.Nr&   rk   s     r0   get_tts_model VoiceModelProvider.get_tts_model   s    r/   r&   N)r7   rS   rA   rY   )r7   rS   rA   r2   )
r'   r(   r)   r*   r+   rC   rD   rl   ro   r.   r&   r/   r0   rh   rh      s;     		 	 	2 2r/   rh   )
__future__r   rC   collections.abcr   r   dataclassesr   typingr   r   importsr
   r   r^   r   r   utilsr   DEFAULT_TTS_INSTRUCTIONSDEFAULT_TTS_BUFFER_SIZETTSVoicer   ABCr2   rF   rQ   rY   rh   r&   r/   r0   <module>r{      s    " 
 3 !   1 . `   ^_ 9 'W 'W 'WTsww ,377 " U U U 2sww 2j2 2r/   