TTSConfig autogen.beta.live.openai.TTSConfig # TTSConfig(model, *, client=None, voice='alloy', speed=omit) Bases: TTSConfig[bytes] Source code in autogen/beta/live/openai.py 187 188 189 190 191 192 193 194 195 196 197 198 199def __init__( self, model: "SpeechModel | str", *, client: AsyncOpenAI | None = None, voice: Voice = "alloy", speed: float | Omit = omit, ) -> None: self._client = client or AsyncOpenAI() self._model = model self._voice = voice self._speed = speed synthesize async # synthesize(text) Source code in autogen/beta/live/openai.py 201 202 203 204 205 206 207 208 209async def synthesize(self, text: str) -> bytes: response = await self._client.audio.speech.create( model=self._model, voice=self._voice, input=text, speed=self._speed, response_format="pcm", ) return await response.aread()