@cartesia/cartesia-js 2.2.3 → 2.2.5
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/README.md +100 -7
- package/api/resources/apiStatus/client/Client.js +1 -1
- package/api/resources/auth/client/Client.js +1 -1
- package/api/resources/index.d.ts +2 -0
- package/api/resources/index.js +3 -1
- package/api/resources/infill/client/Client.js +1 -1
- package/api/resources/stt/client/Client.d.ts +28 -0
- package/api/resources/stt/client/Client.js +58 -0
- package/api/resources/stt/client/index.d.ts +1 -0
- package/api/resources/stt/client/index.js +5 -0
- package/api/resources/stt/index.d.ts +1 -0
- package/api/resources/stt/index.js +17 -0
- package/api/resources/stt/types/DoneMessage.d.ts +10 -0
- package/api/resources/stt/types/DoneMessage.js +5 -0
- package/api/resources/stt/types/ErrorMessage.d.ts +9 -0
- package/api/resources/stt/types/ErrorMessage.js +5 -0
- package/api/resources/stt/types/FlushDoneMessage.d.ts +10 -0
- package/api/resources/stt/types/FlushDoneMessage.js +5 -0
- package/api/resources/stt/types/StreamingTranscriptionResponse.d.ts +22 -0
- package/api/resources/stt/types/StreamingTranscriptionResponse.js +5 -0
- package/api/resources/stt/types/SttEncoding.d.ts +15 -0
- package/api/resources/stt/types/SttEncoding.js +14 -0
- package/api/resources/stt/types/TranscriptMessage.d.ts +22 -0
- package/api/resources/stt/types/TranscriptMessage.js +5 -0
- package/api/resources/stt/types/TranscriptionResponse.d.ts +14 -0
- package/api/resources/stt/types/TranscriptionResponse.js +5 -0
- package/api/resources/stt/types/TranscriptionWord.d.ts +11 -0
- package/api/resources/stt/types/TranscriptionWord.js +5 -0
- package/api/resources/stt/types/index.d.ts +8 -0
- package/api/resources/stt/types/index.js +24 -0
- package/api/resources/voices/client/Client.js +8 -8
- package/dist/api/resources/apiStatus/client/Client.js +1 -1
- package/dist/api/resources/auth/client/Client.js +1 -1
- package/dist/api/resources/index.d.ts +2 -0
- package/dist/api/resources/index.js +3 -1
- package/dist/api/resources/infill/client/Client.js +1 -1
- package/dist/api/resources/stt/client/Client.d.ts +28 -0
- package/dist/api/resources/stt/client/Client.js +58 -0
- package/dist/api/resources/stt/client/index.d.ts +1 -0
- package/dist/api/resources/stt/client/index.js +5 -0
- package/dist/api/resources/stt/index.d.ts +1 -0
- package/dist/api/resources/stt/index.js +17 -0
- package/dist/api/resources/stt/types/DoneMessage.d.ts +10 -0
- package/dist/api/resources/stt/types/DoneMessage.js +5 -0
- package/dist/api/resources/stt/types/ErrorMessage.d.ts +9 -0
- package/dist/api/resources/stt/types/ErrorMessage.js +5 -0
- package/dist/api/resources/stt/types/FlushDoneMessage.d.ts +10 -0
- package/dist/api/resources/stt/types/FlushDoneMessage.js +5 -0
- package/dist/api/resources/stt/types/StreamingTranscriptionResponse.d.ts +22 -0
- package/dist/api/resources/stt/types/StreamingTranscriptionResponse.js +5 -0
- package/dist/api/resources/stt/types/SttEncoding.d.ts +15 -0
- package/dist/api/resources/stt/types/SttEncoding.js +14 -0
- package/dist/api/resources/stt/types/TranscriptMessage.d.ts +22 -0
- package/dist/api/resources/stt/types/TranscriptMessage.js +5 -0
- package/dist/api/resources/stt/types/TranscriptionResponse.d.ts +14 -0
- package/dist/api/resources/stt/types/TranscriptionResponse.js +5 -0
- package/dist/api/resources/stt/types/TranscriptionWord.d.ts +11 -0
- package/dist/api/resources/stt/types/TranscriptionWord.js +5 -0
- package/dist/api/resources/stt/types/index.d.ts +8 -0
- package/dist/api/resources/stt/types/index.js +24 -0
- package/dist/api/resources/voices/client/Client.js +8 -8
- package/dist/serialization/resources/index.d.ts +2 -0
- package/dist/serialization/resources/index.js +3 -1
- package/dist/serialization/resources/stt/index.d.ts +1 -0
- package/dist/serialization/resources/stt/index.js +17 -0
- package/dist/serialization/resources/stt/types/DoneMessage.d.ts +12 -0
- package/dist/serialization/resources/stt/types/DoneMessage.js +43 -0
- package/dist/serialization/resources/stt/types/ErrorMessage.d.ts +13 -0
- package/dist/serialization/resources/stt/types/ErrorMessage.js +44 -0
- package/dist/serialization/resources/stt/types/FlushDoneMessage.d.ts +12 -0
- package/dist/serialization/resources/stt/types/FlushDoneMessage.js +43 -0
- package/dist/serialization/resources/stt/types/StreamingTranscriptionResponse.d.ts +26 -0
- package/dist/serialization/resources/stt/types/StreamingTranscriptionResponse.js +55 -0
- package/dist/serialization/resources/stt/types/SttEncoding.d.ts +10 -0
- package/dist/serialization/resources/stt/types/SttEncoding.js +41 -0
- package/dist/serialization/resources/stt/types/TranscriptMessage.d.ts +18 -0
- package/dist/serialization/resources/stt/types/TranscriptMessage.js +49 -0
- package/dist/serialization/resources/stt/types/TranscriptionResponse.d.ts +16 -0
- package/dist/serialization/resources/stt/types/TranscriptionResponse.js +47 -0
- package/dist/serialization/resources/stt/types/TranscriptionWord.d.ts +14 -0
- package/dist/serialization/resources/stt/types/TranscriptionWord.js +45 -0
- package/dist/serialization/resources/stt/types/index.d.ts +8 -0
- package/dist/serialization/resources/stt/types/index.js +24 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/Client.d.ts +3 -0
- package/dist/wrapper/Client.js +5 -0
- package/dist/wrapper/StreamingSTTClient.d.ts +6 -0
- package/dist/wrapper/StreamingSTTClient.js +17 -0
- package/dist/wrapper/SttWebsocket.d.ts +29 -0
- package/dist/wrapper/SttWebsocket.js +198 -0
- package/dist/wrapper/Websocket.d.ts +1 -1
- package/dist/wrapper/Websocket.js +24 -16
- package/package.json +1 -1
- package/serialization/resources/index.d.ts +2 -0
- package/serialization/resources/index.js +3 -1
- package/serialization/resources/stt/index.d.ts +1 -0
- package/serialization/resources/stt/index.js +17 -0
- package/serialization/resources/stt/types/DoneMessage.d.ts +12 -0
- package/serialization/resources/stt/types/DoneMessage.js +43 -0
- package/serialization/resources/stt/types/ErrorMessage.d.ts +13 -0
- package/serialization/resources/stt/types/ErrorMessage.js +44 -0
- package/serialization/resources/stt/types/FlushDoneMessage.d.ts +12 -0
- package/serialization/resources/stt/types/FlushDoneMessage.js +43 -0
- package/serialization/resources/stt/types/StreamingTranscriptionResponse.d.ts +26 -0
- package/serialization/resources/stt/types/StreamingTranscriptionResponse.js +55 -0
- package/serialization/resources/stt/types/SttEncoding.d.ts +10 -0
- package/serialization/resources/stt/types/SttEncoding.js +41 -0
- package/serialization/resources/stt/types/TranscriptMessage.d.ts +18 -0
- package/serialization/resources/stt/types/TranscriptMessage.js +49 -0
- package/serialization/resources/stt/types/TranscriptionResponse.d.ts +16 -0
- package/serialization/resources/stt/types/TranscriptionResponse.js +47 -0
- package/serialization/resources/stt/types/TranscriptionWord.d.ts +14 -0
- package/serialization/resources/stt/types/TranscriptionWord.js +45 -0
- package/serialization/resources/stt/types/index.d.ts +8 -0
- package/serialization/resources/stt/types/index.js +24 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/Client.d.ts +3 -0
- package/wrapper/Client.js +5 -0
- package/wrapper/StreamingSTTClient.d.ts +6 -0
- package/wrapper/StreamingSTTClient.js +17 -0
- package/wrapper/SttWebsocket.d.ts +29 -0
- package/wrapper/SttWebsocket.js +198 -0
- package/wrapper/Websocket.d.ts +1 -1
- package/wrapper/Websocket.js +24 -16
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../index";
|
|
5
|
+
import * as Cartesia from "../../../../api/index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
export declare const ErrorMessage: core.serialization.ObjectSchema<serializers.ErrorMessage.Raw, Cartesia.ErrorMessage>;
|
|
8
|
+
export declare namespace ErrorMessage {
|
|
9
|
+
interface Raw {
|
|
10
|
+
request_id?: string | null;
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ErrorMessage = void 0;
|
|
40
|
+
const core = __importStar(require("../../../../core"));
|
|
41
|
+
exports.ErrorMessage = core.serialization.object({
|
|
42
|
+
requestId: core.serialization.property("request_id", core.serialization.string().optional()),
|
|
43
|
+
message: core.serialization.string(),
|
|
44
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../index";
|
|
5
|
+
import * as Cartesia from "../../../../api/index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
export declare const FlushDoneMessage: core.serialization.ObjectSchema<serializers.FlushDoneMessage.Raw, Cartesia.FlushDoneMessage>;
|
|
8
|
+
export declare namespace FlushDoneMessage {
|
|
9
|
+
interface Raw {
|
|
10
|
+
request_id: string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.FlushDoneMessage = void 0;
|
|
40
|
+
const core = __importStar(require("../../../../core"));
|
|
41
|
+
exports.FlushDoneMessage = core.serialization.object({
|
|
42
|
+
requestId: core.serialization.property("request_id", core.serialization.string()),
|
|
43
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../index";
|
|
5
|
+
import * as Cartesia from "../../../../api/index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
import { TranscriptMessage } from "./TranscriptMessage";
|
|
8
|
+
import { FlushDoneMessage } from "./FlushDoneMessage";
|
|
9
|
+
import { DoneMessage } from "./DoneMessage";
|
|
10
|
+
import { ErrorMessage } from "./ErrorMessage";
|
|
11
|
+
export declare const StreamingTranscriptionResponse: core.serialization.Schema<serializers.StreamingTranscriptionResponse.Raw, Cartesia.StreamingTranscriptionResponse>;
|
|
12
|
+
export declare namespace StreamingTranscriptionResponse {
|
|
13
|
+
type Raw = StreamingTranscriptionResponse.Transcript | StreamingTranscriptionResponse.FlushDone | StreamingTranscriptionResponse.Done | StreamingTranscriptionResponse.Error;
|
|
14
|
+
interface Transcript extends TranscriptMessage.Raw {
|
|
15
|
+
type: "transcript";
|
|
16
|
+
}
|
|
17
|
+
interface FlushDone extends FlushDoneMessage.Raw {
|
|
18
|
+
type: "flush_done";
|
|
19
|
+
}
|
|
20
|
+
interface Done extends DoneMessage.Raw {
|
|
21
|
+
type: "done";
|
|
22
|
+
}
|
|
23
|
+
interface Error extends ErrorMessage.Raw {
|
|
24
|
+
type: "error";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.StreamingTranscriptionResponse = void 0;
|
|
40
|
+
const core = __importStar(require("../../../../core"));
|
|
41
|
+
const TranscriptMessage_1 = require("./TranscriptMessage");
|
|
42
|
+
const FlushDoneMessage_1 = require("./FlushDoneMessage");
|
|
43
|
+
const DoneMessage_1 = require("./DoneMessage");
|
|
44
|
+
const ErrorMessage_1 = require("./ErrorMessage");
|
|
45
|
+
exports.StreamingTranscriptionResponse = core.serialization
|
|
46
|
+
.union("type", {
|
|
47
|
+
transcript: TranscriptMessage_1.TranscriptMessage,
|
|
48
|
+
flush_done: FlushDoneMessage_1.FlushDoneMessage,
|
|
49
|
+
done: DoneMessage_1.DoneMessage,
|
|
50
|
+
error: ErrorMessage_1.ErrorMessage,
|
|
51
|
+
})
|
|
52
|
+
.transform({
|
|
53
|
+
transform: (value) => value,
|
|
54
|
+
untransform: (value) => value,
|
|
55
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../index";
|
|
5
|
+
import * as Cartesia from "../../../../api/index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
export declare const SttEncoding: core.serialization.Schema<serializers.SttEncoding.Raw, Cartesia.SttEncoding>;
|
|
8
|
+
export declare namespace SttEncoding {
|
|
9
|
+
type Raw = "pcm_s16le" | "pcm_s32le" | "pcm_f16le" | "pcm_f32le" | "pcm_mulaw" | "pcm_alaw";
|
|
10
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.SttEncoding = void 0;
|
|
40
|
+
const core = __importStar(require("../../../../core"));
|
|
41
|
+
exports.SttEncoding = core.serialization.enum_(["pcm_s16le", "pcm_s32le", "pcm_f16le", "pcm_f32le", "pcm_mulaw", "pcm_alaw"]);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../index";
|
|
5
|
+
import * as Cartesia from "../../../../api/index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
import { TranscriptionWord } from "./TranscriptionWord";
|
|
8
|
+
export declare const TranscriptMessage: core.serialization.ObjectSchema<serializers.TranscriptMessage.Raw, Cartesia.TranscriptMessage>;
|
|
9
|
+
export declare namespace TranscriptMessage {
|
|
10
|
+
interface Raw {
|
|
11
|
+
request_id: string;
|
|
12
|
+
text: string;
|
|
13
|
+
is_final: boolean;
|
|
14
|
+
duration?: number | null;
|
|
15
|
+
language?: string | null;
|
|
16
|
+
words?: TranscriptionWord.Raw[] | null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.TranscriptMessage = void 0;
|
|
40
|
+
const core = __importStar(require("../../../../core"));
|
|
41
|
+
const TranscriptionWord_1 = require("./TranscriptionWord");
|
|
42
|
+
exports.TranscriptMessage = core.serialization.object({
|
|
43
|
+
requestId: core.serialization.property("request_id", core.serialization.string()),
|
|
44
|
+
text: core.serialization.string(),
|
|
45
|
+
isFinal: core.serialization.property("is_final", core.serialization.boolean()),
|
|
46
|
+
duration: core.serialization.number().optional(),
|
|
47
|
+
language: core.serialization.string().optional(),
|
|
48
|
+
words: core.serialization.list(TranscriptionWord_1.TranscriptionWord).optional(),
|
|
49
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../index";
|
|
5
|
+
import * as Cartesia from "../../../../api/index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
import { TranscriptionWord } from "./TranscriptionWord";
|
|
8
|
+
export declare const TranscriptionResponse: core.serialization.ObjectSchema<serializers.TranscriptionResponse.Raw, Cartesia.TranscriptionResponse>;
|
|
9
|
+
export declare namespace TranscriptionResponse {
|
|
10
|
+
interface Raw {
|
|
11
|
+
text: string;
|
|
12
|
+
language?: string | null;
|
|
13
|
+
duration?: number | null;
|
|
14
|
+
words?: TranscriptionWord.Raw[] | null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.TranscriptionResponse = void 0;
|
|
40
|
+
const core = __importStar(require("../../../../core"));
|
|
41
|
+
const TranscriptionWord_1 = require("./TranscriptionWord");
|
|
42
|
+
exports.TranscriptionResponse = core.serialization.object({
|
|
43
|
+
text: core.serialization.string(),
|
|
44
|
+
language: core.serialization.string().optional(),
|
|
45
|
+
duration: core.serialization.number().optional(),
|
|
46
|
+
words: core.serialization.list(TranscriptionWord_1.TranscriptionWord).optional(),
|
|
47
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../index";
|
|
5
|
+
import * as Cartesia from "../../../../api/index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
export declare const TranscriptionWord: core.serialization.ObjectSchema<serializers.TranscriptionWord.Raw, Cartesia.TranscriptionWord>;
|
|
8
|
+
export declare namespace TranscriptionWord {
|
|
9
|
+
interface Raw {
|
|
10
|
+
word: string;
|
|
11
|
+
start: number;
|
|
12
|
+
end: number;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.TranscriptionWord = void 0;
|
|
40
|
+
const core = __importStar(require("../../../../core"));
|
|
41
|
+
exports.TranscriptionWord = core.serialization.object({
|
|
42
|
+
word: core.serialization.string(),
|
|
43
|
+
start: core.serialization.number(),
|
|
44
|
+
end: core.serialization.number(),
|
|
45
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./TranscriptionWord";
|
|
2
|
+
export * from "./TranscriptionResponse";
|
|
3
|
+
export * from "./StreamingTranscriptionResponse";
|
|
4
|
+
export * from "./TranscriptMessage";
|
|
5
|
+
export * from "./FlushDoneMessage";
|
|
6
|
+
export * from "./DoneMessage";
|
|
7
|
+
export * from "./ErrorMessage";
|
|
8
|
+
export * from "./SttEncoding";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./TranscriptionWord"), exports);
|
|
18
|
+
__exportStar(require("./TranscriptionResponse"), exports);
|
|
19
|
+
__exportStar(require("./StreamingTranscriptionResponse"), exports);
|
|
20
|
+
__exportStar(require("./TranscriptMessage"), exports);
|
|
21
|
+
__exportStar(require("./FlushDoneMessage"), exports);
|
|
22
|
+
__exportStar(require("./DoneMessage"), exports);
|
|
23
|
+
__exportStar(require("./ErrorMessage"), exports);
|
|
24
|
+
__exportStar(require("./SttEncoding"), exports);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.2.
|
|
1
|
+
export declare const SDK_VERSION = "2.2.5";
|
package/dist/version.js
CHANGED
package/dist/wrapper/Client.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { CartesiaClient as FernCartesiaClient } from "../Client";
|
|
2
2
|
import { StreamingTTSClient } from "./StreamingTTSClient";
|
|
3
|
+
import { StreamingSTTClient } from "./StreamingSTTClient";
|
|
3
4
|
export declare class CartesiaClient extends FernCartesiaClient {
|
|
5
|
+
protected _stt: StreamingSTTClient | undefined;
|
|
4
6
|
protected _tts: StreamingTTSClient | undefined;
|
|
7
|
+
get stt(): StreamingSTTClient;
|
|
5
8
|
get tts(): StreamingTTSClient;
|
|
6
9
|
}
|
package/dist/wrapper/Client.js
CHANGED
|
@@ -3,7 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CartesiaClient = void 0;
|
|
4
4
|
const Client_1 = require("../Client");
|
|
5
5
|
const StreamingTTSClient_1 = require("./StreamingTTSClient");
|
|
6
|
+
const StreamingSTTClient_1 = require("./StreamingSTTClient");
|
|
6
7
|
class CartesiaClient extends Client_1.CartesiaClient {
|
|
8
|
+
get stt() {
|
|
9
|
+
var _a;
|
|
10
|
+
return ((_a = this._stt) !== null && _a !== void 0 ? _a : (this._stt = new StreamingSTTClient_1.StreamingSTTClient(this._options)));
|
|
11
|
+
}
|
|
7
12
|
get tts() {
|
|
8
13
|
var _a;
|
|
9
14
|
return ((_a = this._tts) !== null && _a !== void 0 ? _a : (this._tts = new StreamingTTSClient_1.StreamingTTSClient(this._options)));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Stt } from "../api/resources/stt/client/Client";
|
|
2
|
+
import SttWebsocket, { SttWebSocketOptions } from "./SttWebsocket";
|
|
3
|
+
export declare class StreamingSTTClient extends Stt {
|
|
4
|
+
constructor(options?: Stt.Options);
|
|
5
|
+
websocket(options?: SttWebSocketOptions): SttWebsocket;
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.StreamingSTTClient = void 0;
|
|
7
|
+
const Client_1 = require("../api/resources/stt/client/Client");
|
|
8
|
+
const SttWebsocket_1 = __importDefault(require("./SttWebsocket"));
|
|
9
|
+
class StreamingSTTClient extends Client_1.Stt {
|
|
10
|
+
constructor(options = {}) {
|
|
11
|
+
super(options);
|
|
12
|
+
}
|
|
13
|
+
websocket(options = {}) {
|
|
14
|
+
return new SttWebsocket_1.default(options, Object.assign({ cartesiaVersion: "2024-06-10" }, this._options));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.StreamingSTTClient = StreamingSTTClient;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReconnectingWebSocket, Options } from "../core/websocket";
|
|
2
|
+
import { Stt } from "../api/resources/stt/client/Client";
|
|
3
|
+
export interface SttWebSocketOptions {
|
|
4
|
+
model?: string;
|
|
5
|
+
language?: string;
|
|
6
|
+
encoding?: string;
|
|
7
|
+
sampleRate?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface TranscriptionResult {
|
|
10
|
+
type: "transcript" | "flush_done" | "done" | "error";
|
|
11
|
+
requestId: string;
|
|
12
|
+
text?: string;
|
|
13
|
+
isFinal?: boolean;
|
|
14
|
+
duration?: number;
|
|
15
|
+
language?: string;
|
|
16
|
+
message?: string;
|
|
17
|
+
}
|
|
18
|
+
export default class SttWebsocket {
|
|
19
|
+
#private;
|
|
20
|
+
private readonly options;
|
|
21
|
+
socket?: ReconnectingWebSocket;
|
|
22
|
+
constructor({ model, language, encoding, sampleRate, }: SttWebSocketOptions, options: Stt.Options);
|
|
23
|
+
send(audioData: ArrayBuffer): Promise<void>;
|
|
24
|
+
finalize(): Promise<void>;
|
|
25
|
+
done(): Promise<void>;
|
|
26
|
+
onMessage(callback: (result: TranscriptionResult) => void): Promise<void>;
|
|
27
|
+
connect(connectOptions?: Options): Promise<void>;
|
|
28
|
+
disconnect(): void;
|
|
29
|
+
}
|