Spaces:
Configuration error
Configuration error
| from rtc.openai_stt import OpenAISTTModel | |
| from rtc.openai_tts import OpenAITTSModel | |
| from rtc.rtc_call import RTCHandler | |
| from config.constant import OPENAI_API_KEY | |
| stt_model = OpenAISTTModel( | |
| api_key=OPENAI_API_KEY, | |
| model="whisper-1", | |
| language="en", # Set to your preferred language | |
| response_format="text") | |
| tts_model = OpenAITTSModel( | |
| api_key=OPENAI_API_KEY, | |
| model="tts-1", # Use "tts-1-hd" for higher quality | |
| voice="alloy", # Choose: alloy, echo, fable, onyx, nova, shimmer | |
| response_format="mp3", | |
| speed=1.0) | |
| def handle_rtc(): | |
| rtc_call = RTCHandler(stt_model, tts_model) | |
| rtc_call.start_stream() |