sarvamai 0.1.8rc2__py3-none-any.whl → 0.1.8rc3__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.
- sarvamai/__init__.py +2 -0
- sarvamai/core/client_wrapper.py +2 -2
- sarvamai/text_to_speech_streaming/__init__.py +3 -0
- sarvamai/text_to_speech_streaming/client.py +18 -0
- sarvamai/text_to_speech_streaming/raw_client.py +18 -0
- sarvamai/text_to_speech_streaming/types/__init__.py +7 -0
- sarvamai/text_to_speech_streaming/types/text_to_speech_streaming_model.py +5 -0
- {sarvamai-0.1.8rc2.dist-info → sarvamai-0.1.8rc3.dist-info}/METADATA +1 -1
- {sarvamai-0.1.8rc2.dist-info → sarvamai-0.1.8rc3.dist-info}/RECORD +10 -8
- {sarvamai-0.1.8rc2.dist-info → sarvamai-0.1.8rc3.dist-info}/WHEEL +0 -0
sarvamai/__init__.py
CHANGED
|
@@ -154,6 +154,7 @@ from .speech_to_text_translate_streaming import (
|
|
|
154
154
|
SpeechToTextTranslateStreamingModel,
|
|
155
155
|
SpeechToTextTranslateStreamingVadSignals,
|
|
156
156
|
)
|
|
157
|
+
from .text_to_speech_streaming import TextToSpeechStreamingModel
|
|
157
158
|
from .version import __version__
|
|
158
159
|
|
|
159
160
|
__all__ = [
|
|
@@ -273,6 +274,7 @@ __all__ = [
|
|
|
273
274
|
"TextToSpeechResponse",
|
|
274
275
|
"TextToSpeechResponseParams",
|
|
275
276
|
"TextToSpeechSpeaker",
|
|
277
|
+
"TextToSpeechStreamingModel",
|
|
276
278
|
"TimestampsModel",
|
|
277
279
|
"TimestampsModelParams",
|
|
278
280
|
"TooManyRequestsError",
|
sarvamai/core/client_wrapper.py
CHANGED
|
@@ -17,10 +17,10 @@ class BaseClientWrapper:
|
|
|
17
17
|
|
|
18
18
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
19
19
|
headers: typing.Dict[str, str] = {
|
|
20
|
-
"User-Agent": "sarvamai/0.1.
|
|
20
|
+
"User-Agent": "sarvamai/0.1.8rc3",
|
|
21
21
|
"X-Fern-Language": "Python",
|
|
22
22
|
"X-Fern-SDK-Name": "sarvamai",
|
|
23
|
-
"X-Fern-SDK-Version": "0.1.
|
|
23
|
+
"X-Fern-SDK-Version": "0.1.8rc3",
|
|
24
24
|
}
|
|
25
25
|
headers["api-subscription-key"] = self.api_subscription_key
|
|
26
26
|
return headers
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
from contextlib import asynccontextmanager, contextmanager
|
|
5
5
|
|
|
6
|
+
import httpx
|
|
6
7
|
import websockets
|
|
7
8
|
import websockets.sync.client as websockets_sync_client
|
|
8
9
|
from ..core.api_error import ApiError
|
|
@@ -10,6 +11,7 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
10
11
|
from ..core.request_options import RequestOptions
|
|
11
12
|
from .raw_client import AsyncRawTextToSpeechStreamingClient, RawTextToSpeechStreamingClient
|
|
12
13
|
from .socket_client import AsyncTextToSpeechStreamingSocketClient, TextToSpeechStreamingSocketClient
|
|
14
|
+
from .types.text_to_speech_streaming_model import TextToSpeechStreamingModel
|
|
13
15
|
|
|
14
16
|
|
|
15
17
|
class TextToSpeechStreamingClient:
|
|
@@ -31,6 +33,7 @@ class TextToSpeechStreamingClient:
|
|
|
31
33
|
def connect(
|
|
32
34
|
self,
|
|
33
35
|
*,
|
|
36
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
34
37
|
api_subscription_key: typing.Optional[str] = None,
|
|
35
38
|
request_options: typing.Optional[RequestOptions] = None,
|
|
36
39
|
) -> typing.Iterator[TextToSpeechStreamingSocketClient]:
|
|
@@ -40,6 +43,9 @@ class TextToSpeechStreamingClient:
|
|
|
40
43
|
|
|
41
44
|
Parameters
|
|
42
45
|
----------
|
|
46
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
47
|
+
Text to speech model to use
|
|
48
|
+
|
|
43
49
|
api_subscription_key : typing.Optional[str]
|
|
44
50
|
API subscription key for authentication
|
|
45
51
|
|
|
@@ -51,6 +57,10 @@ class TextToSpeechStreamingClient:
|
|
|
51
57
|
TextToSpeechStreamingSocketClient
|
|
52
58
|
"""
|
|
53
59
|
ws_url = self._raw_client._client_wrapper.get_environment().production + "/text-to-speech/ws"
|
|
60
|
+
query_params = httpx.QueryParams()
|
|
61
|
+
if model is not None:
|
|
62
|
+
query_params = query_params.add("model", model)
|
|
63
|
+
ws_url = ws_url + f"?{query_params}"
|
|
54
64
|
headers = self._raw_client._client_wrapper.get_headers()
|
|
55
65
|
if api_subscription_key is not None:
|
|
56
66
|
headers["Api-Subscription-Key"] = str(api_subscription_key)
|
|
@@ -93,6 +103,7 @@ class AsyncTextToSpeechStreamingClient:
|
|
|
93
103
|
async def connect(
|
|
94
104
|
self,
|
|
95
105
|
*,
|
|
106
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
96
107
|
api_subscription_key: typing.Optional[str] = None,
|
|
97
108
|
request_options: typing.Optional[RequestOptions] = None,
|
|
98
109
|
) -> typing.AsyncIterator[AsyncTextToSpeechStreamingSocketClient]:
|
|
@@ -102,6 +113,9 @@ class AsyncTextToSpeechStreamingClient:
|
|
|
102
113
|
|
|
103
114
|
Parameters
|
|
104
115
|
----------
|
|
116
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
117
|
+
Text to speech model to use
|
|
118
|
+
|
|
105
119
|
api_subscription_key : typing.Optional[str]
|
|
106
120
|
API subscription key for authentication
|
|
107
121
|
|
|
@@ -113,6 +127,10 @@ class AsyncTextToSpeechStreamingClient:
|
|
|
113
127
|
AsyncTextToSpeechStreamingSocketClient
|
|
114
128
|
"""
|
|
115
129
|
ws_url = self._raw_client._client_wrapper.get_environment().production + "/text-to-speech/ws"
|
|
130
|
+
query_params = httpx.QueryParams()
|
|
131
|
+
if model is not None:
|
|
132
|
+
query_params = query_params.add("model", model)
|
|
133
|
+
ws_url = ws_url + f"?{query_params}"
|
|
116
134
|
headers = self._raw_client._client_wrapper.get_headers()
|
|
117
135
|
if api_subscription_key is not None:
|
|
118
136
|
headers["Api-Subscription-Key"] = str(api_subscription_key)
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
from contextlib import asynccontextmanager, contextmanager
|
|
5
5
|
|
|
6
|
+
import httpx
|
|
6
7
|
import websockets
|
|
7
8
|
import websockets.sync.client as websockets_sync_client
|
|
8
9
|
from ..core.api_error import ApiError
|
|
9
10
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
10
11
|
from ..core.request_options import RequestOptions
|
|
11
12
|
from .socket_client import AsyncTextToSpeechStreamingSocketClient, TextToSpeechStreamingSocketClient
|
|
13
|
+
from .types.text_to_speech_streaming_model import TextToSpeechStreamingModel
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
class RawTextToSpeechStreamingClient:
|
|
@@ -19,6 +21,7 @@ class RawTextToSpeechStreamingClient:
|
|
|
19
21
|
def connect(
|
|
20
22
|
self,
|
|
21
23
|
*,
|
|
24
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
22
25
|
api_subscription_key: typing.Optional[str] = None,
|
|
23
26
|
request_options: typing.Optional[RequestOptions] = None,
|
|
24
27
|
) -> typing.Iterator[TextToSpeechStreamingSocketClient]:
|
|
@@ -28,6 +31,9 @@ class RawTextToSpeechStreamingClient:
|
|
|
28
31
|
|
|
29
32
|
Parameters
|
|
30
33
|
----------
|
|
34
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
35
|
+
Text to speech model to use
|
|
36
|
+
|
|
31
37
|
api_subscription_key : typing.Optional[str]
|
|
32
38
|
API subscription key for authentication
|
|
33
39
|
|
|
@@ -39,6 +45,10 @@ class RawTextToSpeechStreamingClient:
|
|
|
39
45
|
TextToSpeechStreamingSocketClient
|
|
40
46
|
"""
|
|
41
47
|
ws_url = self._client_wrapper.get_environment().production + "/text-to-speech/ws"
|
|
48
|
+
query_params = httpx.QueryParams()
|
|
49
|
+
if model is not None:
|
|
50
|
+
query_params = query_params.add("model", model)
|
|
51
|
+
ws_url = ws_url + f"?{query_params}"
|
|
42
52
|
headers = self._client_wrapper.get_headers()
|
|
43
53
|
if api_subscription_key is not None:
|
|
44
54
|
headers["Api-Subscription-Key"] = str(api_subscription_key)
|
|
@@ -70,6 +80,7 @@ class AsyncRawTextToSpeechStreamingClient:
|
|
|
70
80
|
async def connect(
|
|
71
81
|
self,
|
|
72
82
|
*,
|
|
83
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
73
84
|
api_subscription_key: typing.Optional[str] = None,
|
|
74
85
|
request_options: typing.Optional[RequestOptions] = None,
|
|
75
86
|
) -> typing.AsyncIterator[AsyncTextToSpeechStreamingSocketClient]:
|
|
@@ -79,6 +90,9 @@ class AsyncRawTextToSpeechStreamingClient:
|
|
|
79
90
|
|
|
80
91
|
Parameters
|
|
81
92
|
----------
|
|
93
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
94
|
+
Text to speech model to use
|
|
95
|
+
|
|
82
96
|
api_subscription_key : typing.Optional[str]
|
|
83
97
|
API subscription key for authentication
|
|
84
98
|
|
|
@@ -90,6 +104,10 @@ class AsyncRawTextToSpeechStreamingClient:
|
|
|
90
104
|
AsyncTextToSpeechStreamingSocketClient
|
|
91
105
|
"""
|
|
92
106
|
ws_url = self._client_wrapper.get_environment().production + "/text-to-speech/ws"
|
|
107
|
+
query_params = httpx.QueryParams()
|
|
108
|
+
if model is not None:
|
|
109
|
+
query_params = query_params.add("model", model)
|
|
110
|
+
ws_url = ws_url + f"?{query_params}"
|
|
93
111
|
headers = self._client_wrapper.get_headers()
|
|
94
112
|
if api_subscription_key is not None:
|
|
95
113
|
headers["Api-Subscription-Key"] = str(api_subscription_key)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
sarvamai/__init__.py,sha256=
|
|
1
|
+
sarvamai/__init__.py,sha256=j9fFu7SIJXzjAmYb9Majr2Ir-ojDhH2dHjxsUVOxgc4,8953
|
|
2
2
|
sarvamai/chat/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
3
3
|
sarvamai/chat/client.py,sha256=xOSj83Gr6Q7eY2qUeATiuXYQqBqWqSCQlIEopK5fKus,11022
|
|
4
4
|
sarvamai/chat/raw_client.py,sha256=A2kRuZcVWlJhyYCD7YKgqNkZEp3cYa1731KhRkhirU0,17885
|
|
5
5
|
sarvamai/client.py,sha256=aI1sw5LVGMjgukgZLDlUmA17ecK1yGsQxH-W_JiCrco,7177
|
|
6
6
|
sarvamai/core/__init__.py,sha256=YE2CtXeASe1RAbaI39twKWYKCuT4tW5is9HWHhJjR_g,1653
|
|
7
7
|
sarvamai/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
|
|
8
|
-
sarvamai/core/client_wrapper.py,sha256=
|
|
8
|
+
sarvamai/core/client_wrapper.py,sha256=4X5OQTI0A__Cf2SlaCAN5xRAzRmOAjEDwg09z9V80gU,2080
|
|
9
9
|
sarvamai/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
|
10
10
|
sarvamai/core/events.py,sha256=j7VWXgMpOsjCXdzY22wIhI7Q-v5InZ4WchRzA88x_Sk,856
|
|
11
11
|
sarvamai/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
|
@@ -97,10 +97,12 @@ sarvamai/text/raw_client.py,sha256=lQ7bV9aVqxjwEUHMPEZ4x0_Xs036_yFArMK9rnYT4ZI,4
|
|
|
97
97
|
sarvamai/text_to_speech/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
98
98
|
sarvamai/text_to_speech/client.py,sha256=aVvwdGTfgVUekALLpdyxKNsGUZQ2Ee2OZBLx6WP6g_E,8842
|
|
99
99
|
sarvamai/text_to_speech/raw_client.py,sha256=3Zu6HN_FOY683Vm-EN-OL7YAbLsftjJlFm5OyRGNtYc,14780
|
|
100
|
-
sarvamai/text_to_speech_streaming/__init__.py,sha256=
|
|
101
|
-
sarvamai/text_to_speech_streaming/client.py,sha256=
|
|
102
|
-
sarvamai/text_to_speech_streaming/raw_client.py,sha256=
|
|
100
|
+
sarvamai/text_to_speech_streaming/__init__.py,sha256=AyHwl9te1mTfiz6IkMU20quN-0RP5njbchknXCz-oK8,173
|
|
101
|
+
sarvamai/text_to_speech_streaming/client.py,sha256=sEC5mVNALldkZri3gHVxHcJCI9TmVwF1vPTL8vfatbY,6161
|
|
102
|
+
sarvamai/text_to_speech_streaming/raw_client.py,sha256=DXsU8Rq27yZGINkRmyeyqPWLlSAGsR1RTJWJH81FlTI,5342
|
|
103
103
|
sarvamai/text_to_speech_streaming/socket_client.py,sha256=fKGmayvIj3qnmnuDlz_QrPDN14CvrtgkGVh0k27yI68,6313
|
|
104
|
+
sarvamai/text_to_speech_streaming/types/__init__.py,sha256=DUsvIGTtST5N1v3Hnodq5aNKfPcTBlod28DSypc8NzA,198
|
|
105
|
+
sarvamai/text_to_speech_streaming/types/text_to_speech_streaming_model.py,sha256=1uOMrJIaAxi_XzwCYmnG5XA-il66cq9uC4ZuiI7HCHo,176
|
|
104
106
|
sarvamai/types/__init__.py,sha256=oCDY6p7Hfd26vLAvluWMrP-qpUd-BJdlVE-KipWXqR8,6332
|
|
105
107
|
sarvamai/types/audio_data.py,sha256=rgOukLkLNJ_HBBVE2g5dfEL2CWjRoGiMvCtpq0qTB1Y,829
|
|
106
108
|
sarvamai/types/audio_message.py,sha256=sB4EgkWkWJzipYXobkmM9AYZTTZtCpg_ySKssUeznUE,560
|
|
@@ -173,6 +175,6 @@ sarvamai/types/transliterate_mode.py,sha256=1jSEMlGcoLkWuk12TgoOpSgwifa4rThGKZ1h
|
|
|
173
175
|
sarvamai/types/transliterate_source_language.py,sha256=bSY9wJszF0sg-Cgg6F-YcWC8ly1mIlj9rqa15-jBtx8,283
|
|
174
176
|
sarvamai/types/transliteration_response.py,sha256=yt-lzTbDeJ_ZL4I8kQa6oESxA9ebeJJY7LfFHpdEsmM,815
|
|
175
177
|
sarvamai/version.py,sha256=Qkp3Ee9YH-O9RTix90e0i7iNrFAGN-QDt2AFwGA4n8k,75
|
|
176
|
-
sarvamai-0.1.
|
|
177
|
-
sarvamai-0.1.
|
|
178
|
-
sarvamai-0.1.
|
|
178
|
+
sarvamai-0.1.8rc3.dist-info/METADATA,sha256=67z0IA-D0ClqEykj_oN9lC7zWXA484eqFN8xelZSXws,26760
|
|
179
|
+
sarvamai-0.1.8rc3.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
180
|
+
sarvamai-0.1.8rc3.dist-info/RECORD,,
|
|
File without changes
|