mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix linting
This commit is contained in:
parent
82c3357454
commit
755a0514f6
2 changed files with 14 additions and 2 deletions
|
@ -54,7 +54,7 @@ class VertexTextToSpeechAPI(VertexLLM):
|
||||||
timeout: Union[float, httpx.Timeout],
|
timeout: Union[float, httpx.Timeout],
|
||||||
model: str,
|
model: str,
|
||||||
input: str,
|
input: str,
|
||||||
voice: str,
|
voice: Optional[str] = None,
|
||||||
_is_async: Optional[bool] = False,
|
_is_async: Optional[bool] = False,
|
||||||
optional_params: Optional[dict] = None,
|
optional_params: Optional[dict] = None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
|
|
|
@ -4699,7 +4699,7 @@ async def aspeech(*args, **kwargs) -> HttpxBinaryResponseContent:
|
||||||
def speech(
|
def speech(
|
||||||
model: str,
|
model: str,
|
||||||
input: str,
|
input: str,
|
||||||
voice: str,
|
voice: Optional[str] = None,
|
||||||
api_key: Optional[str] = None,
|
api_key: Optional[str] = None,
|
||||||
api_base: Optional[str] = None,
|
api_base: Optional[str] = None,
|
||||||
api_version: Optional[str] = None,
|
api_version: Optional[str] = None,
|
||||||
|
@ -4735,6 +4735,12 @@ def speech(
|
||||||
logging_obj = kwargs.get("litellm_logging_obj", None)
|
logging_obj = kwargs.get("litellm_logging_obj", None)
|
||||||
response: Optional[HttpxBinaryResponseContent] = None
|
response: Optional[HttpxBinaryResponseContent] = None
|
||||||
if custom_llm_provider == "openai":
|
if custom_llm_provider == "openai":
|
||||||
|
if voice is None:
|
||||||
|
raise litellm.BadRequestError(
|
||||||
|
message="'voice' is required for OpenAI TTS",
|
||||||
|
model=model,
|
||||||
|
llm_provider=custom_llm_provider,
|
||||||
|
)
|
||||||
api_base = (
|
api_base = (
|
||||||
api_base # for deepinfra/perplexity/anyscale/groq/friendliai we check in get_llm_provider and pass in the api base from there
|
api_base # for deepinfra/perplexity/anyscale/groq/friendliai we check in get_llm_provider and pass in the api base from there
|
||||||
or litellm.api_base
|
or litellm.api_base
|
||||||
|
@ -4781,6 +4787,12 @@ def speech(
|
||||||
)
|
)
|
||||||
elif custom_llm_provider == "azure":
|
elif custom_llm_provider == "azure":
|
||||||
# azure configs
|
# azure configs
|
||||||
|
if voice is None:
|
||||||
|
raise litellm.BadRequestError(
|
||||||
|
message="'voice' is required for Azure TTS",
|
||||||
|
model=model,
|
||||||
|
llm_provider=custom_llm_provider,
|
||||||
|
)
|
||||||
api_base = api_base or litellm.api_base or get_secret("AZURE_API_BASE") # type: ignore
|
api_base = api_base or litellm.api_base or get_secret("AZURE_API_BASE") # type: ignore
|
||||||
|
|
||||||
api_version = (
|
api_version = (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue