diff --git a/main/xiaozhi-server/core/providers/tts/siliconflow.py b/main/xiaozhi-server/core/providers/tts/siliconflow.py index b5c618ec1..feefb9ae7 100644 --- a/main/xiaozhi-server/core/providers/tts/siliconflow.py +++ b/main/xiaozhi-server/core/providers/tts/siliconflow.py @@ -39,8 +39,13 @@ class TTSProvider(TTSProviderBase): } try: response = requests.request( - "POST", self.api_url, json=request_json, headers=headers + "POST", self.api_url, json=request_json, headers=headers, + timeout=15, ) + if response.status_code != 200: + raise Exception( + f"{__name__} HTTP {response.status_code}: {response.text[:200]}" + ) data = response.content if output_file: with open(output_file, "wb") as file_to_save: