spitch 1.6.0__tar.gz → 1.7.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.
- spitch-1.7.0/.release-please-manifest.json +3 -0
- {spitch-1.6.0 → spitch-1.7.0}/CHANGELOG.md +8 -0
- {spitch-1.6.0 → spitch-1.7.0}/PKG-INFO +1 -1
- {spitch-1.6.0 → spitch-1.7.0}/api.md +2 -2
- {spitch-1.6.0 → spitch-1.7.0}/pyproject.toml +1 -1
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_version.py +1 -1
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/resources/speech.py +13 -13
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/types/__init__.py +1 -1
- spitch-1.7.0/src/spitch/types/speech_transcribe_params.py +18 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/api_resources/test_speech.py +16 -16
- spitch-1.6.0/.release-please-manifest.json +0 -3
- {spitch-1.6.0 → spitch-1.7.0}/.gitignore +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/CONTRIBUTING.md +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/LICENSE +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/README.md +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/SECURITY.md +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/bin/check-release-environment +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/bin/publish-pypi +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/examples/.keep +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/examples/example.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/mypy.ini +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/noxfile.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/release-please-config.json +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/requirements-dev.lock +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/requirements.lock +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/__init__.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_base_client.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_client.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_compat.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_constants.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_exceptions.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_files.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_models.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_qs.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_resource.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_response.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_streaming.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_types.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_utils/__init__.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_utils/_logs.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_utils/_proxy.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_utils/_reflection.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_utils/_streams.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_utils/_sync.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_utils/_transform.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_utils/_typing.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/_utils/_utils.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/lib/.keep +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/py.typed +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/resources/__init__.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/resources/text.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/types/speech_generate_params.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/types/speech_transcibe_params.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/src/spitch/types/text_tone_mark_params.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/__init__.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/api_resources/__init__.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/api_resources/test_text.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/conftest.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/sample_file.txt +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_client.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_deepcopy.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_extract_files.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_files.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_models.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_qs.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_required_args.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_response.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_streaming.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_transform.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_utils/test_proxy.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/test_utils/test_typing.py +0 -0
- {spitch-1.6.0 → spitch-1.7.0}/tests/utils.py +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.0 (2024-10-14)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.6.0...v1.7.0](https://github.com/spi-tch/spitch-python/compare/v1.6.0...v1.7.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([#34](https://github.com/spi-tch/spitch-python/issues/34)) ([1cfe384](https://github.com/spi-tch/spitch-python/commit/1cfe38416d8c82453609132080a167c0ab735f51))
|
|
10
|
+
|
|
3
11
|
## 1.6.0 (2024-10-07)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v1.5.0...v1.6.0](https://github.com/spi-tch/spitch-python/compare/v1.5.0...v1.6.0)
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Types:
|
|
4
4
|
|
|
5
5
|
```python
|
|
6
|
-
from spitch.types import
|
|
6
|
+
from spitch.types import SpeechTranscribeResponse
|
|
7
7
|
```
|
|
8
8
|
|
|
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">
|
|
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>
|
|
13
13
|
|
|
14
14
|
# Text
|
|
15
15
|
|
|
@@ -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,
|
|
@@ -98,7 +98,7 @@ class SpeechResource(SyncAPIResource):
|
|
|
98
98
|
cast_to=BinaryAPIResponse,
|
|
99
99
|
)
|
|
100
100
|
|
|
101
|
-
def
|
|
101
|
+
def transcribe(
|
|
102
102
|
self,
|
|
103
103
|
*,
|
|
104
104
|
language: Literal["yo", "en", "ha", "ig"],
|
|
@@ -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
|
|
@@ -208,7 +208,7 @@ class AsyncSpeechResource(AsyncAPIResource):
|
|
|
208
208
|
cast_to=AsyncBinaryAPIResponse,
|
|
209
209
|
)
|
|
210
210
|
|
|
211
|
-
async def
|
|
211
|
+
async def transcribe(
|
|
212
212
|
self,
|
|
213
213
|
*,
|
|
214
214
|
language: Literal["yo", "en", "ha", "ig"],
|
|
@@ -247,7 +247,7 @@ class AsyncSpeechResource(AsyncAPIResource):
|
|
|
247
247
|
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
248
248
|
return await self._post(
|
|
249
249
|
"/v1/transcriptions",
|
|
250
|
-
body=await async_maybe_transform(body,
|
|
250
|
+
body=await async_maybe_transform(body, speech_transcribe_params.SpeechTranscribeParams),
|
|
251
251
|
files=files,
|
|
252
252
|
options=make_request_options(
|
|
253
253
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -264,8 +264,8 @@ class SpeechResourceWithRawResponse:
|
|
|
264
264
|
speech.generate,
|
|
265
265
|
BinaryAPIResponse,
|
|
266
266
|
)
|
|
267
|
-
self.
|
|
268
|
-
speech.
|
|
267
|
+
self.transcribe = to_raw_response_wrapper(
|
|
268
|
+
speech.transcribe,
|
|
269
269
|
)
|
|
270
270
|
|
|
271
271
|
|
|
@@ -277,8 +277,8 @@ class AsyncSpeechResourceWithRawResponse:
|
|
|
277
277
|
speech.generate,
|
|
278
278
|
AsyncBinaryAPIResponse,
|
|
279
279
|
)
|
|
280
|
-
self.
|
|
281
|
-
speech.
|
|
280
|
+
self.transcribe = async_to_raw_response_wrapper(
|
|
281
|
+
speech.transcribe,
|
|
282
282
|
)
|
|
283
283
|
|
|
284
284
|
|
|
@@ -290,8 +290,8 @@ class SpeechResourceWithStreamingResponse:
|
|
|
290
290
|
speech.generate,
|
|
291
291
|
StreamedBinaryAPIResponse
|
|
292
292
|
)
|
|
293
|
-
self.
|
|
294
|
-
speech.
|
|
293
|
+
self.transcribe = to_streamed_response_wrapper(
|
|
294
|
+
speech.transcribe,
|
|
295
295
|
)
|
|
296
296
|
|
|
297
297
|
|
|
@@ -303,6 +303,6 @@ class AsyncSpeechResourceWithStreamingResponse:
|
|
|
303
303
|
speech.generate,
|
|
304
304
|
AsyncStreamedBinaryAPIResponse
|
|
305
305
|
)
|
|
306
|
-
self.
|
|
307
|
-
speech.
|
|
306
|
+
self.transcribe = async_to_streamed_response_wrapper(
|
|
307
|
+
speech.transcribe,
|
|
308
308
|
)
|
|
@@ -4,4 +4,4 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from .text_tone_mark_params import TextToneMarkParams as TextToneMarkParams
|
|
6
6
|
from .speech_generate_params import SpeechGenerateParams as SpeechGenerateParams
|
|
7
|
-
from .
|
|
7
|
+
from .speech_transcribe_params import SpeechTranscribeParams as SpeechTranscribeParams
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
url: Optional[str]
|
|
@@ -73,15 +73,15 @@ class TestSpeech:
|
|
|
73
73
|
assert cast(Any, speech.is_closed) is True
|
|
74
74
|
|
|
75
75
|
@parametrize
|
|
76
|
-
def
|
|
77
|
-
speech = client.speech.
|
|
76
|
+
def test_method_transcribe(self, client: Spitch) -> None:
|
|
77
|
+
speech = client.speech.transcribe(
|
|
78
78
|
language="yo",
|
|
79
79
|
)
|
|
80
80
|
assert_matches_type(object, speech, path=["response"])
|
|
81
81
|
|
|
82
82
|
@parametrize
|
|
83
|
-
def
|
|
84
|
-
speech = client.speech.
|
|
83
|
+
def test_method_transcribe_with_all_params(self, client: Spitch) -> None:
|
|
84
|
+
speech = client.speech.transcribe(
|
|
85
85
|
language="yo",
|
|
86
86
|
content=b"raw file contents",
|
|
87
87
|
url="url",
|
|
@@ -89,8 +89,8 @@ class TestSpeech:
|
|
|
89
89
|
assert_matches_type(object, speech, path=["response"])
|
|
90
90
|
|
|
91
91
|
@parametrize
|
|
92
|
-
def
|
|
93
|
-
response = client.speech.with_raw_response.
|
|
92
|
+
def test_raw_response_transcribe(self, client: Spitch) -> None:
|
|
93
|
+
response = client.speech.with_raw_response.transcribe(
|
|
94
94
|
language="yo",
|
|
95
95
|
)
|
|
96
96
|
|
|
@@ -100,8 +100,8 @@ class TestSpeech:
|
|
|
100
100
|
assert_matches_type(object, speech, path=["response"])
|
|
101
101
|
|
|
102
102
|
@parametrize
|
|
103
|
-
def
|
|
104
|
-
with client.speech.with_streaming_response.
|
|
103
|
+
def test_streaming_response_transcribe(self, client: Spitch) -> None:
|
|
104
|
+
with client.speech.with_streaming_response.transcribe(
|
|
105
105
|
language="yo",
|
|
106
106
|
) as response:
|
|
107
107
|
assert not response.is_closed
|
|
@@ -165,15 +165,15 @@ class TestAsyncSpeech:
|
|
|
165
165
|
assert cast(Any, speech.is_closed) is True
|
|
166
166
|
|
|
167
167
|
@parametrize
|
|
168
|
-
async def
|
|
169
|
-
speech = await async_client.speech.
|
|
168
|
+
async def test_method_transcribe(self, async_client: AsyncSpitch) -> None:
|
|
169
|
+
speech = await async_client.speech.transcribe(
|
|
170
170
|
language="yo",
|
|
171
171
|
)
|
|
172
172
|
assert_matches_type(object, speech, path=["response"])
|
|
173
173
|
|
|
174
174
|
@parametrize
|
|
175
|
-
async def
|
|
176
|
-
speech = await async_client.speech.
|
|
175
|
+
async def test_method_transcribe_with_all_params(self, async_client: AsyncSpitch) -> None:
|
|
176
|
+
speech = await async_client.speech.transcribe(
|
|
177
177
|
language="yo",
|
|
178
178
|
content=b"raw file contents",
|
|
179
179
|
url="url",
|
|
@@ -181,8 +181,8 @@ class TestAsyncSpeech:
|
|
|
181
181
|
assert_matches_type(object, speech, path=["response"])
|
|
182
182
|
|
|
183
183
|
@parametrize
|
|
184
|
-
async def
|
|
185
|
-
response = await async_client.speech.with_raw_response.
|
|
184
|
+
async def test_raw_response_transcribe(self, async_client: AsyncSpitch) -> None:
|
|
185
|
+
response = await async_client.speech.with_raw_response.transcribe(
|
|
186
186
|
language="yo",
|
|
187
187
|
)
|
|
188
188
|
|
|
@@ -192,8 +192,8 @@ class TestAsyncSpeech:
|
|
|
192
192
|
assert_matches_type(object, speech, path=["response"])
|
|
193
193
|
|
|
194
194
|
@parametrize
|
|
195
|
-
async def
|
|
196
|
-
async with async_client.speech.with_streaming_response.
|
|
195
|
+
async def test_streaming_response_transcribe(self, async_client: AsyncSpitch) -> None:
|
|
196
|
+
async with async_client.speech.with_streaming_response.transcribe(
|
|
197
197
|
language="yo",
|
|
198
198
|
) as response:
|
|
199
199
|
assert not response.is_closed
|
|
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
|
|
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
|