Skip to content

Commit 75cbe98

Browse files
(feat): introduce convert_with_timstamp and stream_with_timestamp methods to tts
1 parent 249441a commit 75cbe98

35 files changed

+2516
-201
lines changed

poetry.lock

Lines changed: 380 additions & 105 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "elevenlabs"
3-
version = "v1.2.2"
3+
version = "v1.3.0"
44
description = ""
55
readme = "README.md"
66
authors = []
@@ -11,6 +11,7 @@ packages = [
1111
[tool.poetry.dependencies]
1212
python = "^3.8"
1313
httpx = ">=0.21.2"
14+
ipython = ">=7.0"
1415
pydantic = ">= 1.9.2"
1516
requests = ">=2.20"
1617
typing_extensions = ">= 4.0.0"

src/elevenlabs/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
Currency,
2121
DoDubbingResponse,
2222
DubbingMetadataResponse,
23+
EditProjectResponseModel,
2324
ExtendedSubscriptionResponseModelBillingPeriod,
25+
ExtendedSubscriptionResponseModelCharacterRefreshPeriod,
2426
FeedbackItem,
2527
FineTuningResponse,
2628
FinetuningState,
@@ -46,9 +48,11 @@
4648
NormalizedAlignment,
4749
OptimizeStreamingLatency,
4850
OutputFormat,
51+
ProfilePageResponseModel,
4952
ProjectExtendedResponseModel,
5053
ProjectResponse,
5154
ProjectSnapshotResponse,
55+
ProjectSnapshotUploadResponseModel,
5256
ProjectSnapshotsResponse,
5357
ProjectState,
5458
PronunciationDictionaryAliasRuleRequestModel,
@@ -64,10 +68,13 @@
6468
SpeechHistoryItemResponseModelVoiceCategory,
6569
SsoProviderDbModel,
6670
SsoProviderDbModelProviderType,
71+
Status,
6772
Subscription,
6873
SubscriptionResponse,
6974
SubscriptionResponseModelBillingPeriod,
75+
SubscriptionResponseModelCharacterRefreshPeriod,
7076
SubscriptionStatus,
77+
TextToSpeechAsStreamRequest,
7178
User,
7279
ValidationError,
7380
ValidationErrorLocItem,
@@ -97,16 +104,19 @@
97104
user,
98105
voice_generation,
99106
voices,
107+
workspace,
100108
)
101109
from .environment import ElevenLabsEnvironment
102110
from .play import play, save, stream
103111
from .pronunciation_dictionary import (
112+
PronunciationDictionaryAddFromFileRequestWorkspaceAccess,
104113
PronunciationDictionaryRule,
105114
PronunciationDictionaryRule_Alias,
106115
PronunciationDictionaryRule_Phoneme,
107116
)
108117
from .text_to_speech import SendMessage
109118
from .version import __version__
119+
from .workspace import BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole
110120

111121
__all__ = [
112122
"Accent",
@@ -118,6 +128,7 @@
118128
"AudioNativeCreateProjectResponseModel",
119129
"AudioNativeGetEmbedCodeResponseModel",
120130
"AudioOutput",
131+
"BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole",
121132
"Category",
122133
"ChapterResponse",
123134
"ChapterSnapshotResponse",
@@ -128,8 +139,10 @@
128139
"Currency",
129140
"DoDubbingResponse",
130141
"DubbingMetadataResponse",
142+
"EditProjectResponseModel",
131143
"ElevenLabsEnvironment",
132144
"ExtendedSubscriptionResponseModelBillingPeriod",
145+
"ExtendedSubscriptionResponseModelCharacterRefreshPeriod",
133146
"FeedbackItem",
134147
"FineTuningResponse",
135148
"FinetuningState",
@@ -155,11 +168,14 @@
155168
"NormalizedAlignment",
156169
"OptimizeStreamingLatency",
157170
"OutputFormat",
171+
"ProfilePageResponseModel",
158172
"ProjectExtendedResponseModel",
159173
"ProjectResponse",
160174
"ProjectSnapshotResponse",
175+
"ProjectSnapshotUploadResponseModel",
161176
"ProjectSnapshotsResponse",
162177
"ProjectState",
178+
"PronunciationDictionaryAddFromFileRequestWorkspaceAccess",
163179
"PronunciationDictionaryAliasRuleRequestModel",
164180
"PronunciationDictionaryPhonemeRuleRequestModel",
165181
"PronunciationDictionaryRule",
@@ -177,10 +193,13 @@
177193
"SpeechHistoryItemResponseModelVoiceCategory",
178194
"SsoProviderDbModel",
179195
"SsoProviderDbModelProviderType",
196+
"Status",
180197
"Subscription",
181198
"SubscriptionResponse",
182199
"SubscriptionResponseModelBillingPeriod",
200+
"SubscriptionResponseModelCharacterRefreshPeriod",
183201
"SubscriptionStatus",
202+
"TextToSpeechAsStreamRequest",
184203
"UnprocessableEntityError",
185204
"User",
186205
"ValidationError",
@@ -212,4 +231,5 @@
212231
"user",
213232
"voice_generation",
214233
"voices",
234+
"workspace",
215235
]

