syllable-sdk 0.38.4__py3-none-any.whl → 0.38.20__py3-none-any.whl

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.
@@ -2,14 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from datetime import datetime
5
- from pydantic import model_serializer
6
- from syllable_sdk.types import (
7
- BaseModel,
8
- Nullable,
9
- OptionalNullable,
10
- UNSET,
11
- UNSET_SENTINEL,
12
- )
5
+ from syllable_sdk.types import BaseModel
13
6
  from typing import Optional
14
7
  from typing_extensions import NotRequired, TypedDict
15
8
 
@@ -18,10 +11,10 @@ class PronunciationsCsvUploadResponseTypedDict(TypedDict):
18
11
  r"""Placeholder response returned after accepting a pronunciations CSV upload."""
19
12
 
20
13
  revision: int
21
- hash: NotRequired[Nullable[str]]
22
- entries: NotRequired[Nullable[int]]
14
+ hash: str
15
+ entries: int
16
+ uploaded_by: str
23
17
  uploaded_at: NotRequired[datetime]
24
- uploaded_by: NotRequired[Nullable[str]]
25
18
 
26
19
 
27
20
  class PronunciationsCsvUploadResponse(BaseModel):
@@ -29,40 +22,10 @@ class PronunciationsCsvUploadResponse(BaseModel):
29
22
 
30
23
  revision: int
31
24
 
32
- hash: OptionalNullable[str] = UNSET
25
+ hash: str
33
26
 
34
- entries: OptionalNullable[int] = UNSET
27
+ entries: int
35
28
 
36
- uploaded_at: Optional[datetime] = None
37
-
38
- uploaded_by: OptionalNullable[str] = UNSET
39
-
40
- @model_serializer(mode="wrap")
41
- def serialize_model(self, handler):
42
- optional_fields = ["hash", "entries", "uploaded_at", "uploaded_by"]
43
- nullable_fields = ["hash", "entries", "uploaded_by"]
44
- null_default_fields = []
45
-
46
- serialized = handler(self)
47
-
48
- m = {}
29
+ uploaded_by: str
49
30
 
50
- for n, f in type(self).model_fields.items():
51
- k = f.alias or n
52
- val = serialized.get(k)
53
- serialized.pop(k, None)
54
-
55
- optional_nullable = k in optional_fields and k in nullable_fields
56
- is_set = (
57
- self.__pydantic_fields_set__.intersection({n})
58
- or k in null_default_fields
59
- ) # pylint: disable=no-member
60
-
61
- if val is not None and val != UNSET_SENTINEL:
62
- m[k] = val
63
- elif val != UNSET_SENTINEL and (
64
- not k in optional_fields or (optional_nullable and is_set)
65
- ):
66
- m[k] = val
67
-
68
- return m
31
+ uploaded_at: Optional[datetime] = None
@@ -0,0 +1,20 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from syllable_sdk.types import BaseModel
5
+ from typing_extensions import TypedDict
6
+
7
+
8
+ class VoiceDisplayInfoTypedDict(TypedDict):
9
+ r"""Display metadata for a canonical voice identifier."""
10
+
11
+ display_name: str
12
+ provider: str
13
+
14
+
15
+ class VoiceDisplayInfo(BaseModel):
16
+ r"""Display metadata for a canonical voice identifier."""
17
+
18
+ display_name: str
19
+
20
+ provider: str
@@ -12,6 +12,7 @@ from syllable_sdk.types import (
12
12
  UNSET,
13
13
  UNSET_SENTINEL,
14
14
  )
15
+ from typing import Optional
15
16
  from typing_extensions import NotRequired, TypedDict
16
17
 
17
18
 
@@ -28,6 +29,10 @@ class VoiceSampleCreateRequestTypedDict(TypedDict):
28
29
  r"""Speed of the voice in the range of 0.25 to 4.0 (OpenAI and Google) or 0.7 to 1.2 (ElevenLabs). Standard speed is 1.0."""
29
30
  voice_pitch: NotRequired[Nullable[float]]
30
31
  r"""Pitch of the voice in the range of -20.0 to 20.0. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch. 0 means use the original pitch. Only supported for Google configs."""
32
+ text: NotRequired[str]
33
+ r"""Text to generate for this voice."""
34
+ apply_pronunciation_overrides: NotRequired[bool]
35
+ r"""Apply TTS pronunciation fixes."""
31
36
 
32
37
 
33
38
  class VoiceSampleCreateRequest(BaseModel):
@@ -48,9 +53,20 @@ class VoiceSampleCreateRequest(BaseModel):
48
53
  voice_pitch: OptionalNullable[float] = UNSET
49
54
  r"""Pitch of the voice in the range of -20.0 to 20.0. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch. 0 means use the original pitch. Only supported for Google configs."""
50
55
 
56
+ text: Optional[str] = ""
57
+ r"""Text to generate for this voice."""
58
+
59
+ apply_pronunciation_overrides: Optional[bool] = False
60
+ r"""Apply TTS pronunciation fixes."""
61
+
51
62
  @model_serializer(mode="wrap")
52
63
  def serialize_model(self, handler):
53
- optional_fields = ["voice_speed", "voice_pitch"]
64
+ optional_fields = [
65
+ "voice_speed",
66
+ "voice_pitch",
67
+ "text",
68
+ "apply_pronunciation_overrides",
69
+ ]
54
70
  nullable_fields = ["voice_speed", "voice_pitch"]
55
71
  null_default_fields = []
56
72