mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
simpify ssml usage
This commit is contained in:
parent
58506dbade
commit
5ea27bdea9
1 changed files with 9 additions and 3 deletions
|
@ -258,6 +258,13 @@ async def test_speech_litellm_vertex_async_with_voice_ssml():
|
||||||
mock_response.json = return_val
|
mock_response.json = return_val
|
||||||
mock_response.status_code = 200
|
mock_response.status_code = 200
|
||||||
|
|
||||||
|
ssml = """
|
||||||
|
<speak>
|
||||||
|
<p>Hello, world!</p>
|
||||||
|
<p>This is a test of the <break strength="medium" /> text-to-speech API.</p>
|
||||||
|
</speak>
|
||||||
|
"""
|
||||||
|
|
||||||
# Set up the mock for asynchronous calls
|
# Set up the mock for asynchronous calls
|
||||||
with patch(
|
with patch(
|
||||||
"litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler.post",
|
"litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler.post",
|
||||||
|
@ -267,9 +274,8 @@ async def test_speech_litellm_vertex_async_with_voice_ssml():
|
||||||
model = "vertex_ai/test"
|
model = "vertex_ai/test"
|
||||||
|
|
||||||
response = await litellm.aspeech(
|
response = await litellm.aspeech(
|
||||||
input=None,
|
input=ssml,
|
||||||
model=model,
|
model=model,
|
||||||
ssml="async hello what llm guardrail do you have",
|
|
||||||
voice={
|
voice={
|
||||||
"languageCode": "en-UK",
|
"languageCode": "en-UK",
|
||||||
"name": "en-UK-Studio-O",
|
"name": "en-UK-Studio-O",
|
||||||
|
@ -291,7 +297,7 @@ async def test_speech_litellm_vertex_async_with_voice_ssml():
|
||||||
assert kwargs["headers"]["Authorization"] is not None
|
assert kwargs["headers"]["Authorization"] is not None
|
||||||
|
|
||||||
assert kwargs["json"] == {
|
assert kwargs["json"] == {
|
||||||
"input": {"ssml": "async hello what llm guardrail do you have"},
|
"input": {"ssml": ssml},
|
||||||
"voice": {"languageCode": "en-UK", "name": "en-UK-Studio-O"},
|
"voice": {"languageCode": "en-UK", "name": "en-UK-Studio-O"},
|
||||||
"audioConfig": {"audioEncoding": "LINEAR22", "speakingRate": "10"},
|
"audioConfig": {"audioEncoding": "LINEAR22", "speakingRate": "10"},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue