spitch 1.11.0__tar.gz → 1.13.0__tar.gz

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.

Files changed (76) hide show
  1. spitch-1.13.0/.release-please-manifest.json +3 -0
  2. {spitch-1.11.0 → spitch-1.13.0}/CHANGELOG.md +16 -0
  3. {spitch-1.11.0 → spitch-1.13.0}/PKG-INFO +8 -1
  4. {spitch-1.11.0 → spitch-1.13.0}/README.md +7 -0
  5. {spitch-1.11.0 → spitch-1.13.0}/api.md +3 -3
  6. {spitch-1.11.0 → spitch-1.13.0}/pyproject.toml +1 -1
  7. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_version.py +1 -1
  8. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/resources/speech.py +7 -6
  9. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/resources/text.py +10 -8
  10. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/types/__init__.py +3 -0
  11. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/types/speech_generate_params.py +2 -2
  12. spitch-1.13.0/src/spitch/types/speech_transcribe_response.py +25 -0
  13. spitch-1.13.0/src/spitch/types/text_tone_mark_response.py +13 -0
  14. spitch-1.13.0/src/spitch/types/text_translate_response.py +13 -0
  15. {spitch-1.11.0 → spitch-1.13.0}/tests/api_resources/test_speech.py +17 -10
  16. {spitch-1.11.0 → spitch-1.13.0}/tests/api_resources/test_text.py +13 -12
  17. {spitch-1.11.0 → spitch-1.13.0}/tests/test_client.py +10 -10
  18. spitch-1.11.0/.release-please-manifest.json +0 -3
  19. {spitch-1.11.0 → spitch-1.13.0}/.gitignore +0 -0
  20. {spitch-1.11.0 → spitch-1.13.0}/CONTRIBUTING.md +0 -0
  21. {spitch-1.11.0 → spitch-1.13.0}/LICENSE +0 -0
  22. {spitch-1.11.0 → spitch-1.13.0}/SECURITY.md +0 -0
  23. {spitch-1.11.0 → spitch-1.13.0}/bin/check-release-environment +0 -0
  24. {spitch-1.11.0 → spitch-1.13.0}/bin/publish-pypi +0 -0
  25. {spitch-1.11.0 → spitch-1.13.0}/examples/.keep +0 -0
  26. {spitch-1.11.0 → spitch-1.13.0}/examples/example.py +0 -0
  27. {spitch-1.11.0 → spitch-1.13.0}/mypy.ini +0 -0
  28. {spitch-1.11.0 → spitch-1.13.0}/noxfile.py +0 -0
  29. {spitch-1.11.0 → spitch-1.13.0}/release-please-config.json +0 -0
  30. {spitch-1.11.0 → spitch-1.13.0}/requirements-dev.lock +0 -0
  31. {spitch-1.11.0 → spitch-1.13.0}/requirements.lock +0 -0
  32. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/__init__.py +0 -0
  33. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_base_client.py +0 -0
  34. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_client.py +0 -0
  35. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_compat.py +0 -0
  36. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_constants.py +0 -0
  37. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_exceptions.py +0 -0
  38. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_files.py +0 -0
  39. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_models.py +0 -0
  40. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_qs.py +0 -0
  41. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_resource.py +0 -0
  42. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_response.py +0 -0
  43. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_streaming.py +0 -0
  44. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_types.py +0 -0
  45. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_utils/__init__.py +0 -0
  46. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_utils/_logs.py +0 -0
  47. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_utils/_proxy.py +0 -0
  48. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_utils/_reflection.py +0 -0
  49. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_utils/_streams.py +0 -0
  50. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_utils/_sync.py +0 -0
  51. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_utils/_transform.py +0 -0
  52. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_utils/_typing.py +0 -0
  53. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/_utils/_utils.py +0 -0
  54. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/lib/.keep +0 -0
  55. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/py.typed +0 -0
  56. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/resources/__init__.py +0 -0
  57. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/types/speech_transcibe_params.py +0 -0
  58. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/types/speech_transcribe_params.py +0 -0
  59. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/types/text_tone_mark_params.py +0 -0
  60. {spitch-1.11.0 → spitch-1.13.0}/src/spitch/types/text_translate_params.py +0 -0
  61. {spitch-1.11.0 → spitch-1.13.0}/tests/__init__.py +0 -0
  62. {spitch-1.11.0 → spitch-1.13.0}/tests/api_resources/__init__.py +0 -0
  63. {spitch-1.11.0 → spitch-1.13.0}/tests/conftest.py +0 -0
  64. {spitch-1.11.0 → spitch-1.13.0}/tests/sample_file.txt +0 -0
  65. {spitch-1.11.0 → spitch-1.13.0}/tests/test_deepcopy.py +0 -0
  66. {spitch-1.11.0 → spitch-1.13.0}/tests/test_extract_files.py +0 -0
  67. {spitch-1.11.0 → spitch-1.13.0}/tests/test_files.py +0 -0
  68. {spitch-1.11.0 → spitch-1.13.0}/tests/test_models.py +0 -0
  69. {spitch-1.11.0 → spitch-1.13.0}/tests/test_qs.py +0 -0
  70. {spitch-1.11.0 → spitch-1.13.0}/tests/test_required_args.py +0 -0
  71. {spitch-1.11.0 → spitch-1.13.0}/tests/test_response.py +0 -0
  72. {spitch-1.11.0 → spitch-1.13.0}/tests/test_streaming.py +0 -0
  73. {spitch-1.11.0 → spitch-1.13.0}/tests/test_transform.py +0 -0
  74. {spitch-1.11.0 → spitch-1.13.0}/tests/test_utils/test_proxy.py +0 -0
  75. {spitch-1.11.0 → spitch-1.13.0}/tests/test_utils/test_typing.py +0 -0
  76. {spitch-1.11.0 → spitch-1.13.0}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.13.0"
