§
    .çhB  ã                  óx  — d dl mZ d dlZd dlmZ d dlmZ d dlmZm	Z	m
Z
 ddlmZmZ ddlmZmZ dd	lmZ d
ZdZe
d         Z	 e G d„ d¦  «        ¦   «         Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Ze G d„ d¦  «        ¦   «         Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        ZdS )é    )ÚannotationsN)ÚAsyncIterator)Ú	dataclass)ÚAnyÚCallableÚ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                  óœ   — e Zd ZU dZdZded<   	 dZded<   	 ej        Z	ded	<   	 dZ
d
ed<   	 dZded<   	  e¦   «         Zded<   	 dZded<   dS )ÚTTSModelSettingsz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__Ú__doc__r   Ú__annotations__r   r
   Úint16r   r   r!   r   r"   r$   © ó    úO/var/www/FlaskApp/flask-venv/lib/python3.11/site-packages/agents/voice/model.pyr   r      sÖ   € € € € € € à#Ð#Ø!€EÐ!Ð!Ð!Ñ!ðð
 €KÐÐÐÑØSàœ8€EÐ#Ð#Ð#Ñ#Ø=ð 	ð ð ð ð ñ ðð 	cð ð ð ð ñ ðð
 7RÐ6QÑ6SÔ6S€MÐSÐSÐSÑSðð €EÐÐÐÑØVÐVr,   r   c                  óf   — e Zd ZdZeej        dd„¦   «         ¦   «         Zej        dd	„¦   «         Zd
S )ÚTTSModelz?A text-to-speech model that can convert text into audio output.Úreturnr    c                ó   — dS )zThe name of the TTS model.Nr+   ©Úselfs    r-   Ú
model_namezTTSModel.model_nameA   ó	   € ð 	ˆr,   ÚtextÚsettingsr   úAsyncIterator[bytes]c                ó   — dS )zÜGiven 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+   )r3   r6   r7   s      r-   ÚrunzTTSModel.runG   ó	   € ð 	ˆr,   N©r0   r    )r6   r    r7   r   r0   r8   )	r%   r&   r'   r(   ÚpropertyÚabcÚabstractmethodr4   r:   r+   r,   r-   r/   r/   >   sj   € € € € € ØIÐIàØÔðð ð ñ Ôñ „Xðð 	Ôð	ð 	ð 	ñ Ôð	ð 	ð 	r,   r/   c                  óV   — e Zd ZdZej        dd„¦   «         Zej        d	d„¦   «         ZdS )
ÚStreamedTranscriptionSessionz(A streamed transcription of audio input.r0   úAsyncIterator[str]c                ó   — dS )z­Yields 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+   r2   s    r-   Útranscribe_turnsz-StreamedTranscriptionSession.transcribe_turnsW   s	   € ð 	ˆr,   ÚNonec              ƒ  ó
   K  — dS )zCloses the session.Nr+   r2   s    r-   Úclosez"StreamedTranscriptionSession.close_   s   è è € ð 	ˆr,   N)r0   rB   )r0   rE   )r%   r&   r'   r(   r>   r?   rD   rG   r+   r,   r-   rA   rA   T   s`   € € € € € Ø2Ð2àÔðð ð ñ Ôðð 	Ôðð ð ñ Ôðð ð r,   rA   c                  óR   — e Zd ZU dZdZded<   	 dZded<   	 dZded<   	 dZded	<   dS )
ÚSTTModelSettingsz$Settings for a speech-to-text model.Nú
str | NoneÚpromptÚlanguager#   Útemperaturezdict[str, Any] | NoneÚturn_detection)	r%   r&   r'   r(   rK   r)   rL   rM   rN   r+   r,   r-   rI   rI   e   se   € € € € € € à.Ð.à€FÐÐÐÑØ/à€HÐÐÐÑØ*à $€KÐ$Ð$Ð$Ñ$Ø'à,0€NÐ0Ð0Ð0Ñ0ØTÐTr,   rI   c                  óˆ   — e Zd ZdZeej        dd„¦   «         ¦   «         Zej        dd„¦   «         Zej        dd„¦   «         Z	dS )ÚSTTModelz>A speech-to-text model that can convert audio input into text.r0   r    c                ó   — dS )zThe name of the STT model.Nr+   r2   s    r-   r4   zSTTModel.model_namey   r5   r,   Úinputr   r7   rI   Útrace_include_sensitive_dataÚboolÚ"trace_include_sensitive_audio_datac              ƒ  ó
   K  — dS )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+   ©r3   rR   r7   rS   rU   s        r-   Ú
transcribezSTTModel.transcribe   s   è è € ð& 	ˆr,   r   rA   c              ƒ  ó
   K  — dS )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+   rW   s        r-   Úcreate_sessionzSTTModel.create_session”   s   è è € ð( 	ˆr,   Nr<   )
rR   r   r7   rI   rS   rT   rU   rT   r0   r    )
rR   r   r7   rI   rS   rT   rU   rT   r0   rA   )
r%   r&   r'   r(   r=   r>   r?   r4   rX   rZ   r+   r,   r-   rP   rP   v   sŽ   € € € € € ØHÐHàØÔðð ð ñ Ôñ „Xðð 	Ôðð ð ñ Ôðð( 	Ôðð ð ñ Ôðð ð r,   rP   c                  óV   — e Zd ZdZej        d
d„¦   «         Zej        dd„¦   «         Zd	S )ÚVoiceModelProviderz¡The 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.
    r4   rJ   r0   rP   c                ó   — dS )z©Get a speech-to-text model by name.

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

        Returns:
            The speech-to-text model.
        Nr+   ©r3   r4   s     r-   Úget_stt_modelz VoiceModelProvider.get_stt_model²   r;   r,   r/   c                ó   — dS )z#Get a text-to-speech model by name.Nr+   r^   s     r-   Úget_tts_modelz VoiceModelProvider.get_tts_model¾   s   € € € r,   N)r4   rJ   r0   rP   )r4   rJ   r0   r/   )r%   r&   r'   r(   r>   r?   r_   ra   r+   r,   r-   r\   r\   «   sf   € € € € € ðð ð 	Ôð	ð 	ð 	ñ Ôð	ð 	Ôð2ð 2ð 2ñ Ôð2ð 2ð 2r,   r\   )Ú
__future__r   r>   Úcollections.abcr   Údataclassesr   Útypingr   r   r   Úimportsr
   r   rR   r   r   Úutilsr   ÚDEFAULT_TTS_INSTRUCTIONSÚDEFAULT_TTS_BUFFER_SIZEÚTTSVoicer   ÚABCr/   rA   rI   rP   r\   r+   r,   r-   ú<module>rl      s÷  ðØ "Ð "Ð "Ð "Ð "Ð "à 
€
€
€
Ø )Ð )Ð )Ð )Ð )Ð )Ø !Ð !Ð !Ð !Ð !Ð !Ø )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ð )à Ð Ð Ð Ð Ð Ð Ð Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø .Ð .Ð .Ð .Ð .Ð .ð `ð ð Ð àÐ^Ô_€Ø 9à
ð&Wð &Wð &Wð &Wð &Wñ &Wô &Wñ „ð&WðRð ð ð ð ˆsŒwñ ô ð ð,ð ð ð ð  3¤7ñ ô ð ð" ðUð Uð Uð Uð Uñ Uô Uñ „ðUð 2ð 2ð 2ð 2ð 2ˆsŒwñ 2ô 2ð 2ðj2ð 2ð 2ð 2ð 2˜œñ 2ô 2ð 2ð 2ð 2r,   