spitch 1.2.0__py3-none-any.whl → 1.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of spitch might be problematic. Click here for more details.
- spitch/_version.py +1 -1
- spitch/resources/speech.py +14 -6
- {spitch-1.2.0.dist-info → spitch-1.3.0.dist-info}/METADATA +1 -1
- {spitch-1.2.0.dist-info → spitch-1.3.0.dist-info}/RECORD +6 -6
- {spitch-1.2.0.dist-info → spitch-1.3.0.dist-info}/WHEEL +0 -0
- {spitch-1.2.0.dist-info → spitch-1.3.0.dist-info}/licenses/LICENSE +0 -0
spitch/_version.py
CHANGED
spitch/resources/speech.py
CHANGED
|
@@ -18,13 +18,17 @@ from .._utils import (
|
|
|
18
18
|
from .._compat import cached_property
|
|
19
19
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
20
20
|
from .._response import (
|
|
21
|
+
BinaryAPIResponse,
|
|
22
|
+
AsyncBinaryAPIResponse,
|
|
21
23
|
StreamedBinaryAPIResponse,
|
|
22
24
|
AsyncStreamedBinaryAPIResponse,
|
|
23
25
|
to_raw_response_wrapper,
|
|
24
26
|
to_streamed_response_wrapper,
|
|
25
27
|
async_to_raw_response_wrapper,
|
|
28
|
+
to_custom_raw_response_wrapper,
|
|
26
29
|
async_to_streamed_response_wrapper,
|
|
27
30
|
to_custom_streamed_response_wrapper,
|
|
31
|
+
async_to_custom_raw_response_wrapper,
|
|
28
32
|
async_to_custom_streamed_response_wrapper,
|
|
29
33
|
)
|
|
30
34
|
from .._base_client import make_request_options
|
|
@@ -65,7 +69,7 @@ class SpeechResource(SyncAPIResource):
|
|
|
65
69
|
extra_query: Query | None = None,
|
|
66
70
|
extra_body: Body | None = None,
|
|
67
71
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
68
|
-
) ->
|
|
72
|
+
) -> BinaryAPIResponse:
|
|
69
73
|
"""
|
|
70
74
|
Synthesize
|
|
71
75
|
|
|
@@ -78,6 +82,7 @@ class SpeechResource(SyncAPIResource):
|
|
|
78
82
|
|
|
79
83
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
80
84
|
"""
|
|
85
|
+
extra_headers = {"Accept": "audio/wav", **(extra_headers or {})}
|
|
81
86
|
return self._post(
|
|
82
87
|
"/v1/speech",
|
|
83
88
|
body=maybe_transform(
|
|
@@ -95,7 +100,7 @@ class SpeechResource(SyncAPIResource):
|
|
|
95
100
|
timeout=timeout,
|
|
96
101
|
query=maybe_transform({"stream": stream}, speech_generate_params.SpeechGenerateParams),
|
|
97
102
|
),
|
|
98
|
-
cast_to=
|
|
103
|
+
cast_to=BinaryAPIResponse,
|
|
99
104
|
)
|
|
100
105
|
|
|
101
106
|
def transcibe(
|
|
@@ -179,7 +184,7 @@ class AsyncSpeechResource(AsyncAPIResource):
|
|
|
179
184
|
extra_query: Query | None = None,
|
|
180
185
|
extra_body: Body | None = None,
|
|
181
186
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
182
|
-
) ->
|
|
187
|
+
) -> AsyncBinaryAPIResponse:
|
|
183
188
|
"""
|
|
184
189
|
Synthesize
|
|
185
190
|
|
|
@@ -192,6 +197,7 @@ class AsyncSpeechResource(AsyncAPIResource):
|
|
|
192
197
|
|
|
193
198
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
194
199
|
"""
|
|
200
|
+
extra_headers = {"Accept": "audio/wav", **(extra_headers or {})}
|
|
195
201
|
return await self._post(
|
|
196
202
|
"/v1/speech",
|
|
197
203
|
body=await async_maybe_transform(
|
|
@@ -209,7 +215,7 @@ class AsyncSpeechResource(AsyncAPIResource):
|
|
|
209
215
|
timeout=timeout,
|
|
210
216
|
query=await async_maybe_transform({"stream": stream}, speech_generate_params.SpeechGenerateParams),
|
|
211
217
|
),
|
|
212
|
-
cast_to=
|
|
218
|
+
cast_to=AsyncBinaryAPIResponse,
|
|
213
219
|
)
|
|
214
220
|
|
|
215
221
|
async def transcibe(
|
|
@@ -264,8 +270,9 @@ class SpeechResourceWithRawResponse:
|
|
|
264
270
|
def __init__(self, speech: SpeechResource) -> None:
|
|
265
271
|
self._speech = speech
|
|
266
272
|
|
|
267
|
-
self.generate =
|
|
273
|
+
self.generate = to_custom_raw_response_wrapper(
|
|
268
274
|
speech.generate,
|
|
275
|
+
BinaryAPIResponse,
|
|
269
276
|
)
|
|
270
277
|
self.transcibe = to_raw_response_wrapper(
|
|
271
278
|
speech.transcibe,
|
|
@@ -276,8 +283,9 @@ class AsyncSpeechResourceWithRawResponse:
|
|
|
276
283
|
def __init__(self, speech: AsyncSpeechResource) -> None:
|
|
277
284
|
self._speech = speech
|
|
278
285
|
|
|
279
|
-
self.generate =
|
|
286
|
+
self.generate = async_to_custom_raw_response_wrapper(
|
|
280
287
|
speech.generate,
|
|
288
|
+
AsyncBinaryAPIResponse,
|
|
281
289
|
)
|
|
282
290
|
self.transcibe = async_to_raw_response_wrapper(
|
|
283
291
|
speech.transcibe,
|
|
@@ -11,7 +11,7 @@ spitch/_resource.py,sha256=TLFPcOOmtxZOQLh3XCNPB_BdrQpp0MIYoKoH52aRAu8,1100
|
|
|
11
11
|
spitch/_response.py,sha256=aN6swtguiZ7CC_hWFrwoUa53FgSbjRfZXxYHvfDNGeo,28609
|
|
12
12
|
spitch/_streaming.py,sha256=5SpId2EIfF8Ee8UUYmJxqgHUGP1ZdHCUHhHCdNJREFA,10100
|
|
13
13
|
spitch/_types.py,sha256=dsJyGWdBXaYJaRBqn2V3iRsfpWw71rFaSxdSM8sPQYY,6103
|
|
14
|
-
spitch/_version.py,sha256=
|
|
14
|
+
spitch/_version.py,sha256=c0W0bfKHpBgInBQqGRHV7Ym_2RrKIQWtr3c-ugNMSag,158
|
|
15
15
|
spitch/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
spitch/_utils/__init__.py,sha256=Uzq1-FIih_VUjzdNVWXks0sdC39KBKLMrZoz-_JOjJ4,1988
|
|
17
17
|
spitch/_utils/_logs.py,sha256=ApRyYK_WgZfEr_ygBUBXWMlTgeMr2tdNOGlH8jE4oJc,774
|
|
@@ -24,13 +24,13 @@ spitch/_utils/_typing.py,sha256=tFbktdpdHCQliwzGsWysgn0P5H0JRdagkZdb_LegGkY,3838
|
|
|
24
24
|
spitch/_utils/_utils.py,sha256=tYrr7IX-5NMwsVKbNggbzOM84uNw7XnAe06e2Ln8Or0,11472
|
|
25
25
|
spitch/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
|
26
26
|
spitch/resources/__init__.py,sha256=KT6rAvIlWHQk9QdM4Jp8ABziKILaBrrtiO7LCB5Wa5E,976
|
|
27
|
-
spitch/resources/speech.py,sha256=
|
|
27
|
+
spitch/resources/speech.py,sha256=lqwdVc-ZBbARtfgwUamr-FKNrBz9lU45wYPvlygdhPs,11796
|
|
28
28
|
spitch/resources/text.py,sha256=xy7N1q5ioXVMtmcW6iOE8j8n9j4lvnpvO4jJ9FMZmsU,6071
|
|
29
29
|
spitch/types/__init__.py,sha256=4aa9CgcCmGRqZb4k9F3005Q4Ok-zjiiqw5k3BXIQ3MY,364
|
|
30
30
|
spitch/types/speech_generate_params.py,sha256=kNVcFxcIcImiLa8r4OEbzeIOqZNtkbSUek99t2ljhaI,425
|
|
31
31
|
spitch/types/speech_transcibe_params.py,sha256=WvwBsSctqJDXOFJNYyjfijwCnAdJCPkJobESfmLy3aI,448
|
|
32
32
|
spitch/types/text_tone_mark_params.py,sha256=63P5VElxanYkDP1ZLEuQt97JSgVpMCaAo4WRWLDvhlY,349
|
|
33
|
-
spitch-1.
|
|
34
|
-
spitch-1.
|
|
35
|
-
spitch-1.
|
|
36
|
-
spitch-1.
|
|
33
|
+
spitch-1.3.0.dist-info/METADATA,sha256=AznC_yeZzXHQ0CIbPoMRfgxquNdP3DUeDL8iI3IQUFY,12392
|
|
34
|
+
spitch-1.3.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
35
|
+
spitch-1.3.0.dist-info/licenses/LICENSE,sha256=529F8Amq5MfoIm33JY544oweKES9vw9_xS1CNx-ztPI,11336
|
|
36
|
+
spitch-1.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|