add:openai text to speech

This commit is contained in:
zhanglei 2024-01-15 14:11:41 +08:00
parent b603e19bda
commit cc92d8fb4a
2 changed files with 16 additions and 0 deletions

View file

@ -235,3 +235,7 @@ class OpenAILLM(BaseLLM):
async def amoderation(self, content: Union[str, list[str]]):
"""Moderate content."""
return await self.aclient.moderations.create(input=content)
async def atext_to_speech(self, **kwargs):
"""text to speech"""
return await self.aclient.audio.speech.create(**kwargs)