Skip to content

Commit b3a737d

Browse files
authored
Merge pull request #20 from JigsawStack/check
Specify File content type
2 parents 73b72fb + 94db608 commit b3a737d

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

jigsawstack/audio.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,12 @@ def text_to_speech(self, params: TextToSpeechParams) -> TextToSpeechResponse:
4848
api_url=self.api_url,
4949
path=path, params=cast(Dict[Any, Any], params), verb="post"
5050
).perform_with_content()
51+
return resp
52+
def speaker_voice_accents(self) -> TextToSpeechResponse:
53+
path = "/ai/tts"
54+
resp = Request(
55+
api_key=self.api_key,
56+
api_url=self.api_url,
57+
path=path, params={}, verb="get"
58+
).perform_with_content()
5159
return resp

jigsawstack/store.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class KVAddResponse(TypedDict):
2929
class FileUploadParams(TypedDict):
3030
overwrite:bool
3131
filename:str
32-
headers: Dict[str, str]
32+
content_type: NotRequired[str]
3333

3434

3535

@@ -42,11 +42,11 @@ def upload(self, file: bytes, options=FileUploadParams) -> Any:
4242
"overwrite":overwrite
4343
}
4444
path =f"/store/file?overwrite={overwrite}&key={filename}"
45-
headers = options.get("headers")
45+
content_type = options.get("content_type")
4646
_headers = {"Content-Type":"application/octet-stream"}
47-
if headers:
48-
_headers.update(headers)
49-
47+
if content_type is not None:
48+
_headers = {"Content-Type":content_type}
49+
5050
resp = Request(
5151
api_key=self.api_key,
5252
api_url=self.api_url,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="jigsawstack",
9-
version="0.1.13",
9+
version="0.1.14",
1010
description="JigsawStack Python SDK",
1111
long_description=open("README.md", encoding="utf8").read(),
1212
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)