sarvamai 0.1.8 → 0.1.9
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.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/speechToTextStreaming/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/speechToTextStreaming/client/Socket.d.ts +2 -1
- package/dist/cjs/api/resources/speechToTextStreaming/client/Socket.js +5 -1
- package/dist/cjs/api/resources/textToSpeechStreaming/client/Socket.d.ts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/speechToTextStreaming/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/speechToTextStreaming/client/Socket.d.mts +2 -1
- package/dist/esm/api/resources/speechToTextStreaming/client/Socket.mjs +5 -1
- package/dist/esm/api/resources/textToSpeechStreaming/client/Socket.d.mts +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/Client.js
CHANGED
|
@@ -53,8 +53,8 @@ class SarvamAIClient {
|
|
|
53
53
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
54
54
|
"X-Fern-Language": "JavaScript",
|
|
55
55
|
"X-Fern-SDK-Name": "sarvamai",
|
|
56
|
-
"X-Fern-SDK-Version": "0.1.
|
|
57
|
-
"User-Agent": "sarvamai/0.1.
|
|
56
|
+
"X-Fern-SDK-Version": "0.1.9",
|
|
57
|
+
"User-Agent": "sarvamai/0.1.9",
|
|
58
58
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
59
59
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
60
60
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -17,8 +17,11 @@ export declare namespace SpeechToTextStreaming {
|
|
|
17
17
|
interface ConnectArgs {
|
|
18
18
|
"language-code"?: SarvamAI.SpeechToTextStreamingLanguageCode;
|
|
19
19
|
model?: SarvamAI.SpeechToTextModel | undefined;
|
|
20
|
+
/** Audio codec/format of the input file. Our API automatically detects all codec formats, but for PCM files specifically (pcm_s16le, pcm_l16, pcm_raw), you must pass this parameter. PCM files supports sample rate 16000 and 8000. */
|
|
20
21
|
input_audio_codec?: SarvamAI.SpeechToTextStreamingInputAudioCodec | undefined;
|
|
22
|
+
/** Audio sample rate for the WebSocket connection. When specified as a connection parameter, only 16kHz and 8kHz are supported. 8kHz is only available via this connection parameter. If not specified, defaults to 16kHz. */
|
|
21
23
|
sample_rate?: number | undefined;
|
|
24
|
+
/** Signal to flush the audio buffer and finalize transcription */
|
|
22
25
|
flush_signal?: SarvamAI.SpeechToTextStreamingFlushSignal | undefined;
|
|
23
26
|
high_vad_sensitivity?: SarvamAI.SpeechToTextStreamingHighVadSensitivity | undefined;
|
|
24
27
|
vad_signals?: SarvamAI.SpeechToTextStreamingVadSignals | undefined;
|
|
@@ -42,7 +42,8 @@ export declare class SpeechToTextStreamingSocket {
|
|
|
42
42
|
sample_rate?: number;
|
|
43
43
|
encoding?: string;
|
|
44
44
|
}): void;
|
|
45
|
-
|
|
45
|
+
sendConfigMessage(message: SarvamAI.ConfigMessage): void;
|
|
46
|
+
/** Signal to flush the audio buffer and force finalize partial transcriptions */
|
|
46
47
|
flush(): void;
|
|
47
48
|
/** Connect to the websocket and register event handlers. */
|
|
48
49
|
connect(): SpeechToTextStreamingSocket;
|
|
@@ -105,7 +105,11 @@ class SpeechToTextStreamingSocket {
|
|
|
105
105
|
};
|
|
106
106
|
this.sendJson(message);
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
sendConfigMessage(message) {
|
|
109
|
+
this.assertSocketIsOpen();
|
|
110
|
+
this.sendJson(message);
|
|
111
|
+
}
|
|
112
|
+
/** Signal to flush the audio buffer and force finalize partial transcriptions */
|
|
109
113
|
flush() {
|
|
110
114
|
this.assertSocketIsOpen();
|
|
111
115
|
const flushMessage = {
|
|
@@ -7,7 +7,7 @@ export declare namespace TextToSpeechStreamingSocket {
|
|
|
7
7
|
interface Args {
|
|
8
8
|
socket: core.ReconnectingWebSocket;
|
|
9
9
|
}
|
|
10
|
-
type Response = SarvamAI.AudioOutput | SarvamAI.ErrorResponse;
|
|
10
|
+
type Response = SarvamAI.AudioOutput | SarvamAI.ErrorResponse | SarvamAI.EventResponse;
|
|
11
11
|
type EventHandlers = {
|
|
12
12
|
open?: () => void;
|
|
13
13
|
message?: (message: Response) => void;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.9";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -17,8 +17,8 @@ export class SarvamAIClient {
|
|
|
17
17
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
18
18
|
"X-Fern-Language": "JavaScript",
|
|
19
19
|
"X-Fern-SDK-Name": "sarvamai",
|
|
20
|
-
"X-Fern-SDK-Version": "0.1.
|
|
21
|
-
"User-Agent": "sarvamai/0.1.
|
|
20
|
+
"X-Fern-SDK-Version": "0.1.9",
|
|
21
|
+
"User-Agent": "sarvamai/0.1.9",
|
|
22
22
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
23
23
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
24
24
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -17,8 +17,11 @@ export declare namespace SpeechToTextStreaming {
|
|
|
17
17
|
interface ConnectArgs {
|
|
18
18
|
"language-code"?: SarvamAI.SpeechToTextStreamingLanguageCode;
|
|
19
19
|
model?: SarvamAI.SpeechToTextModel | undefined;
|
|
20
|
+
/** Audio codec/format of the input file. Our API automatically detects all codec formats, but for PCM files specifically (pcm_s16le, pcm_l16, pcm_raw), you must pass this parameter. PCM files supports sample rate 16000 and 8000. */
|
|
20
21
|
input_audio_codec?: SarvamAI.SpeechToTextStreamingInputAudioCodec | undefined;
|
|
22
|
+
/** Audio sample rate for the WebSocket connection. When specified as a connection parameter, only 16kHz and 8kHz are supported. 8kHz is only available via this connection parameter. If not specified, defaults to 16kHz. */
|
|
21
23
|
sample_rate?: number | undefined;
|
|
24
|
+
/** Signal to flush the audio buffer and finalize transcription */
|
|
22
25
|
flush_signal?: SarvamAI.SpeechToTextStreamingFlushSignal | undefined;
|
|
23
26
|
high_vad_sensitivity?: SarvamAI.SpeechToTextStreamingHighVadSensitivity | undefined;
|
|
24
27
|
vad_signals?: SarvamAI.SpeechToTextStreamingVadSignals | undefined;
|
|
@@ -42,7 +42,8 @@ export declare class SpeechToTextStreamingSocket {
|
|
|
42
42
|
sample_rate?: number;
|
|
43
43
|
encoding?: string;
|
|
44
44
|
}): void;
|
|
45
|
-
|
|
45
|
+
sendConfigMessage(message: SarvamAI.ConfigMessage): void;
|
|
46
|
+
/** Signal to flush the audio buffer and force finalize partial transcriptions */
|
|
46
47
|
flush(): void;
|
|
47
48
|
/** Connect to the websocket and register event handlers. */
|
|
48
49
|
connect(): SpeechToTextStreamingSocket;
|
|
@@ -69,7 +69,11 @@ export class SpeechToTextStreamingSocket {
|
|
|
69
69
|
};
|
|
70
70
|
this.sendJson(message);
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
sendConfigMessage(message) {
|
|
73
|
+
this.assertSocketIsOpen();
|
|
74
|
+
this.sendJson(message);
|
|
75
|
+
}
|
|
76
|
+
/** Signal to flush the audio buffer and force finalize partial transcriptions */
|
|
73
77
|
flush() {
|
|
74
78
|
this.assertSocketIsOpen();
|
|
75
79
|
const flushMessage = {
|
|
@@ -7,7 +7,7 @@ export declare namespace TextToSpeechStreamingSocket {
|
|
|
7
7
|
interface Args {
|
|
8
8
|
socket: core.ReconnectingWebSocket;
|
|
9
9
|
}
|
|
10
|
-
type Response = SarvamAI.AudioOutput | SarvamAI.ErrorResponse;
|
|
10
|
+
type Response = SarvamAI.AudioOutput | SarvamAI.ErrorResponse | SarvamAI.EventResponse;
|
|
11
11
|
type EventHandlers = {
|
|
12
12
|
open?: () => void;
|
|
13
13
|
message?: (message: Response) => void;
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.9";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.1.
|
|
1
|
+
export const SDK_VERSION = "0.1.9";
|