File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 33.pytest_cache /
44jigsawstack.egg-info /
55
6+ __pycache__ /
7+ /.pytest_cache /
8+ /.vscode /
9+ /.idea /
10+
11+
12+ * .ipynb_checkpoints /
13+ * .ipynb
14+
615.env
716build /
817dist /
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def perform(self) -> Union[T, None]:
5656
5757 # this is a safety net, if we get here it means the JigsawStack API is having issues
5858 # and most likely the gateway is returning htmls
59- if "application/json" not in resp .headers ["content-type" ]:
59+ if "application/json" not in resp .headers ["content-type" ] and "audio/wav" not in resp . headers [ "content-type" ] :
6060 raise_for_code_and_type (
6161 code = 500 ,
6262 message = "Failed to parse JigsawStack API response. Please try again." ,
@@ -72,6 +72,9 @@ def perform(self) -> Union[T, None]:
7272 err = error .get ("error" ),
7373 )
7474
75+ if "audio/wav" in resp .headers ["content-type" ]:
76+ return cast (T , resp ) # we return the response object, instead of the json
77+
7578 return cast (T , resp .json ())
7679
7780 def perform_file (self ) -> Union [T , None ]:
You can’t perform that action at this time.
0 commit comments