mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-16 09:31:37 +00:00
fix(tools): add raise_for_status for MiniMax t2a_v2 TTS path
The MiniMax t2a_v2 code path calls response.json() without first checking the HTTP status code. If the API returns HTTP 4xx/5xx with non-JSON content (e.g. HTML error page), response.json() raises an opaque JSONDecodeError instead of a clear HTTPError. The non-t2a_v2 path already has response.raise_for_status() at line 1299. Add the same check before response.json() in the t2a_v2 path for consistent error handling.
This commit is contained in:
parent
dd4ba4c2c4
commit
4cca7f569d
1 changed files with 1 additions and 0 deletions
|
|
@ -1261,6 +1261,7 @@ def _generate_minimax_tts(text: str, output_path: str, tts_config: Dict[str, Any
|
|||
|
||||
if is_t2a_v2:
|
||||
# t2a_v2 returns JSON with hex-encoded audio
|
||||
response.raise_for_status()
|
||||
result = response.json()
|
||||
base_resp = result.get("base_resp", {})
|
||||
status_code = base_resp.get("status_code", -1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue