spitch 1.22.0__tar.gz → 1.23.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.23.0/.release-please-manifest.json +3 -0
- {spitch-1.22.0 → spitch-1.23.0}/CHANGELOG.md +9 -0
- {spitch-1.22.0 → spitch-1.23.0}/PKG-INFO +2 -2
- {spitch-1.22.0 → spitch-1.23.0}/SECURITY.md +1 -1
- {spitch-1.22.0 → spitch-1.23.0}/pyproject.toml +2 -2
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_response.py +13 -19
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_version.py +1 -1
- spitch-1.22.0/.release-please-manifest.json +0 -3
- {spitch-1.22.0 → spitch-1.23.0}/.gitignore +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/CONTRIBUTING.md +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/LICENSE +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/README.md +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/api.md +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/bin/check-release-environment +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/bin/publish-pypi +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/examples/.keep +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/examples/example.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/mypy.ini +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/noxfile.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/release-please-config.json +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/requirements-dev.lock +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/requirements.lock +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/__init__.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_base_client.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_client.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_compat.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_constants.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_exceptions.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_files.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_models.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_qs.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_resource.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_streaming.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_types.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_utils/__init__.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_utils/_logs.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_utils/_proxy.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_utils/_reflection.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_utils/_streams.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_utils/_sync.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_utils/_transform.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_utils/_typing.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/_utils/_utils.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/lib/.keep +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/py.typed +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/resources/__init__.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/resources/speech.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/resources/text.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/types/__init__.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/types/speech_generate_params.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/types/speech_transcribe_params.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/types/speech_transcribe_response.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/types/text_tone_mark_params.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/types/text_tone_mark_response.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/types/text_translate_params.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/src/spitch/types/text_translate_response.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/__init__.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/api_resources/__init__.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/api_resources/test_speech.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/api_resources/test_text.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/conftest.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/sample_file.txt +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_client.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_deepcopy.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_extract_files.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_files.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_models.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_qs.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_required_args.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_response.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_streaming.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_transform.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_utils/test_proxy.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/test_utils/test_typing.py +0 -0
- {spitch-1.22.0 → spitch-1.23.0}/tests/utils.py +0 -0
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.23.0 (2025-03-11)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.22.0...v1.23.0](https://github.com/spi-tch/spitch-python/compare/v1.22.0...v1.23.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** update via SDK Studio ([#123](https://github.com/spi-tch/spitch-python/issues/123)) ([38f463f](https://github.com/spi-tch/spitch-python/commit/38f463f3cb88e5db4b10ef261f8a6ab9a2c30edc))
|
|
10
|
+
* Update _response.py ([3d23d77](https://github.com/spi-tch/spitch-python/commit/3d23d779d3fe974d4ce466e66c585ff3eb8bd9d1))
|
|
11
|
+
|
|
3
12
|
## 1.22.0 (2025-03-11)
|
|
4
13
|
|
|
5
14
|
Full Changelog: [v1.21.1...v1.22.0](https://github.com/spi-tch/spitch-python/compare/v1.21.1...v1.22.0)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spitch
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.23.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
|
|
7
|
-
Author-email: Spitch <
|
|
7
|
+
Author-email: Spitch <developer@spitch.app>
|
|
8
8
|
License-Expression: Apache-2.0
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
@@ -20,7 +20,7 @@ or products provided by Spitch please follow the respective company's security r
|
|
|
20
20
|
|
|
21
21
|
### Spitch Terms and Policies
|
|
22
22
|
|
|
23
|
-
Please contact
|
|
23
|
+
Please contact developer@spitch.app for any questions or concerns regarding security of our services.
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "spitch"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.23.0"
|
|
4
4
|
description = "The official Python library for the spitch API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
7
7
|
authors = [
|
|
8
|
-
{ name = "Spitch", email = "
|
|
8
|
+
{ name = "Spitch", email = "developer@spitch.app" },
|
|
9
9
|
]
|
|
10
10
|
dependencies = [
|
|
11
11
|
"httpx>=0.23.0, <0.28.0",
|
|
@@ -126,11 +126,11 @@ class BaseAPIResponse(Generic[R]):
|
|
|
126
126
|
)
|
|
127
127
|
|
|
128
128
|
def _parse(self, *, to: type[_T] | None = None) -> R | _T:
|
|
129
|
-
|
|
130
|
-
if to and is_annotated_type(to):
|
|
131
|
-
to = extract_type_arg(to, 0)
|
|
129
|
+
cast_to = to if to is not None else self._cast_to
|
|
132
130
|
|
|
133
|
-
|
|
131
|
+
# unwrap `Annotated[T, ...]` -> `T`
|
|
132
|
+
if cast_to and is_annotated_type(cast_to):
|
|
133
|
+
cast_to = extract_type_arg(cast_to, 0)
|
|
134
134
|
|
|
135
135
|
if self._is_sse_stream:
|
|
136
136
|
if to:
|
|
@@ -166,18 +166,12 @@ class BaseAPIResponse(Generic[R]):
|
|
|
166
166
|
return cast(
|
|
167
167
|
R,
|
|
168
168
|
stream_cls(
|
|
169
|
-
cast_to=
|
|
169
|
+
cast_to=cast_to,
|
|
170
170
|
response=self.http_response,
|
|
171
171
|
client=cast(Any, self._client),
|
|
172
172
|
),
|
|
173
173
|
)
|
|
174
174
|
|
|
175
|
-
cast_to = to if to is not None else self._cast_to
|
|
176
|
-
|
|
177
|
-
# unwrap `Annotated[T, ...]` -> `T`
|
|
178
|
-
if is_annotated_type(cast_to):
|
|
179
|
-
cast_to = extract_type_arg(cast_to, 0)
|
|
180
|
-
|
|
181
175
|
if cast_to is NoneType:
|
|
182
176
|
return cast(R, None)
|
|
183
177
|
|
|
@@ -197,6 +191,12 @@ class BaseAPIResponse(Generic[R]):
|
|
|
197
191
|
if cast_to == bool:
|
|
198
192
|
return cast(R, response.text.lower() == "true")
|
|
199
193
|
|
|
194
|
+
origin = get_origin(cast_to) or cast_to
|
|
195
|
+
|
|
196
|
+
# handle the legacy binary response case
|
|
197
|
+
if inspect.isclass(cast_to) and cast_to.__name__ == "HttpxBinaryResponseContent":
|
|
198
|
+
return cast(R, cast_to(response)) # type: ignore
|
|
199
|
+
|
|
200
200
|
if origin == APIResponse:
|
|
201
201
|
raise RuntimeError("Unexpected state - cast_to is `APIResponse`")
|
|
202
202
|
|
|
@@ -210,14 +210,8 @@ class BaseAPIResponse(Generic[R]):
|
|
|
210
210
|
raise ValueError(f"Subclasses of httpx.Response cannot be passed to `cast_to`")
|
|
211
211
|
return cast(R, response)
|
|
212
212
|
|
|
213
|
-
if (
|
|
214
|
-
|
|
215
|
-
origin # pyright: ignore[reportUnknownArgumentType]
|
|
216
|
-
)
|
|
217
|
-
and not issubclass(origin, BaseModel)
|
|
218
|
-
and issubclass(origin, pydantic.BaseModel)
|
|
219
|
-
):
|
|
220
|
-
raise TypeError("Pydantic models must subclass our base model type, e.g. `from spitch import BaseModel`")
|
|
213
|
+
if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel):
|
|
214
|
+
raise TypeError("Pydantic models must subclass our base model type, e.g. `from openai import BaseModel`")
|
|
221
215
|
|
|
222
216
|
if (
|
|
223
217
|
cast_to is not object
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|