3
+ }
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.13.0 (2024-10-18)
4
+
5
+ Full Changelog: [v1.12.0...v1.13.0](https://github.com/spi-tch/spitch-python/compare/v1.12.0...v1.13.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([#55](https://github.com/spi-tch/spitch-python/issues/55)) ([f987e48](https://github.com/spi-tch/spitch-python/commit/f987e48d65d4ef24a650bfc3d01757a565766c18))
10
+
11
+ ## 1.12.0 (2024-10-18)
12
+
13
+ Full Changelog: [v1.11.0...v1.12.0](https://github.com/spi-tch/spitch-python/compare/v1.11.0...v1.12.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** api update ([#52](https://github.com/spi-tch/spitch-python/issues/52)) ([1633f60](https://github.com/spi-tch/spitch-python/commit/1633f603f789c4e140ff9455fffaee21c77a5ebd))
18
+
3
19
  ## 1.11.0 (2024-10-17)
4
20
 
5
21
  Full Changelog: [v1.10.0...v1.11.0](https://github.com/spi-tch/spitch-python/compare/v1.10.0...v1.11.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: spitch
3
- Version: 1.11.0
3
+ Version: 1.13.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,6 +69,7 @@ client = Spitch(
69
69
  response = client.speech.generate(
70
70
  language="yo",
71
71
  text="text",
72
+ voice="sade",
72
73
  )
73
74
  ```
74
75
 
@@ -96,6 +97,7 @@ async def main() -> None:
96
97
  response = await client.speech.generate(
97
98
  language="yo",
98
99
  text="text",
100
+ voice="sade",
99
101
  )
100
102
 
101
103
 
@@ -132,6 +134,7 @@ try:
132
134
  client.speech.generate(
133
135
  language="yo",
134
136
  text="text",
137
+ voice="sade",
135
138
  )
136
139
  except spitch.APIConnectionError as e:
137
140
  print("The server could not be reached")
@@ -178,6 +181,7 @@ client = Spitch(
178
181
  client.with_options(max_retries=5).speech.generate(
179
182
  language="yo",
180
183
  text="text",
184
+ voice="sade",
181
185
  )
182
186
  ```
183
187
 
@@ -204,6 +208,7 @@ client = Spitch(
204
208
  client.with_options(timeout=5.0).speech.generate(
205
209
  language="yo",
206
210
  text="text",
211
+ voice="sade",
207
212
  )
208
213
  ```
209
214
 
@@ -246,6 +251,7 @@ client = Spitch()
246
251
  response = client.speech.with_raw_response.generate(
247
252
  language="yo",
248
253
  text="text",
254
+ voice="sade",
249
255
  )
250
256
  print(response.headers.get('X-My-Header'))
251
257
 
@@ -267,6 +273,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
267
273
  with client.speech.with_streaming_response.generate(
268
274
  language="yo",
269
275
  text="text",
276
+ voice="sade",
270
277
  ) as response:
271
278
  print(response.headers.get("X-My-Header"))
272
279
 
@@ -35,6 +35,7 @@ client = Spitch(
35
35
  response = client.speech.generate(
36
36
  language="yo",
37
37
  text="text",
38
+ voice="sade",
38
39
  )
39
40
  ```
40
41
 
@@ -62,6 +63,7 @@ async def main() -> None:
62
63
  response = await client.speech.generate(
63
64
  language="yo",
64
65
  text="text",
66
+ voice="sade",
65
67
  )
66
68
 
67
69
 
@@ -98,6 +100,7 @@ try:
98
100
  client.speech.generate(
99
101
  language="yo",
100
102
  text="text",
103
+ voice="sade",
101
104
  )
102
105
  except spitch.APIConnectionError as e:
103
106
  print("The server could not be reached")
@@ -144,6 +147,7 @@ client = Spitch(
144
147
  client.with_options(max_retries=5).speech.generate(
145
148
  language="yo",
146
149
  text="text",
150
+ voice="sade",
147
151
  )
148
152
  ```
149
153
 
@@ -170,6 +174,7 @@ client = Spitch(
170
174
  client.with_options(timeout=5.0).speech.generate(
171
175
  language="yo",
172
176
  text="text",
177
+ voice="sade",
173
178
  )
174
179
  ```
175
180
 
@@ -212,6 +217,7 @@ client = Spitch()
212
217
  response = client.speech.with_raw_response.generate(
213
218
  language="yo",
214
219
  text="text",
220
+ voice="sade",
215
221
  )
216
222
  print(response.headers.get('X-My-Header'))
217
223
 
@@ -233,6 +239,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
233
239
  with client.speech.with_streaming_response.generate(
234
240
  language="yo",
235
241
  text="text",
242
+ voice="sade",
236
243
  ) as response:
237
244
  print(response.headers.get("X-My-Header"))
238
245
 
@@ -9,7 +9,7 @@ from spitch.types import SpeechTranscribeResponse
9
9
  Methods:
10
10
 
11
11
  - <code title="post /v1/speech">client.speech.<a href="./src/spitch/resources/speech.py">generate</a>(\*\*<a href="src/spitch/types/speech_generate_params.py">params</a>) -> BinaryAPIResponse</code>
12
- - <code title="post /v1/transcriptions">client.speech.<a href="./src/spitch/resources/speech.py">transcribe</a>(\*\*<a href="src/spitch/types/speech_transcribe_params.py">params</a>) -> <a href="./src/spitch/types/speech_transcribe_response.py">object</a></code>
12
+ - <code title="post /v1/transcriptions">client.speech.<a href="./src/spitch/resources/speech.py">transcribe</a>(\*\*<a href="src/spitch/types/speech_transcribe_params.py">params</a>) -> <a href="./src/spitch/types/speech_transcribe_response.py">SpeechTranscribeResponse</a></code>
13
13
 
14
14
  # Text
15
15
 
@@ -21,5 +21,5 @@ from spitch.types import TextToneMarkResponse, TextTranslateResponse
21
21
 
22
22
  Methods:
23
23
 
24
- - <code title="post /v1/diacritics">client.text.<a href="./src/spitch/resources/text.py">tone_mark</a>(\*\*<a href="src/spitch/types/text_tone_mark_params.py">params</a>) -> <a href="./src/spitch/types/text_tone_mark_response.py">object</a></code>
25
- - <code title="post /v1/translate">client.text.<a href="./src/spitch/resources/text.py">translate</a>(\*\*<a href="src/spitch/types/text_translate_params.py">params</a>) -> <a href="./src/spitch/types/text_translate_response.py">object</a></code>
24
+ - <code title="post /v1/diacritics">client.text.<a href="./src/spitch/resources/text.py">tone_mark</a>(\*\*<a href="src/spitch/types/text_tone_mark_params.py">params</a>) -> <a href="./src/spitch/types/text_tone_mark_response.py">TextToneMarkResponse</a></code>
25
+ - <code title="post /v1/translate">client.text.<a href="./src/spitch/resources/text.py">translate</a>(\*\*<a href="src/spitch/types/text_translate_params.py">params</a>) -> <a href="./src/spitch/types/text_translate_response.py">TextTranslateResponse</a></code>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "spitch"
3
- version = "1.11.0"
3
+ version = "1.13.0"
4
4
  description = "The official Python library for the spitch API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -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.11.0" # x-release-please-version
4
+ __version__ = "1.13.0" # x-release-please-version
@@ -32,6 +32,7 @@ from .._response import (
32
32
  async_to_custom_streamed_response_wrapper,
33
33
  )
34
34
  from .._base_client import make_request_options
35
+ from ..types.speech_transcribe_response import SpeechTranscribeResponse
35
36
 
36
37
  __all__ = ["SpeechResource", "AsyncSpeechResource"]
37
38
 
@@ -61,8 +62,8 @@ class SpeechResource(SyncAPIResource):
61
62
  *,
62
63
  language: Literal["yo", "en", "ha", "ig"],
63
64
  text: str,
65
+ voice: Literal["sade", "segun", "femi", "funmi", "amina", "aliyu", "hasan", "zainab"],
64
66
  stream: bool | NotGiven = NOT_GIVEN,
65
- voice: Literal["sade", "segun", "femi", "funmi"] | NotGiven = NOT_GIVEN,
66
67
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
67
68
  # The extra values given here take precedence over values defined on the client or passed to this method.
68
69
  extra_headers: Headers | None = None,
@@ -117,7 +118,7 @@ class SpeechResource(SyncAPIResource):
117
118
  extra_query: Query | None = None,
118
119
  extra_body: Body | None = None,
119
120
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
120
- ) -> object:
121
+ ) -> SpeechTranscribeResponse:
121
122
  """
122
123
  Transcribe
123
124
 
@@ -151,7 +152,7 @@ class SpeechResource(SyncAPIResource):
151
152
  options=make_request_options(
152
153
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
153
154
  ),
154
- cast_to=object,
155
+ cast_to=SpeechTranscribeResponse,
155
156
  )
156
157
 
157
158
 
@@ -180,8 +181,8 @@ class AsyncSpeechResource(AsyncAPIResource):
180
181
  *,
181
182
  language: Literal["yo", "en", "ha", "ig"],
182
183
  text: str,
184
+ voice: Literal["sade", "segun", "femi", "funmi", "amina", "aliyu", "hasan", "zainab"],
183
185
  stream: bool | NotGiven = NOT_GIVEN,
184
- voice: Literal["sade", "segun", "femi", "funmi"] | NotGiven = NOT_GIVEN,
185
186
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
186
187
  # The extra values given here take precedence over values defined on the client or passed to this method.
187
188
  extra_headers: Headers | None = None,
@@ -236,7 +237,7 @@ class AsyncSpeechResource(AsyncAPIResource):
236
237
  extra_query: Query | None = None,
237
238
  extra_body: Body | None = None,
238
239
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
239
- ) -> object:
240
+ ) -> SpeechTranscribeResponse:
240
241
  """
241
242
  Transcribe
242
243
 
@@ -270,7 +271,7 @@ class AsyncSpeechResource(AsyncAPIResource):
270
271
  options=make_request_options(
271
272
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
272
273
  ),
273
- cast_to=object,
274
+ cast_to=SpeechTranscribeResponse,
274
275
  )
275
276
 
276
277
 
@@ -21,6 +21,8 @@ from .._response import (
21
21
  async_to_streamed_response_wrapper,
22
22
  )
23
23
  from .._base_client import make_request_options
24
+ from ..types.text_tone_mark_response import TextToneMarkResponse
25
+ from ..types.text_translate_response import TextTranslateResponse
24
26
 
25
27
  __all__ = ["TextResource", "AsyncTextResource"]
26
28
 
@@ -56,7 +58,7 @@ class TextResource(SyncAPIResource):
56
58
  extra_query: Query | None = None,
57
59
  extra_body: Body | None = None,
58
60
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
59
- ) -> object:
61
+ ) -> TextToneMarkResponse:
60
62
  """
61
63
  Tone Mark
62
64
 
@@ -81,7 +83,7 @@ class TextResource(SyncAPIResource):
81
83
  options=make_request_options(
82
84
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
83
85
  ),
84
- cast_to=object,
86
+ cast_to=TextToneMarkResponse,
85
87
  )
86
88
 
87
89
  def translate(
@@ -96,7 +98,7 @@ class TextResource(SyncAPIResource):
96
98
  extra_query: Query | None = None,
97
99
  extra_body: Body | None = None,
98
100
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
99
- ) -> object:
101
+ ) -> TextTranslateResponse:
100
102
  """
101
103
  Translate
102
104
 
@@ -122,7 +124,7 @@ class TextResource(SyncAPIResource):
122
124
  options=make_request_options(
123
125
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
124
126
  ),
125
- cast_to=object,
127
+ cast_to=TextTranslateResponse,
126
128
  )
127
129
 
128
130
 
@@ -157,7 +159,7 @@ class AsyncTextResource(AsyncAPIResource):
157
159
  extra_query: Query | None = None,
158
160
  extra_body: Body | None = None,
159
161
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
160
- ) -> object:
162
+ ) -> TextToneMarkResponse:
161
163
  """
162
164
  Tone Mark
163
165
 
@@ -182,7 +184,7 @@ class AsyncTextResource(AsyncAPIResource):
182
184
  options=make_request_options(
183
185
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
184
186
  ),
185
- cast_to=object,
187
+ cast_to=TextToneMarkResponse,
186
188
  )
187
189
 
188
190
  async def translate(
@@ -197,7 +199,7 @@ class AsyncTextResource(AsyncAPIResource):
197
199
  extra_query: Query | None = None,
198
200
  extra_body: Body | None = None,
199
201
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
200
- ) -> object:
202
+ ) -> TextTranslateResponse:
201
203
  """
202
204
  Translate
203
205
 
@@ -223,7 +225,7 @@ class AsyncTextResource(AsyncAPIResource):
223
225
  options=make_request_options(
224
226
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
225
227
  ),
226
- cast_to=object,
228
+ cast_to=TextTranslateResponse,
227
229
  )
228
230
 
229
231
 
@@ -5,4 +5,7 @@ from __future__ import annotations
5
5
  from .text_tone_mark_params import TextToneMarkParams as TextToneMarkParams
6
6
  from .text_translate_params import TextTranslateParams as TextTranslateParams
7
7
  from .speech_generate_params import SpeechGenerateParams as SpeechGenerateParams
8
+ from .text_tone_mark_response import TextToneMarkResponse as TextToneMarkResponse
9
+ from .text_translate_response import TextTranslateResponse as TextTranslateResponse
8
10
  from .speech_transcribe_params import SpeechTranscribeParams as SpeechTranscribeParams
11
+ from .speech_transcribe_response import SpeechTranscribeResponse as SpeechTranscribeResponse
@@ -12,6 +12,6 @@ class SpeechGenerateParams(TypedDict, total=False):
12
12
 
13
13
  text: Required[str]
14
14
 
15
- stream: bool
15
+ voice: Required[Literal["sade", "segun", "femi", "funmi", "amina", "aliyu", "hasan", "zainab"]]
16
16
 
17
- voice: Literal["sade", "segun", "femi", "funmi"]
17
+ stream: bool
@@ -0,0 +1,25 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["SpeechTranscribeResponse", "Segment"]
8
+
9
+
10
+ class Segment(BaseModel):
11
+ end: Optional[int] = None
12
+
13
+ speaker: Optional[int] = None
14
+
15
+ start: Optional[int] = None
16
+
17
+ text: Optional[int] = None
18
+
19
+
20
+ class SpeechTranscribeResponse(BaseModel):
21
+ request_id: str
22
+
23
+ segment: Optional[List[Optional[Segment]]] = None
24
+
25
+ text: Optional[str] = None
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["TextToneMarkResponse"]
8
+
9
+
10
+ class TextToneMarkResponse(BaseModel):
11
+ request_id: str
12
+
13
+ text: Optional[str] = None
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["TextTranslateResponse"]
8
+
9
+
10
+ class TextTranslateResponse(BaseModel):
11
+ request_id: str
12
+
13
+ text: Optional[str] = None
@@ -11,6 +11,7 @@ from respx import MockRouter
11
11
 
12
12
  from spitch import Spitch, AsyncSpitch
13
13
  from tests.utils import assert_matches_type
14
+ from spitch.types import SpeechTranscribeResponse
14
15
  from spitch._response import (
15
16
  BinaryAPIResponse,
16
17
  AsyncBinaryAPIResponse,
@@ -31,6 +32,7 @@ class TestSpeech:
31
32
  speech = client.speech.generate(
32
33
  language="yo",
33
34
  text="text",
35
+ voice="sade",
34
36
  )
35
37
  assert speech.is_closed
36
38
  assert speech.json() == {"foo": "bar"}
@@ -44,8 +46,8 @@ class TestSpeech:
44
46
  speech = client.speech.generate(
45
47
  language="yo",
46
48
  text="text",
47
- stream=True,
48
49
  voice="sade",
50
+ stream=True,
49
51
  )
50
52
  assert speech.is_closed
51
53
  assert speech.json() == {"foo": "bar"}
@@ -60,6 +62,7 @@ class TestSpeech:
60
62
  speech = client.speech.with_raw_response.generate(
61
63
  language="yo",
62
64
  text="text",
65
+ voice="sade",
63
66
  )
64
67
 
65
68
  assert speech.is_closed is True
@@ -74,6 +77,7 @@ class TestSpeech:
74
77
  with client.speech.with_streaming_response.generate(
75
78
  language="yo",
76
79
  text="text",
80
+ voice="sade",
77
81
  ) as speech:
78
82
  assert not speech.is_closed
79
83
  assert speech.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -89,7 +93,7 @@ class TestSpeech:
89
93
  speech = client.speech.transcribe(
90
94
  language="yo",
91
95
  )
92
- assert_matches_type(object, speech, path=["response"])
96
+ assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
93
97
 
94
98
  @parametrize
95
99
  def test_method_transcribe_with_all_params(self, client: Spitch) -> None:
@@ -100,7 +104,7 @@ class TestSpeech:
100
104
  timestamp=True,
101
105
  url="url",
102
106
  )
