{"record":{"id":"6f28f2e59ad8d4e6","repo":"BerriAI/litellm","slug":"either-text-or-ssml-must-be-provided","errorCode":null,"errorMessage":"Either 'text' or 'ssml' must be provided.","messagePattern":"Either 'text' or 'ssml' must be provided\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/text_to_speech/text_to_speech_handler.py","lineNumber":232,"sourceCode":"\n    # Check if use_ssml is set\n    use_ssml: Final = kwargs.get(\"use_ssml\", optional_params.get(\"use_ssml\", False))\n\n    if use_ssml:\n        if \"text\" in input_data:\n            input_data[\"ssml\"] = input_data.pop(\"text\")\n        elif \"ssml\" not in input_data:\n            raise ValueError(\"SSML input is required when use_ssml is True.\")\n    else:\n        # LiteLLM will auto-detect if text is in ssml format\n        # check if \"text\" is an ssml - in this case we should pass it as ssml instead of text\n        if input_data:\n            _text: Final = input_data.get(\"text\", None) or \"\"\n            if \"<speak>\" in _text:\n                input_data[\"ssml\"] = input_data.pop(\"text\")\n\n    if not input_data:\n        raise ValueError(\"Either 'text' or 'ssml' must be provided.\")\n    if \"text\" in input_data and \"ssml\" in input_data:\n        raise ValueError(\"Only one of 'text' or 'ssml' should be provided, not both.\")\n","sourceCodeStart":214,"sourceCodeEnd":235,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/text_to_speech/text_to_speech_handler.py#L214-L235","documentation":"Raised by validate_vertex_input when the input dict passed to the Vertex TTS handler is empty after None-stripping: neither 'text' nor 'ssml' survived, so there is no content to synthesize. It is the non-SSML path counterpart to the SSML error — use_ssml is False (or unset), LiteLLM would auto-detect SSML-formatted text, but there is simply no payload to send to the API.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/text_to_speech/text_to_speech_handler.py:232 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide exactly one of 'text' or 'ssml' in the speech synthesis request.","For plain text pass input={'text': ...}; for markup pass input={'ssml': ...} with use_ssml=True."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}