
    iT                        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	ed
      Zdd	 	 	 	 	 	 	 ddZy)    )annotations)Literal	TypedDict)Unpack)	AudioData)
SetupError)OpenAICompatibleRecognizer)whisper-large-v3-turbozwhisper-large-v3c                  :    e Zd ZU dZded<   ded<   ded<   ded<   y)	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__     m/var/www/auto_recruiter/arenv/lib/python3.12/site-packages/speech_recognition/recognizers/whisper_api/groq.pyr   r      s    
 KMr   r   F)totalr
   )modelc                   	 ddl }t        |j	                               } |j
                  ||fi |S # t        $ r t        d      w xY w)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)
recognizer
audio_datar   kwargsr   groq_recognizers         r   r!   r!      sW    
 1=O$?$$ZA&AA  
H
 	

s	   3 AN)r#   z'AudioData'r   	GroqModelr$   zUnpack[GroqOptionalParameters]returnr   )
__future__r   typingr   r   typing_extensionsr   speech_recognition.audior   speech_recognition.exceptionsr   /speech_recognition.recognizers.whisper_api.baser	   r&   r   r!   r   r   r   <module>r.      sk    " % $ . 4
 0	
	Ye 	  0	BB 	B
 -B 	Br   