103
- assert_matches_type(object, speech, path=["response"])
107
+ assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
104
108
 
105
109
  @parametrize
106
110
  def test_raw_response_transcribe(self, client: Spitch) -> None:
@@ -111,7 +115,7 @@ class TestSpeech:
111
115
  assert response.is_closed is True
112
116
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
113
117
  speech = response.parse()
114
- assert_matches_type(object, speech, path=["response"])
118
+ assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
115
119
 
116
120
  @parametrize
117
121
  def test_streaming_response_transcribe(self, client: Spitch) -> None:
@@ -122,7 +126,7 @@ class TestSpeech:
122
126
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
123
127
 
124
128
  speech = response.parse()
125
- assert_matches_type(object, speech, path=["response"])
129
+ assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
126
130
 
127
131
  assert cast(Any, response.is_closed) is True
128
132
 
@@ -137,6 +141,7 @@ class TestAsyncSpeech:
137
141
  speech = await async_client.speech.generate(
138
142
  language="yo",
139
143
  text="text",
144
+ voice="sade",
140
145
  )
141
146
  assert speech.is_closed
142
147
  assert await speech.json() == {"foo": "bar"}
@@ -150,8 +155,8 @@ class TestAsyncSpeech:
150
155
  speech = await async_client.speech.generate(
151
156
  language="yo",
152
157
  text="text",
153
- stream=True,
154
158
  voice="sade",
159
+ stream=True,
155
160
  )
156
161
  assert speech.is_closed
157
162
  assert await speech.json() == {"foo": "bar"}
@@ -166,6 +171,7 @@ class TestAsyncSpeech:
166
171
  speech = await async_client.speech.with_raw_response.generate(
167
172
  language="yo",
168
173
  text="text",
174
+ voice="sade",
169
175
  )
170
176
 
171
177
  assert speech.is_closed is True
@@ -180,6 +186,7 @@ class TestAsyncSpeech:
180
186
  async with async_client.speech.with_streaming_response.generate(
181
187
  language="yo",
182
188
  text="text",
189
+ voice="sade",
183
190
  ) as speech:
184
191
  assert not speech.is_closed
185
192
  assert speech.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -195,7 +202,7 @@ class TestAsyncSpeech:
195
202
  speech = await async_client.speech.transcribe(
196
203
  language="yo",
197
204
  )
198
- assert_matches_type(object, speech, path=["response"])
205
+ assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
199
206
 
200
207
  @parametrize
201
208
  async def test_method_transcribe_with_all_params(self, async_client: AsyncSpitch) -> None:
@@ -206,7 +213,7 @@ class TestAsyncSpeech:
206
213
  timestamp=True,
207
214
  url="url",
208
215
  )
209
- assert_matches_type(object, speech, path=["response"])
216
+ assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
210
217
 
211
218
  @parametrize
212
219
  async def test_raw_response_transcribe(self, async_client: AsyncSpitch) -> None:
@@ -217,7 +224,7 @@ class TestAsyncSpeech:
217
224
  assert response.is_closed is True
218
225
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
219
226
  speech = await response.parse()
220
- assert_matches_type(object, speech, path=["response"])
227
+ assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
221
228
 
222
229
  @parametrize
223
230
  async def test_streaming_response_transcribe(self, async_client: AsyncSpitch) -> None:
@@ -228,6 +235,6 @@ class TestAsyncSpeech:
228
235
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
229
236
 
230
237
  speech = await response.parse()
231
- assert_matches_type(object, speech, path=["response"])
238
+ assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
232
239
 
233
240
  assert cast(Any, response.is_closed) is True
@@ -9,6 +9,7 @@ import pytest
9
9
 
10
10
  from spitch import Spitch, AsyncSpitch
11
11
  from tests.utils import assert_matches_type
12
+ from spitch.types import TextToneMarkResponse, TextTranslateResponse
12
13
 
13
14
  base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
14
15
 
@@ -22,7 +23,7 @@ class TestText:
22
23
  language="yo",
23
24
  text="text",
24
25
  )
25
- assert_matches_type(object, text, path=["response"])
26
+ assert_matches_type(TextToneMarkResponse, text, path=["response"])
26
27
 
27
28
  @parametrize
