spitch 1.21.1__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.

Files changed (75) hide show
  1. spitch-1.23.0/.release-please-manifest.json +3 -0
  2. {spitch-1.21.1 → spitch-1.23.0}/CHANGELOG.md +17 -0
  3. {spitch-1.21.1 → spitch-1.23.0}/PKG-INFO +2 -2
  4. {spitch-1.21.1 → spitch-1.23.0}/SECURITY.md +1 -1
  5. {spitch-1.21.1 → spitch-1.23.0}/pyproject.toml +2 -2
  6. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_response.py +13 -19
  7. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_version.py +1 -1
  8. spitch-1.21.1/.release-please-manifest.json +0 -3
  9. {spitch-1.21.1 → spitch-1.23.0}/.gitignore +0 -0
  10. {spitch-1.21.1 → spitch-1.23.0}/CONTRIBUTING.md +0 -0
  11. {spitch-1.21.1 → spitch-1.23.0}/LICENSE +0 -0
  12. {spitch-1.21.1 → spitch-1.23.0}/README.md +0 -0
  13. {spitch-1.21.1 → spitch-1.23.0}/api.md +0 -0
  14. {spitch-1.21.1 → spitch-1.23.0}/bin/check-release-environment +0 -0
  15. {spitch-1.21.1 → spitch-1.23.0}/bin/publish-pypi +0 -0
  16. {spitch-1.21.1 → spitch-1.23.0}/examples/.keep +0 -0
  17. {spitch-1.21.1 → spitch-1.23.0}/examples/example.py +0 -0
  18. {spitch-1.21.1 → spitch-1.23.0}/mypy.ini +0 -0
  19. {spitch-1.21.1 → spitch-1.23.0}/noxfile.py +0 -0
  20. {spitch-1.21.1 → spitch-1.23.0}/release-please-config.json +0 -0
  21. {spitch-1.21.1 → spitch-1.23.0}/requirements-dev.lock +0 -0
  22. {spitch-1.21.1 → spitch-1.23.0}/requirements.lock +0 -0
  23. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/__init__.py +0 -0
  24. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_base_client.py +0 -0
  25. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_client.py +0 -0
  26. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_compat.py +0 -0
  27. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_constants.py +0 -0
  28. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_exceptions.py +0 -0
  29. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_files.py +0 -0
  30. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_models.py +0 -0
  31. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_qs.py +0 -0
  32. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_resource.py +0 -0
  33. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_streaming.py +0 -0
  34. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_types.py +0 -0
  35. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_utils/__init__.py +0 -0
  36. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_utils/_logs.py +0 -0
  37. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_utils/_proxy.py +0 -0
  38. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_utils/_reflection.py +0 -0
  39. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_utils/_streams.py +0 -0
  40. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_utils/_sync.py +0 -0
  41. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_utils/_transform.py +0 -0
  42. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_utils/_typing.py +0 -0
  43. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/_utils/_utils.py +0 -0
  44. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/lib/.keep +0 -0
  45. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/py.typed +0 -0
  46. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/resources/__init__.py +0 -0
  47. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/resources/speech.py +0 -0
  48. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/resources/text.py +0 -0
  49. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/types/__init__.py +0 -0
  50. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/types/speech_generate_params.py +0 -0
  51. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/types/speech_transcribe_params.py +0 -0
  52. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/types/speech_transcribe_response.py +0 -0
  53. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/types/text_tone_mark_params.py +0 -0
  54. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/types/text_tone_mark_response.py +0 -0
  55. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/types/text_translate_params.py +0 -0
  56. {spitch-1.21.1 → spitch-1.23.0}/src/spitch/types/text_translate_response.py +0 -0
  57. {spitch-1.21.1 → spitch-1.23.0}/tests/__init__.py +0 -0
  58. {spitch-1.21.1 → spitch-1.23.0}/tests/api_resources/__init__.py +0 -0
  59. {spitch-1.21.1 → spitch-1.23.0}/tests/api_resources/test_speech.py +0 -0
  60. {spitch-1.21.1 → spitch-1.23.0}/tests/api_resources/test_text.py +0 -0
  61. {spitch-1.21.1 → spitch-1.23.0}/tests/conftest.py +0 -0
  62. {spitch-1.21.1 → spitch-1.23.0}/tests/sample_file.txt +0 -0
  63. {spitch-1.21.1 → spitch-1.23.0}/tests/test_client.py +0 -0
  64. {spitch-1.21.1 → spitch-1.23.0}/tests/test_deepcopy.py +0 -0
  65. {spitch-1.21.1 → spitch-1.23.0}/tests/test_extract_files.py +0 -0
  66. {spitch-1.21.1 → spitch-1.23.0}/tests/test_files.py +0 -0
  67. {spitch-1.21.1 → spitch-1.23.0}/tests/test_models.py +0 -0
  68. {spitch-1.21.1 → spitch-1.23.0}/tests/test_qs.py +0 -0
  69. {spitch-1.21.1 → spitch-1.23.0}/tests/test_required_args.py +0 -0
  70. {spitch-1.21.1 → spitch-1.23.0}/tests/test_response.py +0 -0
  71. {spitch-1.21.1 → spitch-1.23.0}/tests/test_streaming.py +0 -0
  72. {spitch-1.21.1 → spitch-1.23.0}/tests/test_transform.py +0 -0
  73. {spitch-1.21.1 → spitch-1.23.0}/tests/test_utils/test_proxy.py +0 -0
  74. {spitch-1.21.1 → spitch-1.23.0}/tests/test_utils/test_typing.py +0 -0
  75. {spitch-1.21.1 → spitch-1.23.0}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.23.0"
3
+ }
@@ -1,5 +1,22 @@
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
+
12
+ ## 1.22.0 (2025-03-11)
13
+
14
+ Full Changelog: [v1.21.1...v1.22.0](https://github.com/spi-tch/spitch-python/compare/v1.21.1...v1.22.0)
15
+
16
+ ### Features
17
+
18
+ * **api:** update via SDK Studio ([#120](https://github.com/spi-tch/spitch-python/issues/120)) ([d0d2514](https://github.com/spi-tch/spitch-python/commit/d0d2514fdac33ef10c695d9e80c4620745596063))
19
+
3
20
  ## 1.21.1 (2025-03-11)
4
21
 
5
22
  Full Changelog: [v1.21.0...v1.21.1](https://github.com/spi-tch/spitch-python/compare/v1.21.0...v1.21.1)
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spitch
3
- Version: 1.21.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 <hello@spi-tch.com>
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 hello@spi-tch.com for any questions or concerns regarding security of our services.
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.21.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 = "hello@spi-tch.com" },
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
- # unwrap `Annotated[T, ...]` -> `T`
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
- origin = get_origin(cast_to) or cast_to
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=self._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
- inspect.isclass(
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
@@ -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.21.1" # x-release-please-version
4
+ __version__ = "1.23.0" # x-release-please-version
@@ -1,3 +0,0 @@
1
- {
2
- ".": "1.21.1"
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
File without changes