Merge pull request #756 from Justin-ZL/dev

add:openai text to speech
This commit is contained in:
geekan 2024-01-15 17:11:47 +08:00 committed by GitHub
commit 20db85bfa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 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)