src/elevenlabs/audio_native/client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def create(
2727
self,
2828
*,
2929
name: str,
30-
file: core.File,
3130
image: typing.Optional[str] = None,
3231
author: typing.Optional[str] = None,
3332
title: typing.Optional[str] = None,
@@ -37,6 +36,7 @@ def create(
3736
sessionization: typing.Optional[int] = None,
3837
voice_id: typing.Optional[str] = None,
3938
model_id: typing.Optional[str] = None,
39+
file: typing.Optional[core.File] = None,
4040
auto_convert: typing.Optional[bool] = None,
4141
request_options: typing.Optional[RequestOptions] = None,
4242
) -> AudioNativeCreateProjectResponseModel:
@@ -48,9 +48,6 @@ def create(
4848
name : str
4949
Project name.
5050
51-
file : core.File
52-
See core.File for more documentation
53-
5451
image : typing.Optional[str]
5552
Image URL used in the player. If not provided, default image set in the Player settings is used.
5653
@@ -78,6 +75,9 @@ def create(
7875
model_id : typing.Optional[str]
7976
TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used.
8077
78+
file : typing.Optional[core.File]
79+
See core.File for more documentation
80+
8181
auto_convert : typing.Optional[bool]
8282
Whether to auto convert the project to audio or not.
8383
@@ -180,7 +180,6 @@ async def create(
180180
self,
181181
*,
182182
name: str,
183-
file: core.File,
184183
image: typing.Optional[str] = None,
185184
author: typing.Optional[str] = None,
186185
title: typing.Optional[str] = None,
@@ -190,6 +189,7 @@ async def create(
190189
sessionization: typing.Optional[int] = None,
191190
voice_id: typing.Optional[str] = None,
192191
model_id: typing.Optional[str] = None,
192+
file: typing.Optional[core.File] = None,
193193
auto_convert: typing.Optional[bool] = None,
194194
request_options: typing.Optional[RequestOptions] = None,
195195
) -> AudioNativeCreateProjectResponseModel:
@@ -201,9 +201,6 @@ async def create(
201201
name : str
202202
Project name.
203203
204-
file : core.File
205-
See core.File for more documentation
206-
207204
image : typing.Optional[str]
208205
Image URL used in the player. If not provided, default image set in the Player settings is used.
209206
@@ -231,6 +228,9 @@ async def create(
231228
model_id : typing.Optional[str]
232229
TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used.
233230
231+
file : typing.Optional[core.File]
232+
See core.File for more documentation
233+
234234
auto_convert : typing.Optional[bool]
235235
Whether to auto convert the project to audio or not.
236236

src/elevenlabs/base_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from .user.client import AsyncUserClient, UserClient
2121
from .voice_generation.client import AsyncVoiceGenerationClient, VoiceGenerationClient
2222
from .voices.client import AsyncVoicesClient, VoicesClient
23+
from .workspace.client import AsyncWorkspaceClient, WorkspaceClient
2324

2425

2526
class BaseElevenLabs:
@@ -93,6 +94,7 @@ def __init__(
9394
self.models = ModelsClient(client_wrapper=self._client_wrapper)
9495
self.audio_native = AudioNativeClient(client_wrapper=self._client_wrapper)
9596
self.pronunciation_dictionary = PronunciationDictionaryClient(client_wrapper=self._client_wrapper)
97+
self.workspace = WorkspaceClient(client_wrapper=self._client_wrapper)
9698

9799

98100
class AsyncBaseElevenLabs:
@@ -166,6 +168,7 @@ def __init__(
166168
self.models = AsyncModelsClient(client_wrapper=self._client_wrapper)
167169
self.audio_native = AsyncAudioNativeClient(client_wrapper=self._client_wrapper)
168170
self.pronunciation_dictionary = AsyncPronunciationDictionaryClient(client_wrapper=self._client_wrapper)
171+
self.workspace = AsyncWorkspaceClient(client_wrapper=self._client_wrapper)
169172

170173

171174
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: ElevenLabsEnvironment) -> str:

src/elevenlabs/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1717
headers: typing.Dict[str, str] = {
1818
"X-Fern-Language": "Python",
1919
"X-Fern-SDK-Name": "elevenlabs",
20-
"X-Fern-SDK-Version": "v1.2.2",
20+
"X-Fern-SDK-Version": "v1.3.0",
2121
}
2222
if self._api_key is not None:
2323
headers["xi-api-key"] = self._api_key

0 commit comments

Comments
 (0)