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 3
3
.pytest_cache /
4
4
jigsawstack.egg-info /
5
5
6
+ __pycache__ /
7
+ /.pytest_cache /
8
+ /.vscode /
9
+ /.idea /
10
+
11
+
12
+ * .ipynb_checkpoints /
13
+ * .ipynb
14
+
6
15
.env
7
16
build /
8
17
dist /
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def perform(self) -> Union[T, None]:
56
56
57
57
# this is a safety net, if we get here it means the JigsawStack API is having issues
58
58
# 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" ] :
60
60
raise_for_code_and_type (
61
61
code = 500 ,
62
62
message = "Failed to parse JigsawStack API response. Please try again." ,
@@ -72,6 +72,9 @@ def perform(self) -> Union[T, None]:
72
72
err = error .get ("error" ),
73
73
)
74
74
75
+ if "audio/wav" in resp .headers ["content-type" ]:
76
+ return cast (T , resp ) # we return the response object, instead of the json
77
+
75
78
return cast (T , resp .json ())
76
79
77
80
def perform_file (self ) -> Union [T , None ]:
You can’t perform that action at this time.
0 commit comments