spitch 1.9.0__py3-none-any.whl → 1.11.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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "spitch"
4
- __version__ = "1.9.0" # x-release-please-version
4
+ __version__ = "1.11.0" # x-release-please-version
@@ -18,10 +18,18 @@ 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,
23
+ StreamedBinaryAPIResponse,
24
+ AsyncStreamedBinaryAPIResponse,
21
25
  to_raw_response_wrapper,
22
26
  to_streamed_response_wrapper,
23
27
  async_to_raw_response_wrapper,
28
+ to_custom_raw_response_wrapper,
24
29
  async_to_streamed_response_wrapper,
30
+ to_custom_streamed_response_wrapper,
31
+ async_to_custom_raw_response_wrapper,
32
+ async_to_custom_streamed_response_wrapper,
25
33
  )
26
34
  from .._base_client import make_request_options
27
35
 
@@ -61,7 +69,7 @@ class SpeechResource(SyncAPIResource):
61
69
  extra_query: Query | None = None,
62
70
  extra_body: Body | None = None,
63
71
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
64
- ) -> object:
72
+ ) -> BinaryAPIResponse:
65
73
  """
66
74
  Synthesize
67
75
 
@@ -74,6 +82,7 @@ class SpeechResource(SyncAPIResource):
74
82
 
75
83
  timeout: Override the client-level default timeout for this request, in seconds
76
84
  """
85
+ extra_headers = {"Accept": "audio/wav", **(extra_headers or {})}
77
86
  return self._post(
78
87
  "/v1/speech",
79
88
  body=maybe_transform(
@@ -91,7 +100,7 @@ class SpeechResource(SyncAPIResource):
91
100
  timeout=timeout,
92
101
  query=maybe_transform({"stream": stream}, speech_generate_params.SpeechGenerateParams),
93
102
  ),
94
- cast_to=object,
103
+ cast_to=BinaryAPIResponse,
95
104
  )
96
105
 
97
106
  def transcribe(
@@ -99,6 +108,8 @@ class SpeechResource(SyncAPIResource):
99
108
  *,
100
109
  language: Literal["yo", "en", "ha", "ig"],
101
110
  content: Optional[FileTypes] | NotGiven = NOT_GIVEN,
111
+ multispeaker: Optional[bool] | NotGiven = NOT_GIVEN,
112
+ timestamp: Optional[bool] | NotGiven = NOT_GIVEN,
102
113
  url: Optional[str] | NotGiven = NOT_GIVEN,
103
114
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
104
115
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -123,6 +134,8 @@ class SpeechResource(SyncAPIResource):
123
134
  {
124
135
  "language": language,
125
136
  "content": content,
137
+ "multispeaker": multispeaker,
138
+ "timestamp": timestamp,
126
139
  "url": url,
127
140
  }
128
141
  )
@@ -175,7 +188,7 @@ class AsyncSpeechResource(AsyncAPIResource):
175
188
  extra_query: Query | None = None,
176
189
  extra_body: Body | None = None,
177
190
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
178
- ) -> object:
191
+ ) -> AsyncBinaryAPIResponse:
179
192
  """
180
193
  Synthesize
181
194
 
@@ -188,6 +201,7 @@ class AsyncSpeechResource(AsyncAPIResource):
188
201
 
189
202
  timeout: Override the client-level default timeout for this request, in seconds
190
203
  """
204
+ extra_headers = {"Accept": "audio/wav", **(extra_headers or {})}
191
205
  return await self._post(
192
206
  "/v1/speech",
193
207
  body=await async_maybe_transform(
@@ -205,7 +219,7 @@ class AsyncSpeechResource(AsyncAPIResource):
205
219
  timeout=timeout,
206
220
  query=await async_maybe_transform({"stream": stream}, speech_generate_params.SpeechGenerateParams),
207
221
  ),
208
- cast_to=object,
222
+ cast_to=AsyncBinaryAPIResponse,
209
223
  )
210
224
 
211
225
  async def transcribe(
@@ -213,6 +227,8 @@ class AsyncSpeechResource(AsyncAPIResource):
213
227
  *,
214
228
  language: Literal["yo", "en", "ha", "ig"],
215
229
  content: Optional[FileTypes] | NotGiven = NOT_GIVEN,
230
+ multispeaker: Optional[bool] | NotGiven = NOT_GIVEN,
231
+ timestamp: Optional[bool] | NotGiven = NOT_GIVEN,
216
232
  url: Optional[str] | NotGiven = NOT_GIVEN,
217
233
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
218
234
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -237,6 +253,8 @@ class AsyncSpeechResource(AsyncAPIResource):
237
253
  {
238
254
  "language": language,
239
255
  "content": content,
256
+ "multispeaker": multispeaker,
257
+ "timestamp": timestamp,
240
258
  "url": url,
241
259
  }
242
260
  )
@@ -260,8 +278,9 @@ class SpeechResourceWithRawResponse:
260
278
  def __init__(self, speech: SpeechResource) -> None:
261
279
  self._speech = speech
262
280
 
