@cartesia/cartesia-js 2.2.5 → 2.2.7
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/Client.d.ts +3 -0
- package/Client.js +11 -6
- package/README.md +469 -144
- package/api/resources/apiStatus/client/Client.js +1 -1
- package/api/resources/auth/client/Client.d.ts +17 -0
- package/api/resources/auth/client/Client.js +18 -1
- package/api/resources/auth/types/TokenGrant.d.ts +3 -1
- package/api/resources/auth/types/TokenRequest.d.ts +2 -2
- package/api/resources/index.d.ts +1 -0
- package/api/resources/index.js +1 -0
- package/api/resources/infill/client/Client.js +1 -1
- package/api/resources/infill/client/requests/InfillBytesRequest.d.ts +3 -11
- package/api/resources/stt/client/Client.d.ts +43 -0
- package/api/resources/stt/client/Client.js +108 -0
- package/api/resources/stt/client/index.d.ts +1 -1
- package/api/resources/stt/client/index.js +15 -3
- package/api/resources/stt/client/requests/TranscriptionRequest.d.ts +147 -0
- package/api/resources/stt/client/requests/TranscriptionRequest.js +5 -0
- package/api/resources/stt/client/requests/index.d.ts +1 -0
- package/api/resources/stt/client/requests/index.js +2 -0
- package/api/resources/stt/index.d.ts +1 -0
- package/api/resources/stt/index.js +1 -0
- package/api/resources/stt/types/TimestampGranularity.d.ts +12 -0
- package/api/resources/stt/types/TimestampGranularity.js +9 -0
- package/api/resources/stt/types/TranscriptMessage.d.ts +1 -1
- package/api/resources/stt/types/TranscriptionResponse.d.ts +2 -2
- package/api/resources/stt/types/index.d.ts +1 -0
- package/api/resources/stt/types/index.js +1 -0
- package/api/resources/tts/client/Client.d.ts +7 -2
- package/api/resources/tts/client/Client.js +8 -8
- package/api/resources/tts/types/Controls.d.ts +1 -1
- package/api/resources/tts/types/Emotion.d.ts +2 -33
- package/api/resources/tts/types/Emotion.js +0 -28
- package/api/resources/tts/types/EmotionDeprecated.d.ts +38 -0
- package/api/resources/tts/types/EmotionDeprecated.js +33 -0
- package/api/resources/tts/types/GenerationConfig.d.ts +15 -0
- package/api/resources/tts/types/GenerationConfig.js +5 -0
- package/api/resources/tts/types/GenerationRequest.d.ts +5 -4
- package/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
- package/api/resources/tts/types/RawOutputFormat.d.ts +1 -0
- package/api/resources/tts/types/SseOutputFormat.d.ts +10 -0
- package/api/resources/tts/types/SseOutputFormat.js +5 -0
- package/api/resources/tts/types/TtsRequest.d.ts +1 -0
- package/api/resources/tts/types/TtssseRequest.d.ts +27 -0
- package/api/resources/tts/types/TtssseRequest.js +5 -0
- package/api/resources/tts/types/WebSocketRawOutputFormat.d.ts +1 -0
- package/api/resources/tts/types/WebSocketRequest.d.ts +2 -4
- package/api/resources/tts/types/WebSocketTtsRequest.d.ts +4 -1
- package/api/resources/tts/types/index.d.ts +5 -1
- package/api/resources/tts/types/index.js +5 -1
- package/api/resources/voiceChanger/client/Client.d.ts +9 -4
- package/api/resources/voiceChanger/client/Client.js +24 -20
- package/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.d.ts +3 -8
- package/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.d.ts +3 -8
- package/api/resources/voices/client/Client.js +8 -8
- package/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +6 -24
- package/api/resources/voices/types/LocalizeDialect.d.ts +4 -8
- package/core/fetcher/Fetcher.d.ts +2 -2
- package/core/fetcher/Fetcher.js +4 -3
- package/core/fetcher/getResponseBody.js +3 -3
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +11 -6
- package/dist/api/resources/apiStatus/client/Client.js +1 -1
- package/dist/api/resources/auth/client/Client.d.ts +17 -0
- package/dist/api/resources/auth/client/Client.js +18 -1
- package/dist/api/resources/auth/types/TokenGrant.d.ts +3 -1
- package/dist/api/resources/auth/types/TokenRequest.d.ts +2 -2
- package/dist/api/resources/index.d.ts +1 -0
- package/dist/api/resources/index.js +1 -0
- package/dist/api/resources/infill/client/Client.js +1 -1
- package/dist/api/resources/infill/client/requests/InfillBytesRequest.d.ts +3 -11
- package/dist/api/resources/stt/client/Client.d.ts +43 -0
- package/dist/api/resources/stt/client/Client.js +108 -0
- package/dist/api/resources/stt/client/index.d.ts +1 -1
- package/dist/api/resources/stt/client/index.js +15 -3
- package/dist/api/resources/stt/client/requests/TranscriptionRequest.d.ts +147 -0
- package/dist/api/resources/stt/client/requests/TranscriptionRequest.js +5 -0
- package/dist/api/resources/stt/client/requests/index.d.ts +1 -0
- package/dist/api/resources/stt/client/requests/index.js +2 -0
- package/dist/api/resources/stt/index.d.ts +1 -0
- package/dist/api/resources/stt/index.js +1 -0
- package/dist/api/resources/stt/types/TimestampGranularity.d.ts +12 -0
- package/dist/api/resources/stt/types/TimestampGranularity.js +9 -0
- package/dist/api/resources/stt/types/TranscriptMessage.d.ts +1 -1
- package/dist/api/resources/stt/types/TranscriptionResponse.d.ts +2 -2
- package/dist/api/resources/stt/types/index.d.ts +1 -0
- package/dist/api/resources/stt/types/index.js +1 -0
- package/dist/api/resources/tts/client/Client.d.ts +7 -2
- package/dist/api/resources/tts/client/Client.js +8 -8
- package/dist/api/resources/tts/types/Controls.d.ts +1 -1
- package/dist/api/resources/tts/types/Emotion.d.ts +2 -33
- package/dist/api/resources/tts/types/Emotion.js +0 -28
- package/dist/api/resources/tts/types/EmotionDeprecated.d.ts +38 -0
- package/dist/api/resources/tts/types/EmotionDeprecated.js +33 -0
- package/dist/api/resources/tts/types/GenerationConfig.d.ts +15 -0
- package/dist/api/resources/tts/types/GenerationConfig.js +5 -0
- package/dist/api/resources/tts/types/GenerationRequest.d.ts +5 -4
- package/dist/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
- package/dist/api/resources/tts/types/RawOutputFormat.d.ts +1 -0
- package/dist/api/resources/tts/types/SseOutputFormat.d.ts +10 -0
- package/dist/api/resources/tts/types/SseOutputFormat.js +5 -0
- package/dist/api/resources/tts/types/TtsRequest.d.ts +1 -0
- package/dist/api/resources/tts/types/TtssseRequest.d.ts +27 -0
- package/dist/api/resources/tts/types/TtssseRequest.js +5 -0
- package/dist/api/resources/tts/types/WebSocketRawOutputFormat.d.ts +1 -0
- package/dist/api/resources/tts/types/WebSocketRequest.d.ts +2 -4
- package/dist/api/resources/tts/types/WebSocketTtsRequest.d.ts +4 -1
- package/dist/api/resources/tts/types/index.d.ts +5 -1
- package/dist/api/resources/tts/types/index.js +5 -1
- package/dist/api/resources/voiceChanger/client/Client.d.ts +9 -4
- package/dist/api/resources/voiceChanger/client/Client.js +24 -20
- package/dist/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.d.ts +3 -8
- package/dist/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.d.ts +3 -8
- package/dist/api/resources/voices/client/Client.js +8 -8
- package/dist/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +6 -24
- package/dist/api/resources/voices/types/LocalizeDialect.d.ts +4 -8
- package/dist/core/fetcher/Fetcher.d.ts +2 -2
- package/dist/core/fetcher/Fetcher.js +4 -3
- package/dist/core/fetcher/getResponseBody.js +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -1
- package/dist/serialization/resources/auth/types/TokenGrant.d.ts +2 -1
- package/dist/serialization/resources/auth/types/TokenGrant.js +2 -1
- package/dist/serialization/resources/auth/types/TokenRequest.d.ts +1 -1
- package/dist/serialization/resources/auth/types/TokenRequest.js +1 -1
- package/dist/serialization/resources/stt/types/TimestampGranularity.d.ts +10 -0
- package/dist/serialization/resources/stt/types/TimestampGranularity.js +41 -0
- package/dist/serialization/resources/stt/types/index.d.ts +1 -0
- package/dist/serialization/resources/stt/types/index.js +1 -0
- package/dist/serialization/resources/tts/types/Controls.d.ts +2 -2
- package/dist/serialization/resources/tts/types/Controls.js +2 -2
- package/dist/serialization/resources/tts/types/Emotion.d.ts +1 -1
- package/dist/serialization/resources/tts/types/Emotion.js +1 -27
- package/dist/serialization/resources/tts/types/EmotionDeprecated.d.ts +10 -0
- package/dist/serialization/resources/tts/types/EmotionDeprecated.js +67 -0
- package/dist/serialization/resources/tts/types/GenerationConfig.d.ts +15 -0
- package/dist/serialization/resources/tts/types/GenerationConfig.js +46 -0
- package/dist/serialization/resources/tts/types/GenerationRequest.d.ts +3 -1
- package/dist/serialization/resources/tts/types/GenerationRequest.js +3 -1
- package/dist/serialization/resources/tts/types/SseOutputFormat.d.ts +15 -0
- package/dist/serialization/resources/tts/types/SseOutputFormat.js +46 -0
- package/dist/serialization/resources/tts/types/TtsRequest.d.ts +2 -0
- package/dist/serialization/resources/tts/types/TtsRequest.js +2 -0
- package/dist/serialization/resources/tts/types/TtssseRequest.d.ts +29 -0
- package/dist/serialization/resources/tts/types/TtssseRequest.js +60 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +3 -1
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.js +3 -1
- package/dist/serialization/resources/tts/types/index.d.ts +5 -1
- package/dist/serialization/resources/tts/types/index.js +5 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/StreamingSTTClient.d.ts +22 -2
- package/dist/wrapper/StreamingSTTClient.js +124 -1
- package/dist/wrapper/SttWebsocket.d.ts +8 -3
- package/dist/wrapper/SttWebsocket.js +24 -3
- package/dist/wrapper/Websocket.js +1 -1
- package/index.d.ts +2 -0
- package/index.js +8 -1
- package/package.json +1 -1
- package/reference.md +89 -1
- package/serialization/resources/auth/types/TokenGrant.d.ts +2 -1
- package/serialization/resources/auth/types/TokenGrant.js +2 -1
- package/serialization/resources/auth/types/TokenRequest.d.ts +1 -1
- package/serialization/resources/auth/types/TokenRequest.js +1 -1
- package/serialization/resources/stt/types/TimestampGranularity.d.ts +10 -0
- package/serialization/resources/stt/types/TimestampGranularity.js +41 -0
- package/serialization/resources/stt/types/index.d.ts +1 -0
- package/serialization/resources/stt/types/index.js +1 -0
- package/serialization/resources/tts/types/Controls.d.ts +2 -2
- package/serialization/resources/tts/types/Controls.js +2 -2
- package/serialization/resources/tts/types/Emotion.d.ts +1 -1
- package/serialization/resources/tts/types/Emotion.js +1 -27
- package/serialization/resources/tts/types/EmotionDeprecated.d.ts +10 -0
- package/serialization/resources/tts/types/EmotionDeprecated.js +67 -0
- package/serialization/resources/tts/types/GenerationConfig.d.ts +15 -0
- package/serialization/resources/tts/types/GenerationConfig.js +46 -0
- package/serialization/resources/tts/types/GenerationRequest.d.ts +3 -1
- package/serialization/resources/tts/types/GenerationRequest.js +3 -1
- package/serialization/resources/tts/types/SseOutputFormat.d.ts +15 -0
- package/serialization/resources/tts/types/SseOutputFormat.js +46 -0
- package/serialization/resources/tts/types/TtsRequest.d.ts +2 -0
- package/serialization/resources/tts/types/TtsRequest.js +2 -0
- package/serialization/resources/tts/types/TtssseRequest.d.ts +29 -0
- package/serialization/resources/tts/types/TtssseRequest.js +60 -0
- package/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +3 -1
- package/serialization/resources/tts/types/WebSocketTtsRequest.js +3 -1
- package/serialization/resources/tts/types/index.d.ts +5 -1
- package/serialization/resources/tts/types/index.js +5 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/StreamingSTTClient.d.ts +22 -2
- package/wrapper/StreamingSTTClient.js +124 -1
- package/wrapper/SttWebsocket.d.ts +8 -3
- package/wrapper/SttWebsocket.js +24 -3
- package/wrapper/Websocket.js +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
2
5
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
6
|
if (k2 === undefined) k2 = k;
|
|
4
7
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -41,13 +44,118 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
41
44
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
45
|
});
|
|
43
46
|
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
44
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
51
|
exports.Stt = void 0;
|
|
52
|
+
const environments = __importStar(require("../../../../environments"));
|
|
46
53
|
const core = __importStar(require("../../../../core"));
|
|
54
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
55
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
56
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
47
57
|
class Stt {
|
|
48
58
|
constructor(_options = {}) {
|
|
49
59
|
this._options = _options;
|
|
50
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Transcribes audio files into text using Cartesia's Speech-to-Text API.
|
|
63
|
+
*
|
|
64
|
+
* Upload an audio file and receive a complete transcription response. Supports arbitrarily long audio files with automatic intelligent chunking for longer audio.
|
|
65
|
+
*
|
|
66
|
+
* **Supported audio formats:** flac, m4a, mp3, mp4, mpeg, mpga, oga, ogg, wav, webm
|
|
67
|
+
*
|
|
68
|
+
* **Response format:** Returns JSON with transcribed text, duration, and language. Include `timestamp_granularities: ["word"]` to get word-level timestamps.
|
|
69
|
+
*
|
|
70
|
+
* **Pricing:** Batch transcription is priced at **1 credit per 2 seconds** of audio processed.
|
|
71
|
+
*
|
|
72
|
+
* <Note>
|
|
73
|
+
* For migrating from the OpenAI SDK, see our [OpenAI Whisper to Cartesia Ink Migration Guide](/api-reference/stt/migrate-from-open-ai).
|
|
74
|
+
* </Note>
|
|
75
|
+
*
|
|
76
|
+
* @param {File | fs.ReadStream | Blob} file
|
|
77
|
+
* @param {Cartesia.TranscriptionRequest} request
|
|
78
|
+
* @param {Stt.RequestOptions} requestOptions - Request-specific configuration.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* await client.stt.transcribe(fs.createReadStream("/path/to/your/file"), {
|
|
82
|
+
* model: "ink-whisper",
|
|
83
|
+
* language: "en"
|
|
84
|
+
* })
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* await client.stt.transcribe(fs.createReadStream("/path/to/your/file"), {
|
|
88
|
+
* model: "ink-whisper",
|
|
89
|
+
* language: "en",
|
|
90
|
+
* timestampGranularities: ["word"]
|
|
91
|
+
* })
|
|
92
|
+
*/
|
|
93
|
+
transcribe(file, request, requestOptions) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
var _a, _b, _c, _d, _e, _f;
|
|
96
|
+
const _queryParams = {};
|
|
97
|
+
if (request.encoding != null) {
|
|
98
|
+
_queryParams["encoding"] = serializers.SttEncoding.jsonOrThrow(request.encoding, {
|
|
99
|
+
unrecognizedObjectKeys: "strip",
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (request.sampleRate != null) {
|
|
103
|
+
_queryParams["sample_rate"] = request.sampleRate.toString();
|
|
104
|
+
}
|
|
105
|
+
const _request = yield core.newFormData();
|
|
106
|
+
yield _request.appendFile("file", file);
|
|
107
|
+
_request.append("model", request.model);
|
|
108
|
+
if (request.language != null) {
|
|
109
|
+
_request.append("language", request.language);
|
|
110
|
+
}
|
|
111
|
+
if (request.timestampGranularities != null) {
|
|
112
|
+
for (const _item of request.timestampGranularities) {
|
|
113
|
+
_request.append("timestamp_granularities[]", serializers.TimestampGranularity.jsonOrThrow(_item, { unrecognizedObjectKeys: "strip" }));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const _maybeEncodedRequest = yield _request.getRequest();
|
|
117
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
118
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/stt"),
|
|
119
|
+
method: "POST",
|
|
120
|
+
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.7", "User-Agent": "@cartesia/cartesia-js/2.2.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
121
|
+
queryParameters: _queryParams,
|
|
122
|
+
requestType: "file",
|
|
123
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
124
|
+
body: _maybeEncodedRequest.body,
|
|
125
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
126
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
127
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
128
|
+
});
|
|
129
|
+
if (_response.ok) {
|
|
130
|
+
return serializers.TranscriptionResponse.parseOrThrow(_response.body, {
|
|
131
|
+
unrecognizedObjectKeys: "passthrough",
|
|
132
|
+
allowUnrecognizedUnionMembers: true,
|
|
133
|
+
allowUnrecognizedEnumValues: true,
|
|
134
|
+
skipValidation: true,
|
|
135
|
+
breadcrumbsPrefix: ["response"],
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (_response.error.reason === "status-code") {
|
|
139
|
+
throw new errors.CartesiaError({
|
|
140
|
+
statusCode: _response.error.statusCode,
|
|
141
|
+
body: _response.error.body,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
switch (_response.error.reason) {
|
|
145
|
+
case "non-json":
|
|
146
|
+
throw new errors.CartesiaError({
|
|
147
|
+
statusCode: _response.error.statusCode,
|
|
148
|
+
body: _response.error.rawBody,
|
|
149
|
+
});
|
|
150
|
+
case "timeout":
|
|
151
|
+
throw new errors.CartesiaTimeoutError("Timeout exceeded when calling POST /stt.");
|
|
152
|
+
case "unknown":
|
|
153
|
+
throw new errors.CartesiaError({
|
|
154
|
+
message: _response.error.errorMessage,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
51
159
|
_getCustomAuthorizationHeaders() {
|
|
52
160
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
161
|
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./requests";
|
|
@@ -1,5 +1,17 @@
|
|
|
1
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
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports
|
|
4
|
-
var Client_1 = require("./Client");
|
|
5
|
-
Object.defineProperty(exports, "Stt", { enumerable: true, get: function () { return Client_1.Stt; } });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Cartesia from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* model: "ink-whisper",
|
|
9
|
+
* language: "en"
|
|
10
|
+
* }
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* {
|
|
14
|
+
* model: "ink-whisper",
|
|
15
|
+
* language: "en",
|
|
16
|
+
* timestampGranularities: ["word"]
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
export interface TranscriptionRequest {
|
|
20
|
+
/**
|
|
21
|
+
* The encoding format to process the audio as. If not specified, the audio file will be decoded automatically.
|
|
22
|
+
*
|
|
23
|
+
* **Supported formats:**
|
|
24
|
+
* - `pcm_s16le` - 16-bit signed integer PCM, little-endian (recommended for best performance)
|
|
25
|
+
* - `pcm_s32le` - 32-bit signed integer PCM, little-endian
|
|
26
|
+
* - `pcm_f16le` - 16-bit floating point PCM, little-endian
|
|
27
|
+
* - `pcm_f32le` - 32-bit floating point PCM, little-endian
|
|
28
|
+
* - `pcm_mulaw` - 8-bit μ-law encoded PCM
|
|
29
|
+
* - `pcm_alaw` - 8-bit A-law encoded PCM
|
|
30
|
+
*/
|
|
31
|
+
encoding?: Cartesia.SttEncoding;
|
|
32
|
+
/**
|
|
33
|
+
* The sample rate of the audio in Hz.
|
|
34
|
+
*/
|
|
35
|
+
sampleRate?: number;
|
|
36
|
+
/** ID of the model to use for transcription. Use `ink-whisper` for the latest Cartesia Whisper model. */
|
|
37
|
+
model: string;
|
|
38
|
+
/**
|
|
39
|
+
* The language of the input audio in ISO-639-1 format. Defaults to `en`.
|
|
40
|
+
*
|
|
41
|
+
* <Accordion title="Supported languages">
|
|
42
|
+
* - `en` (English)
|
|
43
|
+
* - `zh` (Chinese)
|
|
44
|
+
* - `de` (German)
|
|
45
|
+
* - `es` (Spanish)
|
|
46
|
+
* - `ru` (Russian)
|
|
47
|
+
* - `ko` (Korean)
|
|
48
|
+
* - `fr` (French)
|
|
49
|
+
* - `ja` (Japanese)
|
|
50
|
+
* - `pt` (Portuguese)
|
|
51
|
+
* - `tr` (Turkish)
|
|
52
|
+
* - `pl` (Polish)
|
|
53
|
+
* - `ca` (Catalan)
|
|
54
|
+
* - `nl` (Dutch)
|
|
55
|
+
* - `ar` (Arabic)
|
|
56
|
+
* - `sv` (Swedish)
|
|
57
|
+
* - `it` (Italian)
|
|
58
|
+
* - `id` (Indonesian)
|
|
59
|
+
* - `hi` (Hindi)
|
|
60
|
+
* - `fi` (Finnish)
|
|
61
|
+
* - `vi` (Vietnamese)
|
|
62
|
+
* - `he` (Hebrew)
|
|
63
|
+
* - `uk` (Ukrainian)
|
|
64
|
+
* - `el` (Greek)
|
|
65
|
+
* - `ms` (Malay)
|
|
66
|
+
* - `cs` (Czech)
|
|
67
|
+
* - `ro` (Romanian)
|
|
68
|
+
* - `da` (Danish)
|
|
69
|
+
* - `hu` (Hungarian)
|
|
70
|
+
* - `ta` (Tamil)
|
|
71
|
+
* - `no` (Norwegian)
|
|
72
|
+
* - `th` (Thai)
|
|
73
|
+
* - `ur` (Urdu)
|
|
74
|
+
* - `hr` (Croatian)
|
|
75
|
+
* - `bg` (Bulgarian)
|
|
76
|
+
* - `lt` (Lithuanian)
|
|
77
|
+
* - `la` (Latin)
|
|
78
|
+
* - `mi` (Maori)
|
|
79
|
+
* - `ml` (Malayalam)
|
|
80
|
+
* - `cy` (Welsh)
|
|
81
|
+
* - `sk` (Slovak)
|
|
82
|
+
* - `te` (Telugu)
|
|
83
|
+
* - `fa` (Persian)
|
|
84
|
+
* - `lv` (Latvian)
|
|
85
|
+
* - `bn` (Bengali)
|
|
86
|
+
* - `sr` (Serbian)
|
|
87
|
+
* - `az` (Azerbaijani)
|
|
88
|
+
* - `sl` (Slovenian)
|
|
89
|
+
* - `kn` (Kannada)
|
|
90
|
+
* - `et` (Estonian)
|
|
91
|
+
* - `mk` (Macedonian)
|
|
92
|
+
* - `br` (Breton)
|
|
93
|
+
* - `eu` (Basque)
|
|
94
|
+
* - `is` (Icelandic)
|
|
95
|
+
* - `hy` (Armenian)
|
|
96
|
+
* - `ne` (Nepali)
|
|
97
|
+
* - `mn` (Mongolian)
|
|
98
|
+
* - `bs` (Bosnian)
|
|
99
|
+
* - `kk` (Kazakh)
|
|
100
|
+
* - `sq` (Albanian)
|
|
101
|
+
* - `sw` (Swahili)
|
|
102
|
+
* - `gl` (Galician)
|
|
103
|
+
* - `mr` (Marathi)
|
|
104
|
+
* - `pa` (Punjabi)
|
|
105
|
+
* - `si` (Sinhala)
|
|
106
|
+
* - `km` (Khmer)
|
|
107
|
+
* - `sn` (Shona)
|
|
108
|
+
* - `yo` (Yoruba)
|
|
109
|
+
* - `so` (Somali)
|
|
110
|
+
* - `af` (Afrikaans)
|
|
111
|
+
* - `oc` (Occitan)
|
|
112
|
+
* - `ka` (Georgian)
|
|
113
|
+
* - `be` (Belarusian)
|
|
114
|
+
* - `tg` (Tajik)
|
|
115
|
+
* - `sd` (Sindhi)
|
|
116
|
+
* - `gu` (Gujarati)
|
|
117
|
+
* - `am` (Amharic)
|
|
118
|
+
* - `yi` (Yiddish)
|
|
119
|
+
* - `lo` (Lao)
|
|
120
|
+
* - `uz` (Uzbek)
|
|
121
|
+
* - `fo` (Faroese)
|
|
122
|
+
* - `ht` (Haitian Creole)
|
|
123
|
+
* - `ps` (Pashto)
|
|
124
|
+
* - `tk` (Turkmen)
|
|
125
|
+
* - `nn` (Nynorsk)
|
|
126
|
+
* - `mt` (Maltese)
|
|
127
|
+
* - `sa` (Sanskrit)
|
|
128
|
+
* - `lb` (Luxembourgish)
|
|
129
|
+
* - `my` (Myanmar)
|
|
130
|
+
* - `bo` (Tibetan)
|
|
131
|
+
* - `tl` (Tagalog)
|
|
132
|
+
* - `mg` (Malagasy)
|
|
133
|
+
* - `as` (Assamese)
|
|
134
|
+
* - `tt` (Tatar)
|
|
135
|
+
* - `haw` (Hawaiian)
|
|
136
|
+
* - `ln` (Lingala)
|
|
137
|
+
* - `ha` (Hausa)
|
|
138
|
+
* - `ba` (Bashkir)
|
|
139
|
+
* - `jw` (Javanese)
|
|
140
|
+
* - `su` (Sundanese)
|
|
141
|
+
* - `yue` (Cantonese)
|
|
142
|
+
* </Accordion>
|
|
143
|
+
*/
|
|
144
|
+
language?: string;
|
|
145
|
+
/** The timestamp granularities to populate for this transcription. Currently only `word` level timestamps are supported. */
|
|
146
|
+
timestampGranularities?: Cartesia.TimestampGranularity[];
|
|
147
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type TranscriptionRequest } from "./TranscriptionRequest";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The granularity of timestamps to include in the response.
|
|
6
|
+
*
|
|
7
|
+
* Currently only `word` level timestamps are supported, providing start and end times for each word.
|
|
8
|
+
*/
|
|
9
|
+
export type TimestampGranularity = "word";
|
|
10
|
+
export declare const TimestampGranularity: {
|
|
11
|
+
readonly Word: "word";
|
|
12
|
+
};
|
|
@@ -15,7 +15,7 @@ export interface TranscriptMessage {
|
|
|
15
15
|
isFinal: boolean;
|
|
16
16
|
/** The duration of the audio transcribed so far, in seconds. */
|
|
17
17
|
duration?: number;
|
|
18
|
-
/** The
|
|
18
|
+
/** The specified language of the input audio. */
|
|
19
19
|
language?: string;
|
|
20
20
|
/** Word-level timestamps showing the start and end time of each word in seconds. Always included in streaming responses. */
|
|
21
21
|
words?: Cartesia.TranscriptionWord[];
|
|
@@ -5,10 +5,10 @@ import * as Cartesia from "../../../index";
|
|
|
5
5
|
export interface TranscriptionResponse {
|
|
6
6
|
/** The transcribed text. */
|
|
7
7
|
text: string;
|
|
8
|
-
/** The
|
|
8
|
+
/** The specified language of the input audio. */
|
|
9
9
|
language?: string;
|
|
10
10
|
/** The duration of the input audio in seconds. */
|
|
11
11
|
duration?: number;
|
|
12
|
-
/** Word-level timestamps
|
|
12
|
+
/** Word-level timestamps showing the start and end time of each word. Only included when `[word]` is passed into `timestamp_granularities[]`. */
|
|
13
13
|
words?: Cartesia.TranscriptionWord[];
|
|
14
14
|
}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./TimestampGranularity"), exports);
|
|
17
18
|
__exportStar(require("./TranscriptionWord"), exports);
|
|
18
19
|
__exportStar(require("./TranscriptionResponse"), exports);
|
|
19
20
|
__exportStar(require("./StreamingTranscriptionResponse"), exports);
|
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
import * as environments from "../../../../environments";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
6
|
import * as Cartesia from "../../../index";
|
|
7
|
+
import * as stream from "stream";
|
|
7
8
|
export declare namespace Tts {
|
|
8
9
|
interface Options {
|
|
9
10
|
environment?: core.Supplier<environments.CartesiaEnvironment | string>;
|
|
11
|
+
/** Specify a custom URL to connect the client to. */
|
|
12
|
+
baseUrl?: core.Supplier<string>;
|
|
10
13
|
apiKey?: core.Supplier<string | undefined>;
|
|
11
14
|
/** Override the Cartesia-Version header */
|
|
12
15
|
cartesiaVersion?: "2024-06-10";
|
|
@@ -21,13 +24,15 @@ export declare namespace Tts {
|
|
|
21
24
|
abortSignal?: AbortSignal;
|
|
22
25
|
/** Override the Cartesia-Version header */
|
|
23
26
|
cartesiaVersion?: "2024-06-10";
|
|
27
|
+
/** Additional headers to include in the request. */
|
|
28
|
+
headers?: Record<string, string>;
|
|
24
29
|
}
|
|
25
30
|
}
|
|
26
31
|
export declare class Tts {
|
|
27
32
|
protected readonly _options: Tts.Options;
|
|
28
33
|
constructor(_options?: Tts.Options);
|
|
29
|
-
bytes(request: Cartesia.TtsRequest, requestOptions?: Tts.RequestOptions): Promise<
|
|
30
|
-
sse(request: Cartesia.
|
|
34
|
+
bytes(request: Cartesia.TtsRequest, requestOptions?: Tts.RequestOptions): Promise<stream.Readable>;
|
|
35
|
+
sse(request: Cartesia.TtssseRequest, requestOptions?: Tts.RequestOptions): Promise<core.Stream<Cartesia.WebSocketResponse>>;
|
|
31
36
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
32
37
|
"X-API-Key": string | undefined;
|
|
33
38
|
}>;
|
|
@@ -60,15 +60,15 @@ class Tts {
|
|
|
60
60
|
}
|
|
61
61
|
bytes(request, requestOptions) {
|
|
62
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
var _a, _b, _c, _d, _e;
|
|
63
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64
64
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
65
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
65
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/tts/bytes"),
|
|
66
66
|
method: "POST",
|
|
67
|
-
headers: Object.assign({ "Cartesia-Version": (
|
|
67
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.7", "User-Agent": "@cartesia/cartesia-js/2.2.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
68
68
|
contentType: "application/json",
|
|
69
69
|
requestType: "json",
|
|
70
70
|
body: serializers.TtsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
71
|
-
responseType: "
|
|
71
|
+
responseType: "streaming",
|
|
72
72
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
73
73
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
74
74
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -99,14 +99,14 @@ class Tts {
|
|
|
99
99
|
}
|
|
100
100
|
sse(request, requestOptions) {
|
|
101
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
var _a, _b, _c, _d, _e;
|
|
102
|
+
var _a, _b, _c, _d, _e, _f;
|
|
103
103
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
104
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
104
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/tts/sse"),
|
|
105
105
|
method: "POST",
|
|
106
|
-
headers: Object.assign({ "Cartesia-Version": (
|
|
106
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.7", "User-Agent": "@cartesia/cartesia-js/2.2.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
107
107
|
contentType: "application/json",
|
|
108
108
|
requestType: "json",
|
|
109
|
-
body: serializers.
|
|
109
|
+
body: serializers.TtssseRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
110
110
|
responseType: "sse",
|
|
111
111
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
112
112
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -2,37 +2,6 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Supported emotions are: anger, positivity, surprise, sadness, and curiosity.
|
|
8
|
-
*
|
|
9
|
-
* Supported levels are: lowest, low, (omit), high, highest.
|
|
5
|
+
* Guide the emotion of the generated speech.
|
|
10
6
|
*/
|
|
11
|
-
export type Emotion =
|
|
12
|
-
export declare const Emotion: {
|
|
13
|
-
readonly AngerLowest: "anger:lowest";
|
|
14
|
-
readonly AngerLow: "anger:low";
|
|
15
|
-
readonly Anger: "anger";
|
|
16
|
-
readonly AngerHigh: "anger:high";
|
|
17
|
-
readonly AngerHighest: "anger:highest";
|
|
18
|
-
readonly PositivityLowest: "positivity:lowest";
|
|
19
|
-
readonly PositivityLow: "positivity:low";
|
|
20
|
-
readonly Positivity: "positivity";
|
|
21
|
-
readonly PositivityHigh: "positivity:high";
|
|
22
|
-
readonly PositivityHighest: "positivity:highest";
|
|
23
|
-
readonly SurpriseLowest: "surprise:lowest";
|
|
24
|
-
readonly SurpriseLow: "surprise:low";
|
|
25
|
-
readonly Surprise: "surprise";
|
|
26
|
-
readonly SurpriseHigh: "surprise:high";
|
|
27
|
-
readonly SurpriseHighest: "surprise:highest";
|
|
28
|
-
readonly SadnessLowest: "sadness:lowest";
|
|
29
|
-
readonly SadnessLow: "sadness:low";
|
|
30
|
-
readonly Sadness: "sadness";
|
|
31
|
-
readonly SadnessHigh: "sadness:high";
|
|
32
|
-
readonly SadnessHighest: "sadness:highest";
|
|
33
|
-
readonly CuriosityLowest: "curiosity:lowest";
|
|
34
|
-
readonly CuriosityLow: "curiosity:low";
|
|
35
|
-
readonly Curiosity: "curiosity";
|
|
36
|
-
readonly CuriosityHigh: "curiosity:high";
|
|
37
|
-
readonly CuriosityHighest: "curiosity:highest";
|
|
38
|
-
};
|
|
7
|
+
export type Emotion = string;
|
|
@@ -3,31 +3,3 @@
|
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Emotion = void 0;
|
|
7
|
-
exports.Emotion = {
|
|
8
|
-
AngerLowest: "anger:lowest",
|
|
9
|
-
AngerLow: "anger:low",
|
|
10
|
-
Anger: "anger",
|
|
11
|
-
AngerHigh: "anger:high",
|
|
12
|
-
AngerHighest: "anger:highest",
|
|
13
|
-
PositivityLowest: "positivity:lowest",
|
|
14
|
-
PositivityLow: "positivity:low",
|
|
15
|
-
Positivity: "positivity",
|
|
16
|
-
PositivityHigh: "positivity:high",
|
|
17
|
-
PositivityHighest: "positivity:highest",
|
|
18
|
-
SurpriseLowest: "surprise:lowest",
|
|
19
|
-
SurpriseLow: "surprise:low",
|
|
20
|
-
Surprise: "surprise",
|
|
21
|
-
SurpriseHigh: "surprise:high",
|
|
22
|
-
SurpriseHighest: "surprise:highest",
|
|
23
|
-
SadnessLowest: "sadness:lowest",
|
|
24
|
-
SadnessLow: "sadness:low",
|
|
25
|
-
Sadness: "sadness",
|
|
26
|
-
SadnessHigh: "sadness:high",
|
|
27
|
-
SadnessHighest: "sadness:highest",
|
|
28
|
-
CuriosityLowest: "curiosity:lowest",
|
|
29
|
-
CuriosityLow: "curiosity:low",
|
|
30
|
-
Curiosity: "curiosity",
|
|
31
|
-
CuriosityHigh: "curiosity:high",
|
|
32
|
-
CuriosityHighest: "curiosity:highest",
|
|
33
|
-
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* An array of emotion:level tags.
|
|
6
|
+
*
|
|
7
|
+
* Supported emotions are: anger, positivity, surprise, sadness, and curiosity.
|
|
8
|
+
*
|
|
9
|
+
* Supported levels are: lowest, low, (omit), high, highest.
|
|
10
|
+
*/
|
|
11
|
+
export type EmotionDeprecated = "anger:lowest" | "anger:low" | "anger" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:low" | "surprise" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "sadness" | "sadness:high" | "sadness:highest" | "curiosity:lowest" | "curiosity:low" | "curiosity" | "curiosity:high" | "curiosity:highest";
|
|
12
|
+
export declare const EmotionDeprecated: {
|
|
13
|
+
readonly AngerLowest: "anger:lowest";
|
|
14
|
+
readonly AngerLow: "anger:low";
|
|
15
|
+
readonly Anger: "anger";
|
|
16
|
+
readonly AngerHigh: "anger:high";
|
|
17
|
+
readonly AngerHighest: "anger:highest";
|
|
18
|
+
readonly PositivityLowest: "positivity:lowest";
|
|
19
|
+
readonly PositivityLow: "positivity:low";
|
|
20
|
+
readonly Positivity: "positivity";
|
|
21
|
+
readonly PositivityHigh: "positivity:high";
|
|
22
|
+
readonly PositivityHighest: "positivity:highest";
|
|
23
|
+
readonly SurpriseLowest: "surprise:lowest";
|
|
24
|
+
readonly SurpriseLow: "surprise:low";
|
|
25
|
+
readonly Surprise: "surprise";
|
|
26
|
+
readonly SurpriseHigh: "surprise:high";
|
|
27
|
+
readonly SurpriseHighest: "surprise:highest";
|
|
28
|
+
readonly SadnessLowest: "sadness:lowest";
|
|
29
|
+
readonly SadnessLow: "sadness:low";
|
|
30
|
+
readonly Sadness: "sadness";
|
|
31
|
+
readonly SadnessHigh: "sadness:high";
|
|
32
|
+
readonly SadnessHighest: "sadness:highest";
|
|
33
|
+
readonly CuriosityLowest: "curiosity:lowest";
|
|
34
|
+
readonly CuriosityLow: "curiosity:low";
|
|
35
|
+
readonly Curiosity: "curiosity";
|
|
36
|
+
readonly CuriosityHigh: "curiosity:high";
|
|
37
|
+
readonly CuriosityHighest: "curiosity:highest";
|
|
38
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EmotionDeprecated = void 0;
|
|
7
|
+
exports.EmotionDeprecated = {
|
|
8
|
+
AngerLowest: "anger:lowest",
|
|
9
|
+
AngerLow: "anger:low",
|
|
10
|
+
Anger: "anger",
|
|
11
|
+
AngerHigh: "anger:high",
|
|
12
|
+
AngerHighest: "anger:highest",
|
|
13
|
+
PositivityLowest: "positivity:lowest",
|
|
14
|
+
PositivityLow: "positivity:low",
|
|
15
|
+
Positivity: "positivity",
|
|
16
|
+
PositivityHigh: "positivity:high",
|
|
17
|
+
PositivityHighest: "positivity:highest",
|
|
18
|
+
SurpriseLowest: "surprise:lowest",
|
|
19
|
+
SurpriseLow: "surprise:low",
|
|
20
|
+
Surprise: "surprise",
|
|
21
|
+
SurpriseHigh: "surprise:high",
|
|
22
|
+
SurpriseHighest: "surprise:highest",
|
|
23
|
+
SadnessLowest: "sadness:lowest",
|
|
24
|
+
SadnessLow: "sadness:low",
|
|
25
|
+
Sadness: "sadness",
|
|
26
|
+
SadnessHigh: "sadness:high",
|
|
27
|
+
SadnessHighest: "sadness:highest",
|
|
28
|
+
CuriosityLowest: "curiosity:lowest",
|
|
29
|
+
CuriosityLow: "curiosity:low",
|
|
30
|
+
Curiosity: "curiosity",
|
|
31
|
+
CuriosityHigh: "curiosity:high",
|
|
32
|
+
CuriosityHighest: "curiosity:highest",
|
|
33
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Cartesia from "../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* Configure the various attributes of the generated speech. These controls only for `sonic-3` and have no effect on earlier models.
|
|
7
|
+
*/
|
|
8
|
+
export interface GenerationConfig {
|
|
9
|
+
/** Adjust the volume of the generated speech between 0.5x and 2.0x the original volume (default is 1.0x). Valid values are between 0.5 and 2.0 inclusive. */
|
|
10
|
+
volume?: number;
|
|
11
|
+
/** Adjust the speed of the generated speech between 0.6x and 1.5x the original speed (default is 1.0x). Valid values are between 0.6 and 1.5 inclusive. */
|
|
12
|
+
speed?: number;
|
|
13
|
+
/** Guide the emotion of the generated speech. */
|
|
14
|
+
emotion?: Cartesia.Emotion;
|
|
15
|
+
}
|