o
    iT                     @  s|   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d
dZdddddZdS )    )annotations)Literal	TypedDict)Unpack)	AudioData)
SetupError)OpenAICompatibleRecognizer)whisper-large-v3-turbozwhisper-large-v3c                   @  s2   e Zd ZU dZded< ded< ded< ded< dS )	GroqOptionalParameterszzGroq speech transcription's optional parameters.

    https://console.groq.com/docs/api-reference#audio-transcription
    strpromptresponse_formatfloattemperaturelanguageN)__name__
__module____qualname____doc____annotations__ r   r   b/home/kuhnn/.local/lib/python3.10/site-packages/speech_recognition/recognizers/whisper_api/groq.pyr
      s   
 r
   F)totalr	   )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-to-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   Groq	recognize)
recognizerr   r   r   r    groq_recognizerr   r   r   r#      s   r#   N)r   r   r   r   r   r   r   r   )
__future__r   typingr   r   typing_extensionsr   speech_recognition.audior   speech_recognition.exceptionsr   /speech_recognition.recognizers.whisper_api.baser   r   r
   r#   r   r   r   r   <module>   s    