28
29
  def test_raw_response_tone_mark(self, client: Spitch) -> None:
@@ -34,7 +35,7 @@ class TestText:
34
35
  assert response.is_closed is True
35
36
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
36
37
  text = response.parse()
37
- assert_matches_type(object, text, path=["response"])
38
+ assert_matches_type(TextToneMarkResponse, text, path=["response"])
38
39
 
39
40
  @parametrize
40
41
  def test_streaming_response_tone_mark(self, client: Spitch) -> None:
@@ -46,7 +47,7 @@ class TestText:
46
47
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
47
48
 
48
49
  text = response.parse()
49
- assert_matches_type(object, text, path=["response"])
50
+ assert_matches_type(TextToneMarkResponse, text, path=["response"])
50
51
 
51
52
  assert cast(Any, response.is_closed) is True
52
53
 
@@ -57,7 +58,7 @@ class TestText:
57
58
  target="yo",
58
59
  text="text",
59
60
  )
60
- assert_matches_type(object, text, path=["response"])
61
+ assert_matches_type(TextTranslateResponse, text, path=["response"])
61
62
 
62
63
  @parametrize
63
64
  def test_raw_response_translate(self, client: Spitch) -> None:
@@ -70,7 +71,7 @@ class TestText:
70
71
  assert response.is_closed is True
71
72
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
72
73
  text = response.parse()
73
- assert_matches_type(object, text, path=["response"])
74
+ assert_matches_type(TextTranslateResponse, text, path=["response"])
74
75
 
75
76
  @parametrize
76
77
  def test_streaming_response_translate(self, client: Spitch) -> None:
@@ -83,7 +84,7 @@ class TestText:
83
84
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
84
85
 
85
86
  text = response.parse()
86
- assert_matches_type(object, text, path=["response"])
87
+ assert_matches_type(TextTranslateResponse, text, path=["response"])
87
88
 
88
89
  assert cast(Any, response.is_closed) is True
89
90
 
@@ -97,7 +98,7 @@ class TestAsyncText:
97
98
  language="yo",
98
99
  text="text",
99
100
  )
100
- assert_matches_type(object, text, path=["response"])
101
+ assert_matches_type(TextToneMarkResponse, text, path=["response"])
101
102
 
102
103
  @parametrize
103
104
  async def test_raw_response_tone_mark(self, async_client: AsyncSpitch) -> None:
@@ -109,7 +110,7 @@ class TestAsyncText:
109
110
  assert response.is_closed is True
110
111
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
111
112
  text = await response.parse()
112
- assert_matches_type(object, text, path=["response"])
113
+ assert_matches_type(TextToneMarkResponse, text, path=["response"])
113
114
 
114
115
  @parametrize
115
116
  async def test_streaming_response_tone_mark(self, async_client: AsyncSpitch) -> None:
@@ -121,7 +122,7 @@ class TestAsyncText:
121
122
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
122
123
 
123
124
  text = await response.parse()
124
- assert_matches_type(object, text, path=["response"])
125
+ assert_matches_type(TextToneMarkResponse, text, path=["response"])
125
126
 
126
127
  assert cast(Any, response.is_closed) is True
127
128
 
@@ -132,7 +133,7 @@ class TestAsyncText:
132
133
  target="yo",
133
134
  text="text",
134
135
  )
135
- assert_matches_type(object, text, path=["response"])
136
+ assert_matches_type(TextTranslateResponse, text, path=["response"])
136
137
 
137
138
  @parametrize
138
139
  async def test_raw_response_translate(self, async_client: AsyncSpitch) -> None:
@@ -145,7 +146,7 @@ class TestAsyncText:
145
146
  assert response.is_closed is True
146
147
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
147
148
  text = await response.parse()
148
- assert_matches_type(object, text, path=["response"])
149
+ assert_matches_type(TextTranslateResponse, text, path=["response"])
149
150
 
150
151
  @parametrize
151
152
  async def test_streaming_response_translate(self, async_client: AsyncSpitch) -> None:
@@ -158,6 +159,6 @@ class TestAsyncText:
158
159
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
159
160
 
160
161
  text = await response.parse()
161
- assert_matches_type(object, text, path=["response"])
162
+ assert_matches_type(TextTranslateResponse, text, path=["response"])
162
163
 
163
164
  assert cast(Any, response.is_closed) is True
@@ -705,7 +705,7 @@ class TestSpitch:
705
705
  with pytest.raises(APITimeoutError):
706
706
  self.client.post(
707
707
  "/v1/speech",
708
- body=cast(object, dict(language="yo", text="text")),
708
+ body=cast(object, dict(language="yo", text="text", voice="sade")),
709
709
  cast_to=httpx.Response,
710
710
  options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
711
711
  )
