spitch 1.6.0__py3-none-any.whl → 1.8.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 +43 -37
- spitch/resources/text.py +95 -1
- spitch/types/__init__.py +2 -1
- spitch/types/speech_generate_params.py +3 -1
- spitch/types/speech_transcribe_params.py +22 -0
- spitch/types/text_translate_params.py +15 -0
- {spitch-1.6.0.dist-info → spitch-1.8.0.dist-info}/METADATA +1 -8
- {spitch-1.6.0.dist-info → spitch-1.8.0.dist-info}/RECORD +11 -9
- {spitch-1.6.0.dist-info → spitch-1.8.0.dist-info}/WHEEL +0 -0
- {spitch-1.6.0.dist-info → spitch-1.8.0.dist-info}/licenses/LICENSE +0 -0
spitch/_version.py
CHANGED
spitch/resources/speech.py
CHANGED
|
@@ -7,7 +7,7 @@ from typing_extensions import Literal
|
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
|
-
from ..types import speech_generate_params,
|
|
10
|
+
from ..types import speech_generate_params, speech_transcribe_params
|
|
11
11
|
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
|
|
12
12
|
from .._utils import (
|
|
13
13
|
extract_files,
|
|
@@ -18,18 +18,10 @@ 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,
|
|
25
21
|
to_raw_response_wrapper,
|
|
26
22
|
to_streamed_response_wrapper,
|
|
27
23
|
async_to_raw_response_wrapper,
|
|
28
|
-
to_custom_raw_response_wrapper,
|
|
29
24
|
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,
|
|
33
25
|
)
|
|
34
26
|
from .._base_client import make_request_options
|
|
35
27
|
|
|
@@ -61,14 +53,15 @@ class SpeechResource(SyncAPIResource):
|
|
|
61
53
|
*,
|
|
62
54
|
language: Literal["yo", "en", "ha", "ig"],
|
|
63
55
|
text: str,
|
|
64
|
-
|
|
56
|
+
stream: bool | NotGiven = NOT_GIVEN,
|
|
57
|
+
voice: Literal["sade", "segun", "femi", "funmi"] | NotGiven = NOT_GIVEN,
|
|
65
58
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
66
59
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
67
60
|
extra_headers: Headers | None = None,
|
|
68
61
|
extra_query: Query | None = None,
|
|
69
62
|
extra_body: Body | None = None,
|
|
70
63
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
71
|
-
) ->
|
|
64
|
+
) -> object:
|
|
72
65
|
"""
|
|
73
66
|
Synthesize
|
|
74
67
|
|
|
@@ -81,7 +74,6 @@ class SpeechResource(SyncAPIResource):
|
|
|
81
74
|
|
|
82
75
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
83
76
|
"""
|
|
84
|
-
extra_headers = {"Accept": "audio/wav", **(extra_headers or {})}
|
|
85
77
|
return self._post(
|
|
86
78
|
"/v1/speech",
|
|
87
79
|
body=maybe_transform(
|
|
@@ -93,16 +85,22 @@ class SpeechResource(SyncAPIResource):
|
|
|
93
85
|
speech_generate_params.SpeechGenerateParams,
|
|
94
86
|
),
|
|
95
87
|
options=make_request_options(
|
|
96
|
-
extra_headers=extra_headers,
|
|
88
|
+
extra_headers=extra_headers,
|
|
89
|
+
extra_query=extra_query,
|
|
90
|
+
extra_body=extra_body,
|
|
91
|
+
timeout=timeout,
|
|
92
|
+
query=maybe_transform({"stream": stream}, speech_generate_params.SpeechGenerateParams),
|
|
97
93
|
),
|
|
98
|
-
cast_to=
|
|
94
|
+
cast_to=object,
|
|
99
95
|
)
|
|
100
96
|
|
|
101
|
-
def
|
|
97
|
+
def transcribe(
|
|
102
98
|
self,
|
|
103
99
|
*,
|
|
104
100
|
language: Literal["yo", "en", "ha", "ig"],
|
|
105
101
|
content: Optional[FileTypes] | NotGiven = NOT_GIVEN,
|
|
102
|
+
multispeaker: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
103
|
+
timestamp: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
106
104
|
url: Optional[str] | NotGiven = NOT_GIVEN,
|
|
107
105
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
108
106
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -127,6 +125,8 @@ class SpeechResource(SyncAPIResource):
|
|
|
127
125
|
{
|
|
128
126
|
"language": language,
|
|
129
127
|
"content": content,
|
|
128
|
+
"multispeaker": multispeaker,
|
|
129
|
+
"timestamp": timestamp,
|
|
130
130
|
"url": url,
|
|
131
131
|
}
|
|
132
132
|
)
|
|
@@ -137,7 +137,7 @@ class SpeechResource(SyncAPIResource):
|
|
|
137
137
|
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
138
138
|
return self._post(
|
|
139
139
|
"/v1/transcriptions",
|
|
140
|
-
body=maybe_transform(body,
|
|
140
|
+
body=maybe_transform(body, speech_transcribe_params.SpeechTranscribeParams),
|
|
141
141
|
files=files,
|
|
142
142
|
options=make_request_options(
|
|
143
143
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -171,14 +171,15 @@ class AsyncSpeechResource(AsyncAPIResource):
|
|
|
171
171
|
*,
|
|
172
172
|
language: Literal["yo", "en", "ha", "ig"],
|
|
173
173
|
text: str,
|
|
174
|
-
|
|
174
|
+
stream: bool | NotGiven = NOT_GIVEN,
|
|
175
|
+
voice: Literal["sade", "segun", "femi", "funmi"] | NotGiven = NOT_GIVEN,
|
|
175
176
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
176
177
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
177
178
|
extra_headers: Headers | None = None,
|
|
178
179
|
extra_query: Query | None = None,
|
|
179
180
|
extra_body: Body | None = None,
|
|
180
181
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
181
|
-
) ->
|
|
182
|
+
) -> object:
|
|
182
183
|
"""
|
|
183
184
|
Synthesize
|
|
184
185
|
|
|
@@ -191,7 +192,6 @@ class AsyncSpeechResource(AsyncAPIResource):
|
|
|
191
192
|
|
|
192
193
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
193
194
|
"""
|
|
194
|
-
extra_headers = {"Accept": "audio/wav", **(extra_headers or {})}
|
|
195
195
|
return await self._post(
|
|
196
196
|
"/v1/speech",
|
|
197
197
|
body=await async_maybe_transform(
|
|
@@ -203,16 +203,22 @@ class AsyncSpeechResource(AsyncAPIResource):
|
|
|
203
203
|
speech_generate_params.SpeechGenerateParams,
|
|
204
204
|
),
|
|
205
205
|
options=make_request_options(
|
|
206
|
-
extra_headers=extra_headers,
|
|
206
|
+
extra_headers=extra_headers,
|
|
207
|
+
extra_query=extra_query,
|
|
208
|
+
extra_body=extra_body,
|
|
209
|
+
timeout=timeout,
|
|
210
|
+
query=await async_maybe_transform({"stream": stream}, speech_generate_params.SpeechGenerateParams),
|
|
207
211
|
),
|
|
208
|
-
cast_to=
|
|
212
|
+
cast_to=object,
|
|
209
213
|
)
|
|
210
214
|
|
|
211
|
-
async def
|
|
215
|
+
async def transcribe(
|
|
212
216
|
self,
|
|
213
217
|
*,
|
|
214
218
|
language: Literal["yo", "en", "ha", "ig"],
|
|
215
219
|
content: Optional[FileTypes] | NotGiven = NOT_GIVEN,
|
|
220
|
+
multispeaker: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
221
|
+
timestamp: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
216
222
|
url: Optional[str] | NotGiven = NOT_GIVEN,
|
|
217
223
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
218
224
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -237,6 +243,8 @@ class AsyncSpeechResource(AsyncAPIResource):
|
|
|
237
243
|
{
|
|
238
244
|
"language": language,
|
|
239
245
|
"content": content,
|
|
246
|
+
"multispeaker": multispeaker,
|
|
247
|
+
"timestamp": timestamp,
|
|
240
248
|
"url": url,
|
|
241
249
|
}
|
|
242
250
|
)
|
|
@@ -247,7 +255,7 @@ class AsyncSpeechResource(AsyncAPIResource):
|
|
|
247
255
|
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
248
256
|
return await self._post(
|
|
249
257
|
"/v1/transcriptions",
|
|
250
|
-
body=await async_maybe_transform(body,
|
|
258
|
+
body=await async_maybe_transform(body, speech_transcribe_params.SpeechTranscribeParams),
|
|
251
259
|
files=files,
|
|
252
260
|
options=make_request_options(
|
|
253
261
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -260,12 +268,11 @@ class SpeechResourceWithRawResponse:
|
|
|
260
268
|
def __init__(self, speech: SpeechResource) -> None:
|
|
261
269
|
self._speech = speech
|
|
262
270
|
|
|
263
|
-
self.generate =
|
|
271
|
+
self.generate = to_raw_response_wrapper(
|
|
264
272
|
speech.generate,
|
|
265
|
-
BinaryAPIResponse,
|
|
266
273
|
)
|
|
267
|
-
self.
|
|
268
|
-
speech.
|
|
274
|
+
self.transcribe = to_raw_response_wrapper(
|
|
275
|
+
speech.transcribe,
|
|
269
276
|
)
|
|
270
277
|
|
|
271
278
|
|
|
@@ -273,12 +280,11 @@ class AsyncSpeechResourceWithRawResponse:
|
|
|
273
280
|
def __init__(self, speech: AsyncSpeechResource) -> None:
|
|
274
281
|
self._speech = speech
|
|
275
282
|
|
|
276
|
-
self.generate =
|
|
283
|
+
self.generate = async_to_raw_response_wrapper(
|
|
277
284
|
speech.generate,
|
|
278
|
-
AsyncBinaryAPIResponse,
|
|
279
285
|
)
|
|
280
|
-
self.
|
|
281
|
-
speech.
|
|
286
|
+
self.transcribe = async_to_raw_response_wrapper(
|
|
287
|
+
speech.transcribe,
|
|
282
288
|
)
|
|
283
289
|
|
|
284
290
|
|
|
@@ -286,12 +292,12 @@ class SpeechResourceWithStreamingResponse:
|
|
|
286
292
|
def __init__(self, speech: SpeechResource) -> None:
|
|
287
293
|
self._speech = speech
|
|
288
294
|
|
|
289
|
-
self.generate =
|
|
295
|
+
self.generate = to_streamed_response_wrapper(
|
|
290
296
|
speech.generate,
|
|
291
297
|
StreamedBinaryAPIResponse
|
|
292
298
|
)
|
|
293
|
-
self.
|
|
294
|
-
speech.
|
|
299
|
+
self.transcribe = to_streamed_response_wrapper(
|
|
300
|
+
speech.transcribe,
|
|
295
301
|
)
|
|
296
302
|
|
|
297
303
|
|
|
@@ -299,10 +305,10 @@ class AsyncSpeechResourceWithStreamingResponse:
|
|
|
299
305
|
def __init__(self, speech: AsyncSpeechResource) -> None:
|
|
300
306
|
self._speech = speech
|
|
301
307
|
|
|
302
|
-
self.generate =
|
|
308
|
+
self.generate = async_to_streamed_response_wrapper(
|
|
303
309
|
speech.generate,
|
|
304
310
|
AsyncStreamedBinaryAPIResponse
|
|
305
311
|
)
|
|
306
|
-
self.
|
|
307
|
-
speech.
|
|
312
|
+
self.transcribe = async_to_streamed_response_wrapper(
|
|
313
|
+
speech.transcribe,
|
|
308
314
|
)
|
spitch/resources/text.py
CHANGED
|
@@ -6,7 +6,7 @@ from typing_extensions import Literal
|
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
|
-
from ..types import text_tone_mark_params
|
|
9
|
+
from ..types import text_tone_mark_params, text_translate_params
|
|
10
10
|
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
11
|
from .._utils import (
|
|
12
12
|
maybe_transform,
|
|
@@ -84,6 +84,47 @@ class TextResource(SyncAPIResource):
|
|
|
84
84
|
cast_to=object,
|
|
85
85
|
)
|
|
86
86
|
|
|
87
|
+
def translate(
|
|
88
|
+
self,
|
|
89
|
+
*,
|
|
90
|
+
source: Literal["yo", "en", "ha", "ig"],
|
|
91
|
+
target: Literal["yo", "en", "ha", "ig"],
|
|
92
|
+
text: str,
|
|
93
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
94
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
95
|
+
extra_headers: Headers | None = None,
|
|
96
|
+
extra_query: Query | None = None,
|
|
97
|
+
extra_body: Body | None = None,
|
|
98
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
99
|
+
) -> object:
|
|
100
|
+
"""
|
|
101
|
+
Translate
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
extra_headers: Send extra headers
|
|
105
|
+
|
|
106
|
+
extra_query: Add additional query parameters to the request
|
|
107
|
+
|
|
108
|
+
extra_body: Add additional JSON properties to the request
|
|
109
|
+
|
|
110
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
111
|
+
"""
|
|
112
|
+
return self._post(
|
|
113
|
+
"/v1/translate",
|
|
114
|
+
body=maybe_transform(
|
|
115
|
+
{
|
|
116
|
+
"source": source,
|
|
117
|
+
"target": target,
|
|
118
|
+
"text": text,
|
|
119
|
+
},
|
|
120
|
+
text_translate_params.TextTranslateParams,
|
|
121
|
+
),
|
|
122
|
+
options=make_request_options(
|
|
123
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
124
|
+
),
|
|
125
|
+
cast_to=object,
|
|
126
|
+
)
|
|
127
|
+
|
|
87
128
|
|
|
88
129
|
class AsyncTextResource(AsyncAPIResource):
|
|
89
130
|
@cached_property
|
|
@@ -144,6 +185,47 @@ class AsyncTextResource(AsyncAPIResource):
|
|
|
144
185
|
cast_to=object,
|
|
145
186
|
)
|
|
146
187
|
|
|
188
|
+
async def translate(
|
|
189
|
+
self,
|
|
190
|
+
*,
|
|
191
|
+
source: Literal["yo", "en", "ha", "ig"],
|
|
192
|
+
target: Literal["yo", "en", "ha", "ig"],
|
|
193
|
+
text: str,
|
|
194
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
195
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
196
|
+
extra_headers: Headers | None = None,
|
|
197
|
+
extra_query: Query | None = None,
|
|
198
|
+
extra_body: Body | None = None,
|
|
199
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
200
|
+
) -> object:
|
|
201
|
+
"""
|
|
202
|
+
Translate
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
extra_headers: Send extra headers
|
|
206
|
+
|
|
207
|
+
extra_query: Add additional query parameters to the request
|
|
208
|
+
|
|
209
|
+
extra_body: Add additional JSON properties to the request
|
|
210
|
+
|
|
211
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
212
|
+
"""
|
|
213
|
+
return await self._post(
|
|
214
|
+
"/v1/translate",
|
|
215
|
+
body=await async_maybe_transform(
|
|
216
|
+
{
|
|
217
|
+
"source": source,
|
|
218
|
+
"target": target,
|
|
219
|
+
"text": text,
|
|
220
|
+
},
|
|
221
|
+
text_translate_params.TextTranslateParams,
|
|
222
|
+
),
|
|
223
|
+
options=make_request_options(
|
|
224
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
225
|
+
),
|
|
226
|
+
cast_to=object,
|
|
227
|
+
)
|
|
228
|
+
|
|
147
229
|
|
|
148
230
|
class TextResourceWithRawResponse:
|
|
149
231
|
def __init__(self, text: TextResource) -> None:
|
|
@@ -152,6 +234,9 @@ class TextResourceWithRawResponse:
|
|
|
152
234
|
self.tone_mark = to_raw_response_wrapper(
|
|
153
235
|
text.tone_mark,
|
|
154
236
|
)
|
|
237
|
+
self.translate = to_raw_response_wrapper(
|
|
238
|
+
text.translate,
|
|
239
|
+
)
|
|
155
240
|
|
|
156
241
|
|
|
157
242
|
class AsyncTextResourceWithRawResponse:
|
|
@@ -161,6 +246,9 @@ class AsyncTextResourceWithRawResponse:
|
|
|
161
246
|
self.tone_mark = async_to_raw_response_wrapper(
|
|
162
247
|
text.tone_mark,
|
|
163
248
|
)
|
|
249
|
+
self.translate = async_to_raw_response_wrapper(
|
|
250
|
+
text.translate,
|
|
251
|
+
)
|
|
164
252
|
|
|
165
253
|
|
|
166
254
|
class TextResourceWithStreamingResponse:
|
|
@@ -170,6 +258,9 @@ class TextResourceWithStreamingResponse:
|
|
|
170
258
|
self.tone_mark = to_streamed_response_wrapper(
|
|
171
259
|
text.tone_mark,
|
|
172
260
|
)
|
|
261
|
+
self.translate = to_streamed_response_wrapper(
|
|
262
|
+
text.translate,
|
|
263
|
+
)
|
|
173
264
|
|
|
174
265
|
|
|
175
266
|
class AsyncTextResourceWithStreamingResponse:
|
|
@@ -179,3 +270,6 @@ class AsyncTextResourceWithStreamingResponse:
|
|
|
179
270
|
self.tone_mark = async_to_streamed_response_wrapper(
|
|
180
271
|
text.tone_mark,
|
|
181
272
|
)
|
|
273
|
+
self.translate = async_to_streamed_response_wrapper(
|
|
274
|
+
text.translate,
|
|
275
|
+
)
|
spitch/types/__init__.py
CHANGED
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from .text_tone_mark_params import TextToneMarkParams as TextToneMarkParams
|
|
6
|
+
from .text_translate_params import TextTranslateParams as TextTranslateParams
|
|
6
7
|
from .speech_generate_params import SpeechGenerateParams as SpeechGenerateParams
|
|
7
|
-
from .
|
|
8
|
+
from .speech_transcribe_params import SpeechTranscribeParams as SpeechTranscribeParams
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import FileTypes
|
|
9
|
+
|
|
10
|
+
__all__ = ["SpeechTranscribeParams"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class SpeechTranscribeParams(TypedDict, total=False):
|
|
14
|
+
language: Required[Literal["yo", "en", "ha", "ig"]]
|
|
15
|
+
|
|
16
|
+
content: Optional[FileTypes]
|
|
17
|
+
|
|
18
|
+
multispeaker: Optional[bool]
|
|
19
|
+
|
|
20
|
+
timestamp: Optional[bool]
|
|
21
|
+
|
|
22
|
+
url: Optional[str]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["TextTranslateParams"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class TextTranslateParams(TypedDict, total=False):
|
|
11
|
+
source: Required[Literal["yo", "en", "ha", "ig"]]
|
|
12
|
+
|
|
13
|
+
target: Required[Literal["yo", "en", "ha", "ig"]]
|
|
14
|
+
|
|
15
|
+
text: Required[str]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: spitch
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.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
|
|
@@ -69,7 +69,6 @@ client = Spitch(
|
|
|
69
69
|
response = client.speech.generate(
|
|
70
70
|
language="yo",
|
|
71
71
|
text="text",
|
|
72
|
-
voice="sade",
|
|
73
72
|
)
|
|
74
73
|
```
|
|
75
74
|
|
|
@@ -97,7 +96,6 @@ async def main() -> None:
|
|
|
97
96
|
response = await client.speech.generate(
|
|
98
97
|
language="yo",
|
|
99
98
|
text="text",
|
|
100
|
-
voice="sade",
|
|
101
99
|
)
|
|
102
100
|
|
|
103
101
|
|
|
@@ -134,7 +132,6 @@ try:
|
|
|
134
132
|
client.speech.generate(
|
|
135
133
|
language="yo",
|
|
136
134
|
text="text",
|
|
137
|
-
voice="sade",
|
|
138
135
|
)
|
|
139
136
|
except spitch.APIConnectionError as e:
|
|
140
137
|
print("The server could not be reached")
|
|
@@ -181,7 +178,6 @@ client = Spitch(
|
|
|
181
178
|
client.with_options(max_retries=5).speech.generate(
|
|
182
179
|
language="yo",
|
|
183
180
|
text="text",
|
|
184
|
-
voice="sade",
|
|
185
181
|
)
|
|
186
182
|
```
|
|
187
183
|
|
|
@@ -208,7 +204,6 @@ client = Spitch(
|
|
|
208
204
|
client.with_options(timeout=5.0).speech.generate(
|
|
209
205
|
language="yo",
|
|
210
206
|
text="text",
|
|
211
|
-
voice="sade",
|
|
212
207
|
)
|
|
213
208
|
```
|
|
214
209
|
|
|
@@ -251,7 +246,6 @@ client = Spitch()
|
|
|
251
246
|
response = client.speech.with_raw_response.generate(
|
|
252
247
|
language="yo",
|
|
253
248
|
text="text",
|
|
254
|
-
voice="sade",
|
|
255
249
|
)
|
|
256
250
|
print(response.headers.get('X-My-Header'))
|
|
257
251
|
|
|
@@ -273,7 +267,6 @@ To stream the response body, use `.with_streaming_response` instead, which requi
|
|
|
273
267
|
with client.speech.with_streaming_response.generate(
|
|
274
268
|
language="yo",
|
|
275
269
|
text="text",
|
|
276
|
-
voice="sade",
|
|
277
270
|
) as response:
|
|
278
271
|
print(response.headers.get("X-My-Header"))
|
|
279
272
|
|
|
@@ -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=R29WJBWYsaWAwTwK8XkBeW8F5mSDP4tYN7BojEsoZYg,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,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=
|
|
28
|
-
spitch/resources/text.py,sha256=
|
|
29
|
-
spitch/types/__init__.py,sha256=
|
|
30
|
-
spitch/types/speech_generate_params.py,sha256=
|
|
27
|
+
spitch/resources/speech.py,sha256=ZJffI2clNAZM7qMZfRGJsI3dOWhZzUciK4pVrfLG26s,11642
|
|
28
|
+
spitch/resources/text.py,sha256=qLvjdBZh1fBYkREWp5DCfIsuv7pvy3Kp209dU_D6QRY,9418
|
|
29
|
+
spitch/types/__init__.py,sha256=OwK9sWPMHvjfiRJk3URsxojngIiZ6dVZktL4Vi84QHk,445
|
|
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=2nUgsYIURWTKx8qBYE0WfIHh6hXVcdgCz-UC1wIaXpA,515
|
|
32
33
|
spitch/types/text_tone_mark_params.py,sha256=63P5VElxanYkDP1ZLEuQt97JSgVpMCaAo4WRWLDvhlY,349
|
|
33
|
-
spitch
|
|
34
|
-
spitch-1.
|
|
35
|
-
spitch-1.
|
|
36
|
-
spitch-1.
|
|
34
|
+
spitch/types/text_translate_params.py,sha256=rU5hbTyBaP5L_akmgswHoNLcTKWN0Gz1kL1yt3EQL44,404
|
|
35
|
+
spitch-1.8.0.dist-info/METADATA,sha256=yADpZ54uaSPLPUPZFK9MOrkcONLfefdm85yUfiVLNxo,12511
|
|
36
|
+
spitch-1.8.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
37
|
+
spitch-1.8.0.dist-info/licenses/LICENSE,sha256=529F8Amq5MfoIm33JY544oweKES9vw9_xS1CNx-ztPI,11336
|
|
38
|
+
spitch-1.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|