Closed aMediocreDad closed 2 months ago
Actually you don't even need a boolean @aMediocreDad - we can detect if it's ssml
if it contains <speak>
import openai
client = openai.OpenAI(api_key="sk-1234", base_url="http://0.0.0.0:4000")
ssml = """
<speak>
<p>Hello, world!</p>
<p>This is a test of the <break strength="medium" /> text-to-speech API.</p>
</speak>
"""
# see supported values for "voice" on vertex here:
# https://console.cloud.google.com/vertex-ai/generative/speech/text-to-speech
response = client.audio.speech.create(
model = "vertex-tts",
input=ssml, # pass as None since OpenAI SDK requires this param
voice={'languageCode': 'en-US', 'name': 'en-US-Studio-O'},
)
print("response from proxy", response)
We also do support the boolean use_ssml
if you want to force it to use ssml
Thank you 🫶 That's a great solution! Looking forward to removing the need for the tts client:D
@aMediocreDad thanks for using LiteLLM, can we hop on a call sometime this week / next ? Hoping to learn how we can improve litellm for you
My cal for your convenience https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version?month=2023-10 My linkedin if you prefer DM: https://www.linkedin.com/in/reffajnaahsi/
Hi @aMediocreDad, curious do you use LiteLLM Proxy in production today If so, I'd love to hop on a call and learn how we can improve LiteLLM for you
The Feature
Implementation of Google Text-to-Speech is missing support for ssml.
The Google text synthesis API, accepts
ssml
ORtext
asinput
: https://cloud.google.com/text-to-speech/docs/reference/rest/v1/SynthesisInputMotivation, pitch
I am happy to see this being added https://github.com/BerriAI/litellm/pull/5346. However, it is still not usable to me as I am using ssml and the implementation assumes that
input
istext
.I am not sure how this could best be implemented to adhere to the OpenAI API, however. Maybe a boolean as extra_body?
Twitter / LinkedIn details
No response