File size: 282 Bytes
873d0cf
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
try:
    from ...llm import *
except ImportError:
    from llm import *


def tts_openai(voice, text_chunk, location):
    response = get_client().audio.speech.create(
        model="tts-1",
        voice=voice,
        input=text_chunk,
    )
    response.stream_to_file(location)