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

@ -42,6 +42,18 @@ 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)