263
- self.generate = to_raw_response_wrapper(
281
+ self.generate = to_custom_raw_response_wrapper(
264
282
  speech.generate,
283
+ BinaryAPIResponse,
265
284
  )
266
285
  self.transcribe = to_raw_response_wrapper(
267
286
  speech.transcribe,
@@ -272,8 +291,9 @@ class AsyncSpeechResourceWithRawResponse:
272
291
  def __init__(self, speech: AsyncSpeechResource) -> None:
273
292
  self._speech = speech
274
293
 
275
- self.generate = async_to_raw_response_wrapper(
294
+ self.generate = async_to_custom_raw_response_wrapper(
276
295
  speech.generate,
296
+ AsyncBinaryAPIResponse,
277
297
  )
278
298
  self.transcribe = async_to_raw_response_wrapper(
279
299
  speech.transcribe,
@@ -284,7 +304,7 @@ class SpeechResourceWithStreamingResponse:
284
304
  def __init__(self, speech: SpeechResource) -> None:
285
305
  self._speech = speech
286
306
 
287
- self.generate = to_streamed_response_wrapper(
307
+ self.generate = to_custom_streamed_response_wrapper(
288
308
  speech.generate,
289
309
  StreamedBinaryAPIResponse
290
310
  )
@@ -297,7 +317,7 @@ class AsyncSpeechResourceWithStreamingResponse:
297
317
  def __init__(self, speech: AsyncSpeechResource) -> None:
298
318
  self._speech = speech
299
319
 
300
- self.generate = async_to_streamed_response_wrapper(
320
+ self.generate = async_to_custom_streamed_response_wrapper(
301
321
  speech.generate,
302
322
  AsyncStreamedBinaryAPIResponse
303
323
  )
@@ -15,4 +15,8 @@ class SpeechTranscribeParams(TypedDict, total=False):
15
15
 
16
16
  content: Optional[FileTypes]
17
17
 
18
+ multispeaker: Optional[bool]
19
+
20
+ timestamp: Optional[bool]
21
+
18
22
  url: Optional[str]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: spitch
3
- Version: 1.9.0
3
+ Version: 1.11.0
4
4
  Summary: The official Python library for the spitch API
5
5
  Project-URL: Homepage, https://github.com/spi-tch/spitch-python
6
6
  Project-URL: Repository, https://github.com/spi-tch/spitch-python
@@ -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=EKcbWA9qeb0pohGt6XHLagbrKG7DUh3qW1G1Nfc9IiQ,158
14
+ spitch/_version.py,sha256=MOSvd0FXjANtKSR_0-PxX8FJIZOGHpIPM0mCE663Two,159
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,15 +24,15 @@ 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=reyeW_kABdUiJdB95F481VlRO5Tks7YUQ4mDclsLToA,11232
27
+ spitch/resources/speech.py,sha256=qSqtKuxDXRO9QVG-BJ9nhOxJhUG5uXJ8Dkw50xi16Jw,12221
28
28
  spitch/resources/text.py,sha256=qLvjdBZh1fBYkREWp5DCfIsuv7pvy3Kp209dU_D6QRY,9418
29
29
  spitch/types/__init__.py,sha256=OwK9sWPMHvjfiRJk3URsxojngIiZ6dVZktL4Vi84QHk,445
30
30
  spitch/types/speech_generate_params.py,sha256=kNVcFxcIcImiLa8r4OEbzeIOqZNtkbSUek99t2ljhaI,425
31
31
  spitch/types/speech_transcibe_params.py,sha256=WvwBsSctqJDXOFJNYyjfijwCnAdJCPkJobESfmLy3aI,448
32
- spitch/types/speech_transcribe_params.py,sha256=FEG512EPDTm2WbDHefbn8tiSbnIqF8ZnFjc4rYekMRY,450
32
+ spitch/types/speech_transcribe_params.py,sha256=2nUgsYIURWTKx8qBYE0WfIHh6hXVcdgCz-UC1wIaXpA,515
33
33
  spitch/types/text_tone_mark_params.py,sha256=63P5VElxanYkDP1ZLEuQt97JSgVpMCaAo4WRWLDvhlY,349
34
34
  spitch/types/text_translate_params.py,sha256=rU5hbTyBaP5L_akmgswHoNLcTKWN0Gz1kL1yt3EQL44,404
35
- spitch-1.9.0.dist-info/METADATA,sha256=gZq2MAPE2y4ydBaWNtj5pdbBsgk_kP6LL3nwKSPfcVw,12511
36
- spitch-1.9.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
37
- spitch-1.9.0.dist-info/licenses/LICENSE,sha256=529F8Amq5MfoIm33JY544oweKES9vw9_xS1CNx-ztPI,11336
38
- spitch-1.9.0.dist-info/RECORD,,
35
+ spitch-1.11.0.dist-info/METADATA,sha256=q2gw4LvDdS1kS7RvdM5v2RASdye7rnCmV6rfFQm--3I,12512
36
+ spitch-1.11.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
37
+ spitch-1.11.0.dist-info/licenses/LICENSE,sha256=529F8Amq5MfoIm33JY544oweKES9vw9_xS1CNx-ztPI,11336
38
+ spitch-1.11.0.dist-info/RECORD,,