@@ -720,7 +720,7 @@ class TestSpitch:
720
720
  with pytest.raises(APIStatusError):
721
721
  self.client.post(
722
722
  "/v1/speech",
723
- body=cast(object, dict(language="yo", text="text")),
723
+ body=cast(object, dict(language="yo", text="text", voice="sade")),
724
724
  cast_to=httpx.Response,
725
725
  options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
726
726
  )
@@ -744,7 +744,7 @@ class TestSpitch:
744
744
 
745
745
  respx_mock.post("/v1/speech").mock(side_effect=retry_handler)
746
746
 
747
- response = client.speech.with_raw_response.generate(language="yo", text="text")
747
+ response = client.speech.with_raw_response.generate(language="yo", text="text", voice="sade")
748
748
 
749
749
  assert response.retries_taken == failures_before_success
750
750
  assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -769,7 +769,7 @@ class TestSpitch:
769
769
  respx_mock.post("/v1/speech").mock(side_effect=retry_handler)
770
770
 
771
771
  response = client.speech.with_raw_response.generate(
772
- language="yo", text="text", extra_headers={"x-stainless-retry-count": Omit()}
772
+ language="yo", text="text", voice="sade", extra_headers={"x-stainless-retry-count": Omit()}
773
773
  )
774
774
 
775
775
  assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -794,7 +794,7 @@ class TestSpitch:
794
794
  respx_mock.post("/v1/speech").mock(side_effect=retry_handler)
795
795
 
796
796
  response = client.speech.with_raw_response.generate(
797
- language="yo", text="text", extra_headers={"x-stainless-retry-count": "42"}
797
+ language="yo", text="text", voice="sade", extra_headers={"x-stainless-retry-count": "42"}
798
798
  )
799
799
 
800
800
  assert response.http_request.headers.get("x-stainless-retry-count") == "42"
@@ -1476,7 +1476,7 @@ class TestAsyncSpitch:
1476
1476
  with pytest.raises(APITimeoutError):
1477
1477
  await self.client.post(
1478
1478
  "/v1/speech",
1479
- body=cast(object, dict(language="yo", text="text")),
1479
+ body=cast(object, dict(language="yo", text="text", voice="sade")),
1480
1480
  cast_to=httpx.Response,
1481
1481
  options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
1482
1482
  )
@@ -1491,7 +1491,7 @@ class TestAsyncSpitch:
1491
1491
  with pytest.raises(APIStatusError):
1492
1492
  await self.client.post(
1493
1493
  "/v1/speech",
1494
- body=cast(object, dict(language="yo", text="text")),
1494
+ body=cast(object, dict(language="yo", text="text", voice="sade")),
1495
1495
  cast_to=httpx.Response,
1496
1496
  options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
1497
1497
  )
@@ -1518,7 +1518,7 @@ class TestAsyncSpitch:
1518
1518
 
1519
1519
  respx_mock.post("/v1/speech").mock(side_effect=retry_handler)
1520
1520
 
1521
- response = await client.speech.with_raw_response.generate(language="yo", text="text")
1521
+ response = await client.speech.with_raw_response.generate(language="yo", text="text", voice="sade")
1522
1522
 
1523
1523
  assert response.retries_taken == failures_before_success
1524
1524
  assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -1544,7 +1544,7 @@ class TestAsyncSpitch:
1544
1544
  respx_mock.post("/v1/speech").mock(side_effect=retry_handler)
1545
1545
 
1546
1546
  response = await client.speech.with_raw_response.generate(
1547
- language="yo", text="text", extra_headers={"x-stainless-retry-count": Omit()}
1547
+ language="yo", text="text", voice="sade", extra_headers={"x-stainless-retry-count": Omit()}
1548
1548
  )
1549
1549
 
1550
1550
  assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -1570,7 +1570,7 @@ class TestAsyncSpitch:
1570
1570
  respx_mock.post("/v1/speech").mock(side_effect=retry_handler)
1571
1571
 
1572
1572
  response = await client.speech.with_raw_response.generate(
1573
- language="yo", text="text", extra_headers={"x-stainless-retry-count": "42"}
1573
+ language="yo", text="text", voice="sade", extra_headers={"x-stainless-retry-count": "42"}
1574
1574
  )
1575
1575
 
1576
1576
  assert response.http_request.headers.get("x-stainless-retry-count") == "42"
@@ -1,3 +0,0 @@
1
- {
2
- ".": "1.11.0"
3
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes