o
    dZhf                     @  sx   d dl mZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ ed ZG dd	 d	eZd
ddddZdS )    )annotations)Literal	TypedDict)Unpack)	AudioData)
SetupError)OpenAICompatibleRecognizer)whisper-large-v3-turbozwhisper-large-v3zdistil-whisper-large-v3-enc                   @  s2   e Zd ZU dZded< ded< ded< ded< dS )	GroqOptionalParameterszGroq speech transcription's optional parameters.

    https://console.groq.com/docs/speech-text#transcription-endpoint-usage
    strpromptZresponse_formatfloatZtemperaturelanguageN)__name__
__module____qualname____doc____annotations__ r   r   ^/var/www/auris/lib/python3.10/site-packages/speech_recognition/recognizers/whisper_api/groq.pyr
      s   
 r
   r	   )model
audio_data'AudioData'r   	GroqModelkwargsUnpack[GroqOptionalParameters]returnr   c                K  sD   zddl }W n ty   tdw t| }|j||fi |S )a  Performs speech recognition on ``audio_data`` (an ``AudioData`` instance), using the Groq Whisper API.

    This function requires login to Groq; visit https://console.groq.com/login, then generate API Key in `API Keys <https://console.groq.com/keys>`__ menu.

    Detail: https://console.groq.com/docs/speech-text

    Set environment variable ``GROQ_API_KEY``; otherwise groq library will raise a ``groq.GroqError``.
    r   Nz:missing groq module: ensure that groq is set up correctly.)groqImportErrorr   r   ZGroq	recognize)Z
recognizerr   r   r   r   Zgroq_recognizerr   r   r   r      s   r   N)r   r   r   r   r   r   r   r   )
__future__r   typingr   r   Ztyping_extensionsr   Zspeech_recognition.audior   Zspeech_recognition.exceptionsr   Z/speech_recognition.recognizers.whisper_api.baser   r   r
   r   r   r   r   r   <module>   s    