typecast-python 0.1.6__tar.gz → 0.1.7__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.
- {typecast_python-0.1.6 → typecast_python-0.1.7}/.gitignore +2 -1
- {typecast_python-0.1.6 → typecast_python-0.1.7}/PKG-INFO +4 -4
- {typecast_python-0.1.6 → typecast_python-0.1.7}/README.md +1 -1
- {typecast_python-0.1.6 → typecast_python-0.1.7}/pyproject.toml +3 -3
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/models/tts.py +26 -2
- {typecast_python-0.1.6 → typecast_python-0.1.7}/LICENSE +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/__init__.py +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/async_client.py +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/client.py +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/conf.py +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/exceptions.py +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/models/__init__.py +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/models/error.py +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/models/tts_wss.py +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/models/voices.py +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/sse.py +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/utils.py +0 -0
- {typecast_python-0.1.6 → typecast_python-0.1.7}/src/typecast/websocket.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: typecast-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: Official Typecast Python SDK - Convert text to lifelike speech using AI-powered voices
|
|
5
5
|
Project-URL: Homepage, https://typecast.ai
|
|
6
6
|
Project-URL: Documentation, https://typecast.ai/docs/overview
|
|
7
|
-
Project-URL: Repository, https://github.com/neosapience/typecast-python
|
|
8
|
-
Project-URL: Issues, https://github.com/neosapience/typecast-
|
|
7
|
+
Project-URL: Repository, https://github.com/neosapience/typecast-sdk/tree/main/typecast-python
|
|
8
|
+
Project-URL: Issues, https://github.com/neosapience/typecast-sdk/issues
|
|
9
9
|
Author-email: Neosapience <help@typecast.ai>
|
|
10
10
|
Maintainer-email: Neosapience <help@typecast.ai>
|
|
11
11
|
License: Apache License
|
|
@@ -551,4 +551,4 @@ except TypecastError as e:
|
|
|
551
551
|
|
|
552
552
|
## License
|
|
553
553
|
|
|
554
|
-
[Apache-2.0](LICENSE) © [Neosapience](https://typecast.ai)
|
|
554
|
+
[Apache-2.0](LICENSE) © [Neosapience](https://typecast.ai/?lang=en)
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "typecast-python"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.7"
|
|
8
8
|
description = "Official Typecast Python SDK - Convert text to lifelike speech using AI-powered voices"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Neosapience", email = "help@typecast.ai"}
|
|
@@ -51,8 +51,8 @@ dev = [
|
|
|
51
51
|
[project.urls]
|
|
52
52
|
Homepage = "https://typecast.ai"
|
|
53
53
|
Documentation = "https://typecast.ai/docs/overview"
|
|
54
|
-
Repository = "https://github.com/neosapience/typecast-python"
|
|
55
|
-
Issues = "https://github.com/neosapience/typecast-
|
|
54
|
+
Repository = "https://github.com/neosapience/typecast-sdk/tree/main/typecast-python"
|
|
55
|
+
Issues = "https://github.com/neosapience/typecast-sdk/issues"
|
|
56
56
|
|
|
57
57
|
[tool.hatch.build.targets.wheel]
|
|
58
58
|
packages = ["src/typecast"]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
2
|
from typing import Literal, Optional, Union
|
|
3
3
|
|
|
4
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
4
|
+
from pydantic import BaseModel, ConfigDict, Field, model_validator
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class TTSModel(str, Enum):
|
|
@@ -122,13 +122,37 @@ TTSPrompt = Union[Prompt, PresetPrompt, SmartPrompt]
|
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
class Output(BaseModel):
|
|
125
|
-
volume: Optional[int] = Field(
|
|
125
|
+
volume: Optional[int] = Field(
|
|
126
|
+
default=100,
|
|
127
|
+
ge=0,
|
|
128
|
+
le=200,
|
|
129
|
+
description="Volume (0-200). Cannot be used together with target_lufs.",
|
|
130
|
+
)
|
|
131
|
+
target_lufs: Optional[float] = Field(
|
|
132
|
+
default=None,
|
|
133
|
+
ge=-70.0,
|
|
134
|
+
le=0.0,
|
|
135
|
+
description="Target loudness in LUFS for absolute loudness normalization (-70 to 0). Cannot be used together with volume.",
|
|
136
|
+
)
|
|
126
137
|
audio_pitch: Optional[int] = Field(default=0, ge=-12, le=12)
|
|
127
138
|
audio_tempo: Optional[float] = Field(default=1.0, ge=0.5, le=2.0)
|
|
128
139
|
audio_format: Optional[str] = Field(
|
|
129
140
|
default="wav", description="Audio format", examples=["wav", "mp3"]
|
|
130
141
|
)
|
|
131
142
|
|
|
143
|
+
@model_validator(mode="before")
|
|
144
|
+
@classmethod
|
|
145
|
+
def check_volume_and_target_lufs(cls, data: dict) -> dict:
|
|
146
|
+
if isinstance(data, dict):
|
|
147
|
+
target_lufs = data.get("target_lufs")
|
|
148
|
+
volume = data.get("volume")
|
|
149
|
+
volume_explicitly_set = "volume" in data
|
|
150
|
+
if target_lufs is not None and volume is not None and volume_explicitly_set:
|
|
151
|
+
raise ValueError("volume and target_lufs cannot be used together")
|
|
152
|
+
if target_lufs is not None and not volume_explicitly_set:
|
|
153
|
+
data["volume"] = None
|
|
154
|
+
return data
|
|
155
|
+
|
|
132
156
|
|
|
133
157
|
class TTSRequest(BaseModel):
|
|
134
158
|
model_config = ConfigDict(json_schema_extra={"exclude_none": 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
|