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.js
CHANGED
|
@@ -1494,7 +1494,7 @@ var GladiaAdapter = class extends BaseAdapter {
|
|
|
1494
1494
|
piiRedaction: false
|
|
1495
1495
|
// Gladia doesn't have PII redaction in their API
|
|
1496
1496
|
};
|
|
1497
|
-
this.baseUrl = "https://api.gladia.io
|
|
1497
|
+
this.baseUrl = "https://api.gladia.io";
|
|
1498
1498
|
}
|
|
1499
1499
|
/**
|
|
1500
1500
|
* Get axios config for generated API client functions
|
|
@@ -1873,11 +1873,20 @@ var GladiaAdapter = class extends BaseAdapter {
|
|
|
1873
1873
|
*/
|
|
1874
1874
|
async transcribeStream(options, callbacks) {
|
|
1875
1875
|
this.validateConfig();
|
|
1876
|
+
let validatedSampleRate;
|
|
1877
|
+
if (options?.sampleRate) {
|
|
1878
|
+
const validRates = Object.values(StreamingSupportedSampleRateEnum);
|
|
1879
|
+
const isValidRate = validRates.some((rate) => rate === options.sampleRate);
|
|
1880
|
+
if (!isValidRate) {
|
|
1881
|
+
throw new Error(
|
|
1882
|
+
`Gladia does not support sample rate ${options.sampleRate} Hz. Supported rates (from OpenAPI spec): ${validRates.join(", ")} Hz`
|
|
1883
|
+
);
|
|
1884
|
+
}
|
|
1885
|
+
validatedSampleRate = options.sampleRate;
|
|
1886
|
+
}
|
|
1876
1887
|
const streamingRequest = {
|
|
1877
|
-
// Map unified encoding format to Gladia's provider-specific format
|
|
1878
|
-
// e.g., 'linear16' → 'wav/pcm'
|
|
1879
1888
|
encoding: options?.encoding ? mapEncodingToProvider(options.encoding, "gladia") : void 0,
|
|
1880
|
-
sample_rate:
|
|
1889
|
+
sample_rate: validatedSampleRate,
|
|
1881
1890
|
channels: options?.channels,
|
|
1882
1891
|
endpointing: options?.endpointing
|
|
1883
1892
|
};
|
|
@@ -3042,7 +3051,7 @@ var DeepgramAdapter = class extends BaseAdapter {
|
|
|
3042
3051
|
params.detect_entities = true;
|
|
3043
3052
|
}
|
|
3044
3053
|
if (options.piiRedaction) {
|
|
3045
|
-
params.redact =
|
|
3054
|
+
params.redact = ["pci", "pii"];
|
|
3046
3055
|
}
|
|
3047
3056
|
if (options.webhookUrl) {
|
|
3048
3057
|
params.callback = options.webhookUrl;
|