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.
@@ -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.8",
57
- "User-Agent": "sarvamai/0.1.8",
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
- /** Flush the audio buffer and finalize transcriptions */
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
- /** Flush the audio buffer and finalize transcriptions */
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;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.8";
1
+ export declare const SDK_VERSION = "0.1.9";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.1.8";
4
+ exports.SDK_VERSION = "0.1.9";
@@ -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.8",
21
- "User-Agent": "sarvamai/0.1.8",
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
- /** Flush the audio buffer and finalize transcriptions */
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
- /** Flush the audio buffer and finalize transcriptions */
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;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.8";
1
+ export declare const SDK_VERSION = "0.1.9";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.1.8";
1
+ export const SDK_VERSION = "0.1.9";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sarvamai",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "private": false,
5
5
  "repository": "https://github.com/sarvamai/sarvam-javascript-sdk",
6
6
  "type": "commonjs",