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

@ -42,6 +42,17 @@ async def test_aask_code_message():
assert len(rsp["code"]) > 0
@pytest.mark.asyncio
async def test_text_to_speech():
llm = LLM()
resp = await llm.atext_to_speech(
model="tts-1",
voice="alloy",
input="人生说起来长,但知道一个岁月回头看,许多事件仅是仓促的。一段一段拼凑一起,合成了人生。苦难当头时,当下不免觉得是折磨;回头看,也不够是一段短短的人生旅程。",
)
assert 200 == resp.response.status_code
class TestOpenAI:
def test_make_client_kwargs_without_proxy(self):
instance = OpenAILLM(mock_llm_config)