spitch 1.11.0__tar.gz → 1.12.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.
- spitch-1.12.0/.release-please-manifest.json +3 -0
- {spitch-1.11.0 → spitch-1.12.0}/CHANGELOG.md +8 -0
- {spitch-1.11.0 → spitch-1.12.0}/PKG-INFO +1 -1
- {spitch-1.11.0 → spitch-1.12.0}/api.md +3 -3
- {spitch-1.11.0 → spitch-1.12.0}/pyproject.toml +1 -1
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_version.py +1 -1
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/resources/speech.py +5 -4
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/resources/text.py +10 -8
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/types/__init__.py +3 -0
- spitch-1.12.0/src/spitch/types/speech_transcribe_response.py +25 -0
- spitch-1.12.0/src/spitch/types/text_tone_mark_response.py +13 -0
- spitch-1.12.0/src/spitch/types/text_translate_response.py +13 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/api_resources/test_speech.py +9 -8
- {spitch-1.11.0 → spitch-1.12.0}/tests/api_resources/test_text.py +13 -12
- spitch-1.11.0/.release-please-manifest.json +0 -3
- {spitch-1.11.0 → spitch-1.12.0}/.gitignore +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/CONTRIBUTING.md +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/LICENSE +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/README.md +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/SECURITY.md +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/bin/check-release-environment +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/bin/publish-pypi +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/examples/.keep +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/examples/example.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/mypy.ini +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/noxfile.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/release-please-config.json +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/requirements-dev.lock +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/requirements.lock +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/__init__.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_base_client.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_client.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_compat.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_constants.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_exceptions.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_files.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_models.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_qs.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_resource.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_response.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_streaming.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_types.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_utils/__init__.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_utils/_logs.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_utils/_proxy.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_utils/_reflection.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_utils/_streams.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_utils/_sync.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_utils/_transform.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_utils/_typing.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/_utils/_utils.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/lib/.keep +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/py.typed +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/resources/__init__.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/types/speech_generate_params.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/types/speech_transcibe_params.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/types/speech_transcribe_params.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/types/text_tone_mark_params.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/src/spitch/types/text_translate_params.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/__init__.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/api_resources/__init__.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/conftest.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/sample_file.txt +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_client.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_deepcopy.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_extract_files.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_files.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_models.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_qs.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_required_args.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_response.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_streaming.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_transform.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_utils/test_proxy.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/test_utils/test_typing.py +0 -0
- {spitch-1.11.0 → spitch-1.12.0}/tests/utils.py +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.12.0 (2024-10-18)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.11.0...v1.12.0](https://github.com/spi-tch/spitch-python/compare/v1.11.0...v1.12.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([#52](https://github.com/spi-tch/spitch-python/issues/52)) ([1633f60](https://github.com/spi-tch/spitch-python/commit/1633f603f789c4e140ff9455fffaee21c77a5ebd))
|
|
10
|
+
|
|
3
11
|
## 1.11.0 (2024-10-17)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v1.10.0...v1.11.0](https://github.com/spi-tch/spitch-python/compare/v1.10.0...v1.11.0)
|
|
@@ -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">
|
|
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">
|
|
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">
|
|
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>
|
|
@@ -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
|
|
|
@@ -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
|
-
) ->
|
|
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=
|
|
155
|
+
cast_to=SpeechTranscribeResponse,
|
|
155
156
|
)
|
|
156
157
|
|
|
157
158
|
|
|
@@ -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
|
-
) ->
|
|
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=
|
|
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
|
-
) ->
|
|
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=
|
|
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
|
-
) ->
|
|
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=
|
|
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
|
-
) ->
|
|
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=
|
|
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
|
-
) ->
|
|
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=
|
|
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
|
|
@@ -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,
|
|
@@ -89,7 +90,7 @@ class TestSpeech:
|
|
|
89
90
|
speech = client.speech.transcribe(
|
|
90
91
|
language="yo",
|
|
91
92
|
)
|
|
92
|
-
assert_matches_type(
|
|
93
|
+
assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
|
|
93
94
|
|
|
94
95
|
@parametrize
|
|
95
96
|
def test_method_transcribe_with_all_params(self, client: Spitch) -> None:
|
|
@@ -100,7 +101,7 @@ class TestSpeech:
|
|
|
100
101
|
timestamp=True,
|
|
101
102
|
url="url",
|
|
102
103
|
)
|
|
103
|
-
assert_matches_type(
|
|
104
|
+
assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
|
|
104
105
|
|
|
105
106
|
@parametrize
|
|
106
107
|
def test_raw_response_transcribe(self, client: Spitch) -> None:
|
|
@@ -111,7 +112,7 @@ class TestSpeech:
|
|
|
111
112
|
assert response.is_closed is True
|
|
112
113
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
113
114
|
speech = response.parse()
|
|
114
|
-
assert_matches_type(
|
|
115
|
+
assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
|
|
115
116
|
|
|
116
117
|
@parametrize
|
|
117
118
|
def test_streaming_response_transcribe(self, client: Spitch) -> None:
|
|
@@ -122,7 +123,7 @@ class TestSpeech:
|
|
|
122
123
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
123
124
|
|
|
124
125
|
speech = response.parse()
|
|
125
|
-
assert_matches_type(
|
|
126
|
+
assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
|
|
126
127
|
|
|
127
128
|
assert cast(Any, response.is_closed) is True
|
|
128
129
|
|
|
@@ -195,7 +196,7 @@ class TestAsyncSpeech:
|
|
|
195
196
|
speech = await async_client.speech.transcribe(
|
|
196
197
|
language="yo",
|
|
197
198
|
)
|
|
198
|
-
assert_matches_type(
|
|
199
|
+
assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
|
|
199
200
|
|
|
200
201
|
@parametrize
|
|
201
202
|
async def test_method_transcribe_with_all_params(self, async_client: AsyncSpitch) -> None:
|
|
@@ -206,7 +207,7 @@ class TestAsyncSpeech:
|
|
|
206
207
|
timestamp=True,
|
|
207
208
|
url="url",
|
|
208
209
|
)
|
|
209
|
-
assert_matches_type(
|
|
210
|
+
assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
|
|
210
211
|
|
|
211
212
|
@parametrize
|
|
212
213
|
async def test_raw_response_transcribe(self, async_client: AsyncSpitch) -> None:
|
|
@@ -217,7 +218,7 @@ class TestAsyncSpeech:
|
|
|
217
218
|
assert response.is_closed is True
|
|
218
219
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
219
220
|
speech = await response.parse()
|
|
220
|
-
assert_matches_type(
|
|
221
|
+
assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
|
|
221
222
|
|
|
222
223
|
@parametrize
|
|
223
224
|
async def test_streaming_response_transcribe(self, async_client: AsyncSpitch) -> None:
|
|
@@ -228,6 +229,6 @@ class TestAsyncSpeech:
|
|
|
228
229
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
229
230
|
|
|
230
231
|
speech = await response.parse()
|
|
231
|
-
assert_matches_type(
|
|
232
|
+
assert_matches_type(SpeechTranscribeResponse, speech, path=["response"])
|
|
232
233
|
|
|
233
234
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
162
|
+
assert_matches_type(TextTranslateResponse, text, path=["response"])
|
|
162
163
|
|
|
163
164
|
assert cast(Any, response.is_closed) is True
|
|
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
|