voice-router-dev 0.1.4 → 0.1.6
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/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1436,7 +1436,7 @@ var GladiaAdapter = class extends BaseAdapter {
|
|
|
1436
1436
|
piiRedaction: false
|
|
1437
1437
|
// Gladia doesn't have PII redaction in their API
|
|
1438
1438
|
};
|
|
1439
|
-
this.baseUrl = "https://api.gladia.io
|
|
1439
|
+
this.baseUrl = "https://api.gladia.io";
|
|
1440
1440
|
}
|
|
1441
1441
|
/**
|
|
1442
1442
|
* Get axios config for generated API client functions
|
|
@@ -1815,11 +1815,20 @@ var GladiaAdapter = class extends BaseAdapter {
|
|
|
1815
1815
|
*/
|
|
1816
1816
|
async transcribeStream(options, callbacks) {
|
|
1817
1817
|
this.validateConfig();
|
|
1818
|
+
let validatedSampleRate;
|
|
1819
|
+
if (options?.sampleRate) {
|
|
1820
|
+
const validRates = Object.values(StreamingSupportedSampleRateEnum);
|
|
1821
|
+
const isValidRate = validRates.some((rate) => rate === options.sampleRate);
|
|
1822
|
+
if (!isValidRate) {
|
|
1823
|
+
throw new Error(
|
|
1824
|
+
`Gladia does not support sample rate ${options.sampleRate} Hz. Supported rates (from OpenAPI spec): ${validRates.join(", ")} Hz`
|
|
1825
|
+
);
|
|
1826
|
+
}
|
|
1827
|
+
validatedSampleRate = options.sampleRate;
|
|
1828
|
+
}
|
|
1818
1829
|
const streamingRequest = {
|
|
1819
|
-
// Map unified encoding format to Gladia's provider-specific format
|
|
1820
|
-
// e.g., 'linear16' → 'wav/pcm'
|
|
1821
1830
|
encoding: options?.encoding ? mapEncodingToProvider(options.encoding, "gladia") : void 0,
|
|
1822
|
-
sample_rate:
|
|
1831
|
+
sample_rate: validatedSampleRate,
|
|
1823
1832
|
channels: options?.channels,
|
|
1824
1833
|
endpointing: options?.endpointing
|
|
1825
1834
|
};
|
|
@@ -2984,7 +2993,7 @@ var DeepgramAdapter = class extends BaseAdapter {
|
|
|
2984
2993
|
params.detect_entities = true;
|
|
2985
2994
|
}
|
|
2986
2995
|
if (options.piiRedaction) {
|
|
2987
|
-
params.redact =
|
|
2996
|
+
params.redact = ["pci", "pii"];
|
|
2988
2997
|
}
|
|
2989
2998
|
if (options.webhookUrl) {
|
|
2990
2999
|
params.callback = options.webhookUrl;
|