@supertone/supertone 0.1.5 → 0.2.0
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 +9 -310
- package/custom_test/test_real_api.ts +140 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/models/apiconverttexttospeechusingcharacterrequest.d.ts +5 -0
- package/dist/commonjs/models/apiconverttexttospeechusingcharacterrequest.d.ts.map +1 -1
- package/dist/commonjs/models/apiconverttexttospeechusingcharacterrequest.js +4 -0
- package/dist/commonjs/models/apiconverttexttospeechusingcharacterrequest.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/models/apiconverttexttospeechusingcharacterrequest.d.ts +5 -0
- package/dist/esm/models/apiconverttexttospeechusingcharacterrequest.d.ts.map +1 -1
- package/dist/esm/models/apiconverttexttospeechusingcharacterrequest.js +4 -0
- package/dist/esm/models/apiconverttexttospeechusingcharacterrequest.js.map +1 -1
- package/jsr.json +1 -1
- package/openapi.json +5 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/apiconverttexttospeechusingcharacterrequest.ts +9 -0
package/README.md
CHANGED
|
@@ -8,58 +8,33 @@
|
|
|
8
8
|
Supertone Public API: Supertone API is a RESTful API for using our state-of-the-art AI voice models.
|
|
9
9
|
<!-- End Summary [summary] -->
|
|
10
10
|
|
|
11
|
-
<!-- Start Table of Contents [toc] -->
|
|
12
|
-
## Table of Contents
|
|
13
|
-
<!-- $toc-max-depth=2 -->
|
|
14
|
-
* [Supertone TypeScript Library](#supertone-typescript-library)
|
|
15
|
-
* [SDK Installation](#sdk-installation)
|
|
16
|
-
* [Requirements](#requirements)
|
|
17
|
-
* [SDK Example Usage](#sdk-example-usage)
|
|
18
|
-
* [Authentication](#authentication)
|
|
19
|
-
* [Models](#models)
|
|
20
|
-
* [Available Resources and Operations](#available-resources-and-operations)
|
|
21
|
-
* [Standalone functions](#standalone-functions)
|
|
22
|
-
* [File uploads](#file-uploads)
|
|
23
|
-
* [Retries](#retries)
|
|
24
|
-
* [Error Handling](#error-handling)
|
|
25
|
-
* [Additional Example Code](#additional-example-code)
|
|
26
|
-
* [Server Selection](#server-selection)
|
|
27
|
-
* [Custom HTTP Client](#custom-http-client)
|
|
28
|
-
* [Debugging](#debugging)
|
|
29
|
-
|
|
30
|
-
<!-- End Table of Contents [toc] -->
|
|
31
|
-
|
|
32
11
|
<!-- Start SDK Installation [installation] -->
|
|
33
12
|
## SDK Installation
|
|
34
13
|
|
|
35
|
-
> [!TIP]
|
|
36
|
-
> To finish publishing your SDK to npm and others you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).
|
|
37
|
-
|
|
38
|
-
|
|
39
14
|
The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
|
|
40
15
|
|
|
41
16
|
### NPM
|
|
42
17
|
|
|
43
18
|
```bash
|
|
44
|
-
npm add
|
|
19
|
+
npm add @supertone/supertone
|
|
45
20
|
```
|
|
46
21
|
|
|
47
22
|
### PNPM
|
|
48
23
|
|
|
49
24
|
```bash
|
|
50
|
-
pnpm add
|
|
25
|
+
pnpm add @supertone/supertone
|
|
51
26
|
```
|
|
52
27
|
|
|
53
28
|
### Bun
|
|
54
29
|
|
|
55
30
|
```bash
|
|
56
|
-
bun add
|
|
31
|
+
bun add @supertone/supertone
|
|
57
32
|
```
|
|
58
33
|
|
|
59
34
|
### Yarn
|
|
60
35
|
|
|
61
36
|
```bash
|
|
62
|
-
yarn add
|
|
37
|
+
yarn add @supertone/supertone zod
|
|
63
38
|
|
|
64
39
|
# Note that Yarn does not install peer dependencies automatically. You will need
|
|
65
40
|
# to install zod as shown above.
|
|
@@ -159,7 +134,11 @@ Supertone’s Text-to-Speech API provides multiple TTS models, each with differe
|
|
|
159
134
|
> **Streaming Support**
|
|
160
135
|
>
|
|
161
136
|
> Streaming TTS using the `stream_speech` endpoint is **only available for the `sona_speech_1` model**.
|
|
162
|
-
|
|
137
|
+
>
|
|
138
|
+
> **Normalized Text Support**
|
|
139
|
+
>
|
|
140
|
+
> The `normalized_text` parameter is supported **only with the `sona_speech_2` and `sona_speech_2_flash` models**.
|
|
141
|
+
> It is ignored when used with other models.
|
|
163
142
|
---
|
|
164
143
|
|
|
165
144
|
### Supported Languages by Model
|
|
@@ -207,188 +186,6 @@ Some TTS models support optional voice settings that allow fine control over out
|
|
|
207
186
|
|
|
208
187
|
<!-- End Models [models] -->
|
|
209
188
|
|
|
210
|
-
<!-- Start Available Resources and Operations [operations] -->
|
|
211
|
-
## Available Resources and Operations
|
|
212
|
-
|
|
213
|
-
<details open>
|
|
214
|
-
<summary>Available methods</summary>
|
|
215
|
-
|
|
216
|
-
### [customVoices](docs/sdks/customvoices/README.md)
|
|
217
|
-
|
|
218
|
-
* [createClonedVoice](docs/sdks/customvoices/README.md#createclonedvoice) - Create cloned voice
|
|
219
|
-
* [listCustomVoices](docs/sdks/customvoices/README.md#listcustomvoices) - Gets custom (cloned) voices
|
|
220
|
-
* [searchCustomVoices](docs/sdks/customvoices/README.md#searchcustomvoices) - Search custom (cloned) voices
|
|
221
|
-
* [getCustomVoice](docs/sdks/customvoices/README.md#getcustomvoice) - Get single cloned voice
|
|
222
|
-
* [editCustomVoice](docs/sdks/customvoices/README.md#editcustomvoice) - Update cloned voice (partial update)
|
|
223
|
-
* [deleteCustomVoice](docs/sdks/customvoices/README.md#deletecustomvoice) - Delete cloned voice
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
### [textToSpeech](docs/sdks/texttospeech/README.md)
|
|
227
|
-
|
|
228
|
-
* [createSpeech](docs/sdks/texttospeech/README.md#createspeech) - Convert text to speech
|
|
229
|
-
* [streamSpeech](docs/sdks/texttospeech/README.md#streamspeech) - Convert text to speech with streaming response
|
|
230
|
-
* [predictDuration](docs/sdks/texttospeech/README.md#predictduration) - Predict text-to-speech duration
|
|
231
|
-
|
|
232
|
-
### [usage](docs/sdks/usage/README.md)
|
|
233
|
-
|
|
234
|
-
* [getVoiceUsage](docs/sdks/usage/README.md#getvoiceusage) - Retrieve TTS API usage data
|
|
235
|
-
* [getUsage](docs/sdks/usage/README.md#getusage) - Retrieve advanced API usage analytics
|
|
236
|
-
* [getCreditBalance](docs/sdks/usage/README.md#getcreditbalance) - Retrieve credit balance
|
|
237
|
-
|
|
238
|
-
### [voices](docs/sdks/voices/README.md)
|
|
239
|
-
|
|
240
|
-
* [listVoices](docs/sdks/voices/README.md#listvoices) - Gets available voices
|
|
241
|
-
* [searchVoices](docs/sdks/voices/README.md#searchvoices) - Search voices.
|
|
242
|
-
* [getVoice](docs/sdks/voices/README.md#getvoice) - Get voice details by ID
|
|
243
|
-
|
|
244
|
-
</details>
|
|
245
|
-
<!-- End Available Resources and Operations [operations] -->
|
|
246
|
-
|
|
247
|
-
<!-- Start Standalone functions [standalone-funcs] -->
|
|
248
|
-
## Standalone functions
|
|
249
|
-
|
|
250
|
-
All the methods listed above are available as standalone functions. These
|
|
251
|
-
functions are ideal for use in applications running in the browser, serverless
|
|
252
|
-
runtimes or other environments where application bundle size is a primary
|
|
253
|
-
concern. When using a bundler to build your application, all unused
|
|
254
|
-
functionality will be either excluded from the final bundle or tree-shaken away.
|
|
255
|
-
|
|
256
|
-
To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
257
|
-
|
|
258
|
-
<details>
|
|
259
|
-
|
|
260
|
-
<summary>Available standalone functions</summary>
|
|
261
|
-
|
|
262
|
-
- [`customVoicesCreateClonedVoice`](docs/sdks/customvoices/README.md#createclonedvoice) - Create cloned voice
|
|
263
|
-
- [`customVoicesDeleteCustomVoice`](docs/sdks/customvoices/README.md#deletecustomvoice) - Delete cloned voice
|
|
264
|
-
- [`customVoicesEditCustomVoice`](docs/sdks/customvoices/README.md#editcustomvoice) - Update cloned voice (partial update)
|
|
265
|
-
- [`customVoicesGetCustomVoice`](docs/sdks/customvoices/README.md#getcustomvoice) - Get single cloned voice
|
|
266
|
-
- [`customVoicesListCustomVoices`](docs/sdks/customvoices/README.md#listcustomvoices) - Gets custom (cloned) voices
|
|
267
|
-
- [`customVoicesSearchCustomVoices`](docs/sdks/customvoices/README.md#searchcustomvoices) - Search custom (cloned) voices
|
|
268
|
-
- [`textToSpeechCreateSpeech`](docs/sdks/texttospeech/README.md#createspeech) - Convert text to speech
|
|
269
|
-
- [`textToSpeechPredictDuration`](docs/sdks/texttospeech/README.md#predictduration) - Predict text-to-speech duration
|
|
270
|
-
- [`textToSpeechStreamSpeech`](docs/sdks/texttospeech/README.md#streamspeech) - Convert text to speech with streaming response
|
|
271
|
-
- [`usageGetCreditBalance`](docs/sdks/usage/README.md#getcreditbalance) - Retrieve credit balance
|
|
272
|
-
- [`usageGetUsage`](docs/sdks/usage/README.md#getusage) - Retrieve advanced API usage analytics
|
|
273
|
-
- [`usageGetVoiceUsage`](docs/sdks/usage/README.md#getvoiceusage) - Retrieve TTS API usage data
|
|
274
|
-
- [`voicesGetVoice`](docs/sdks/voices/README.md#getvoice) - Get voice details by ID
|
|
275
|
-
- [`voicesListVoices`](docs/sdks/voices/README.md#listvoices) - Gets available voices
|
|
276
|
-
- [`voicesSearchVoices`](docs/sdks/voices/README.md#searchvoices) - Search voices.
|
|
277
|
-
|
|
278
|
-
</details>
|
|
279
|
-
<!-- End Standalone functions [standalone-funcs] -->
|
|
280
|
-
|
|
281
|
-
<!-- Start File uploads [file-upload] -->
|
|
282
|
-
## File uploads
|
|
283
|
-
|
|
284
|
-
Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
|
|
285
|
-
|
|
286
|
-
> [!TIP]
|
|
287
|
-
>
|
|
288
|
-
> Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
|
|
289
|
-
>
|
|
290
|
-
> - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).
|
|
291
|
-
> - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.
|
|
292
|
-
> - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `<input type="file">` element.
|
|
293
|
-
> - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).
|
|
294
|
-
|
|
295
|
-
```typescript
|
|
296
|
-
import { Supertone } from "@supertone/supertone";
|
|
297
|
-
import { openAsBlob } from "node:fs";
|
|
298
|
-
|
|
299
|
-
const supertone = new Supertone({
|
|
300
|
-
apiKey: "<YOUR_API_KEY_HERE>",
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
async function run() {
|
|
304
|
-
const result = await supertone.customVoices.createClonedVoice({
|
|
305
|
-
files: await openAsBlob("example.file"),
|
|
306
|
-
name: "<value>",
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
console.log(result);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
run();
|
|
313
|
-
|
|
314
|
-
```
|
|
315
|
-
<!-- End File uploads [file-upload] -->
|
|
316
|
-
|
|
317
|
-
<!-- Start Retries [retries] -->
|
|
318
|
-
## Retries
|
|
319
|
-
|
|
320
|
-
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
|
|
321
|
-
|
|
322
|
-
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
|
|
323
|
-
```typescript
|
|
324
|
-
import { Supertone } from "@supertone/supertone";
|
|
325
|
-
|
|
326
|
-
const supertone = new Supertone({
|
|
327
|
-
apiKey: "<YOUR_API_KEY_HERE>",
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
async function run() {
|
|
331
|
-
const result = await supertone.textToSpeech.createSpeech({
|
|
332
|
-
voiceId: "<id>",
|
|
333
|
-
apiConvertTextToSpeechUsingCharacterRequest: {
|
|
334
|
-
text: "<value>",
|
|
335
|
-
language: "ja",
|
|
336
|
-
},
|
|
337
|
-
}, {
|
|
338
|
-
retries: {
|
|
339
|
-
strategy: "backoff",
|
|
340
|
-
backoff: {
|
|
341
|
-
initialInterval: 1,
|
|
342
|
-
maxInterval: 50,
|
|
343
|
-
exponent: 1.1,
|
|
344
|
-
maxElapsedTime: 100,
|
|
345
|
-
},
|
|
346
|
-
retryConnectionErrors: false,
|
|
347
|
-
},
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
console.log(result);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
run();
|
|
354
|
-
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
|
|
358
|
-
```typescript
|
|
359
|
-
import { Supertone } from "@supertone/supertone";
|
|
360
|
-
|
|
361
|
-
const supertone = new Supertone({
|
|
362
|
-
retryConfig: {
|
|
363
|
-
strategy: "backoff",
|
|
364
|
-
backoff: {
|
|
365
|
-
initialInterval: 1,
|
|
366
|
-
maxInterval: 50,
|
|
367
|
-
exponent: 1.1,
|
|
368
|
-
maxElapsedTime: 100,
|
|
369
|
-
},
|
|
370
|
-
retryConnectionErrors: false,
|
|
371
|
-
},
|
|
372
|
-
apiKey: "<YOUR_API_KEY_HERE>",
|
|
373
|
-
});
|
|
374
|
-
|
|
375
|
-
async function run() {
|
|
376
|
-
const result = await supertone.textToSpeech.createSpeech({
|
|
377
|
-
voiceId: "<id>",
|
|
378
|
-
apiConvertTextToSpeechUsingCharacterRequest: {
|
|
379
|
-
text: "<value>",
|
|
380
|
-
language: "ja",
|
|
381
|
-
},
|
|
382
|
-
});
|
|
383
|
-
|
|
384
|
-
console.log(result);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
run();
|
|
388
|
-
|
|
389
|
-
```
|
|
390
|
-
<!-- End Retries [retries] -->
|
|
391
|
-
|
|
392
189
|
<!-- Start Error Handling [errors] -->
|
|
393
190
|
## Error Handling
|
|
394
191
|
|
|
@@ -486,102 +283,4 @@ Additional example code can be found in the [examples](https://github.com/supert
|
|
|
486
283
|
|
|
487
284
|
<!-- End Additional Example Code [examples] -->
|
|
488
285
|
|
|
489
|
-
|
|
490
|
-
<!-- Start Server Selection [server] -->
|
|
491
|
-
## Server Selection
|
|
492
|
-
|
|
493
|
-
### Override Server URL Per-Client
|
|
494
|
-
|
|
495
|
-
The default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
|
|
496
|
-
```typescript
|
|
497
|
-
import { Supertone } from "@supertone/supertone";
|
|
498
|
-
|
|
499
|
-
const supertone = new Supertone({
|
|
500
|
-
serverURL: "https://supertoneapi.com",
|
|
501
|
-
apiKey: "<YOUR_API_KEY_HERE>",
|
|
502
|
-
});
|
|
503
|
-
|
|
504
|
-
async function run() {
|
|
505
|
-
const result = await supertone.textToSpeech.createSpeech({
|
|
506
|
-
voiceId: "<id>",
|
|
507
|
-
apiConvertTextToSpeechUsingCharacterRequest: {
|
|
508
|
-
text: "<value>",
|
|
509
|
-
language: "ja",
|
|
510
|
-
},
|
|
511
|
-
});
|
|
512
|
-
|
|
513
|
-
console.log(result);
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
run();
|
|
517
|
-
|
|
518
|
-
```
|
|
519
|
-
<!-- End Server Selection [server] -->
|
|
520
|
-
|
|
521
|
-
<!-- Start Custom HTTP Client [http-client] -->
|
|
522
|
-
## Custom HTTP Client
|
|
523
|
-
|
|
524
|
-
The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
|
|
525
|
-
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
|
|
526
|
-
client is a thin wrapper around `fetch` and provides the ability to attach hooks
|
|
527
|
-
around the request lifecycle that can be used to modify the request or handle
|
|
528
|
-
errors and response.
|
|
529
|
-
|
|
530
|
-
The `HTTPClient` constructor takes an optional `fetcher` argument that can be
|
|
531
|
-
used to integrate a third-party HTTP client or when writing tests to mock out
|
|
532
|
-
the HTTP client and feed in fixtures.
|
|
533
|
-
|
|
534
|
-
The following example shows how to use the `"beforeRequest"` hook to to add a
|
|
535
|
-
custom header and a timeout to requests and how to use the `"requestError"` hook
|
|
536
|
-
to log errors:
|
|
537
|
-
|
|
538
|
-
```typescript
|
|
539
|
-
import { Supertone } from "@supertone/supertone";
|
|
540
|
-
import { HTTPClient } from "@supertone/supertone/lib/http";
|
|
541
|
-
|
|
542
|
-
const httpClient = new HTTPClient({
|
|
543
|
-
// fetcher takes a function that has the same signature as native `fetch`.
|
|
544
|
-
fetcher: (request) => {
|
|
545
|
-
return fetch(request);
|
|
546
|
-
}
|
|
547
|
-
});
|
|
548
|
-
|
|
549
|
-
httpClient.addHook("beforeRequest", (request) => {
|
|
550
|
-
const nextRequest = new Request(request, {
|
|
551
|
-
signal: request.signal || AbortSignal.timeout(5000)
|
|
552
|
-
});
|
|
553
|
-
|
|
554
|
-
nextRequest.headers.set("x-custom-header", "custom value");
|
|
555
|
-
|
|
556
|
-
return nextRequest;
|
|
557
|
-
});
|
|
558
|
-
|
|
559
|
-
httpClient.addHook("requestError", (error, request) => {
|
|
560
|
-
console.group("Request Error");
|
|
561
|
-
console.log("Reason:", `${error}`);
|
|
562
|
-
console.log("Endpoint:", `${request.method} ${request.url}`);
|
|
563
|
-
console.groupEnd();
|
|
564
|
-
});
|
|
565
|
-
|
|
566
|
-
const sdk = new Supertone({ httpClient });
|
|
567
|
-
```
|
|
568
|
-
<!-- End Custom HTTP Client [http-client] -->
|
|
569
|
-
|
|
570
|
-
<!-- Start Debugging [debug] -->
|
|
571
|
-
## Debugging
|
|
572
|
-
|
|
573
|
-
You can setup your SDK to emit debug logs for SDK requests and responses.
|
|
574
|
-
|
|
575
|
-
You can pass a logger that matches `console`'s interface as an SDK option.
|
|
576
|
-
|
|
577
|
-
> [!WARNING]
|
|
578
|
-
> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
|
|
579
|
-
|
|
580
|
-
```typescript
|
|
581
|
-
import { Supertone } from "@supertone/supertone";
|
|
582
|
-
|
|
583
|
-
const sdk = new Supertone({ debugLogger: console });
|
|
584
|
-
```
|
|
585
|
-
<!-- End Debugging [debug] -->
|
|
586
|
-
|
|
587
286
|
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
@@ -1790,6 +1790,132 @@ async function testCreateSpeechWithSonaSpeech2Flash(
|
|
|
1790
1790
|
}
|
|
1791
1791
|
}
|
|
1792
1792
|
|
|
1793
|
+
/**
|
|
1794
|
+
* Test TTS with sona_speech_2 model using normalized_text parameter
|
|
1795
|
+
* normalized_text allows specifying the pronunciation explicitly (e.g., kanji -> hiragana)
|
|
1796
|
+
*/
|
|
1797
|
+
async function testCreateSpeechWithNormalizedTextSonaSpeech2(
|
|
1798
|
+
voiceId: string | null
|
|
1799
|
+
): Promise<[boolean, any]> {
|
|
1800
|
+
console.log("📝 TTS with normalized_text Parameter Test (sona_speech_2)");
|
|
1801
|
+
|
|
1802
|
+
if (!voiceId) {
|
|
1803
|
+
console.log(" ⚠️ No voice ID available");
|
|
1804
|
+
return [false, null];
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
try {
|
|
1808
|
+
const { Supertone } = await import("../src/index.js");
|
|
1809
|
+
const models = await import("../src/models/index.js");
|
|
1810
|
+
const client = new Supertone({ apiKey: API_KEY });
|
|
1811
|
+
|
|
1812
|
+
// Japanese text with kanji, and normalized_text with hiragana pronunciation
|
|
1813
|
+
const text = "今日はどんな一日だったの?";
|
|
1814
|
+
const normalizedText = "きょうはどんないちにちだったの?";
|
|
1815
|
+
|
|
1816
|
+
console.log(` 🔍 Creating speech with normalized_text`);
|
|
1817
|
+
console.log(` Original text: ${text}`);
|
|
1818
|
+
console.log(` Normalized text: ${normalizedText}`);
|
|
1819
|
+
console.log(` Model: sona_speech_2`);
|
|
1820
|
+
console.log(" ⚠️ This test consumes credits!");
|
|
1821
|
+
|
|
1822
|
+
const startTime = Date.now();
|
|
1823
|
+
const response = await client.textToSpeech.createSpeech({
|
|
1824
|
+
voiceId,
|
|
1825
|
+
apiConvertTextToSpeechUsingCharacterRequest: {
|
|
1826
|
+
text,
|
|
1827
|
+
normalizedText,
|
|
1828
|
+
language: models.APIConvertTextToSpeechUsingCharacterRequestLanguage.Ja,
|
|
1829
|
+
outputFormat:
|
|
1830
|
+
models.APIConvertTextToSpeechUsingCharacterRequestOutputFormat.Wav,
|
|
1831
|
+
model:
|
|
1832
|
+
models.APIConvertTextToSpeechUsingCharacterRequestModel.SonaSpeech2,
|
|
1833
|
+
},
|
|
1834
|
+
});
|
|
1835
|
+
const elapsed = Date.now() - startTime;
|
|
1836
|
+
|
|
1837
|
+
console.log(` ✅ sona_speech_2 with normalized_text success`);
|
|
1838
|
+
console.log(` ⏱️ Response time: ${elapsed}ms`);
|
|
1839
|
+
|
|
1840
|
+
if (response.result) {
|
|
1841
|
+
const audioData = await extractAudioData(response);
|
|
1842
|
+
const outputFile = "test_normalized_text_sona_speech_2_output.wav";
|
|
1843
|
+
fs.writeFileSync(outputFile, audioData);
|
|
1844
|
+
console.log(
|
|
1845
|
+
` 💾 Audio saved: ${outputFile} (${audioData.length} bytes)`
|
|
1846
|
+
);
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
return [true, response];
|
|
1850
|
+
} catch (e: any) {
|
|
1851
|
+
logDetailedError(e, "sona_speech_2 normalized_text TTS");
|
|
1852
|
+
return [false, e];
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
/**
|
|
1857
|
+
* Test TTS with sona_speech_2_flash model using normalized_text parameter
|
|
1858
|
+
* normalized_text allows specifying the pronunciation explicitly (e.g., kanji -> hiragana)
|
|
1859
|
+
*/
|
|
1860
|
+
async function testCreateSpeechWithNormalizedTextSonaSpeech2Flash(
|
|
1861
|
+
voiceId: string | null
|
|
1862
|
+
): Promise<[boolean, any]> {
|
|
1863
|
+
console.log("📝 TTS with normalized_text Parameter Test (sona_speech_2_flash)");
|
|
1864
|
+
|
|
1865
|
+
if (!voiceId) {
|
|
1866
|
+
console.log(" ⚠️ No voice ID available");
|
|
1867
|
+
return [false, null];
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
try {
|
|
1871
|
+
const { Supertone } = await import("../src/index.js");
|
|
1872
|
+
const models = await import("../src/models/index.js");
|
|
1873
|
+
const client = new Supertone({ apiKey: API_KEY });
|
|
1874
|
+
|
|
1875
|
+
// Japanese text with kanji, and normalized_text with hiragana pronunciation
|
|
1876
|
+
const text = "今日はどんな一日だったの?";
|
|
1877
|
+
const normalizedText = "きょうはどんないちにちだったの?";
|
|
1878
|
+
|
|
1879
|
+
console.log(` 🔍 Creating speech with normalized_text`);
|
|
1880
|
+
console.log(` Original text: ${text}`);
|
|
1881
|
+
console.log(` Normalized text: ${normalizedText}`);
|
|
1882
|
+
console.log(` Model: sona_speech_2_flash (faster inference)`);
|
|
1883
|
+
console.log(" ⚠️ This test consumes credits!");
|
|
1884
|
+
|
|
1885
|
+
const startTime = Date.now();
|
|
1886
|
+
const response = await client.textToSpeech.createSpeech({
|
|
1887
|
+
voiceId,
|
|
1888
|
+
apiConvertTextToSpeechUsingCharacterRequest: {
|
|
1889
|
+
text,
|
|
1890
|
+
normalizedText,
|
|
1891
|
+
language: models.APIConvertTextToSpeechUsingCharacterRequestLanguage.Ja,
|
|
1892
|
+
outputFormat:
|
|
1893
|
+
models.APIConvertTextToSpeechUsingCharacterRequestOutputFormat.Wav,
|
|
1894
|
+
model:
|
|
1895
|
+
models.APIConvertTextToSpeechUsingCharacterRequestModel.SonaSpeech2Flash,
|
|
1896
|
+
},
|
|
1897
|
+
});
|
|
1898
|
+
const elapsed = Date.now() - startTime;
|
|
1899
|
+
|
|
1900
|
+
console.log(` ✅ sona_speech_2_flash with normalized_text success`);
|
|
1901
|
+
console.log(` ⏱️ Response time: ${elapsed}ms`);
|
|
1902
|
+
|
|
1903
|
+
if (response.result) {
|
|
1904
|
+
const audioData = await extractAudioData(response);
|
|
1905
|
+
const outputFile = "test_normalized_text_sona_speech_2_flash_output.wav";
|
|
1906
|
+
fs.writeFileSync(outputFile, audioData);
|
|
1907
|
+
console.log(
|
|
1908
|
+
` 💾 Audio saved: ${outputFile} (${audioData.length} bytes)`
|
|
1909
|
+
);
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
return [true, response];
|
|
1913
|
+
} catch (e: any) {
|
|
1914
|
+
logDetailedError(e, "sona_speech_2_flash normalized_text TTS");
|
|
1915
|
+
return [false, e];
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1793
1919
|
/**
|
|
1794
1920
|
* Test TTS with unsupported model (should fail with validation error)
|
|
1795
1921
|
*/
|
|
@@ -3161,6 +3287,13 @@ async function main(): Promise<boolean> {
|
|
|
3161
3287
|
[success, result] = await testCreateSpeechWithSonaSpeech2Flash(voiceIdForTTS);
|
|
3162
3288
|
testResults["create_speech_sona_speech_2_flash"] = success;
|
|
3163
3289
|
|
|
3290
|
+
// normalized_text parameter tests
|
|
3291
|
+
[success, result] = await testCreateSpeechWithNormalizedTextSonaSpeech2(voiceIdForTTS);
|
|
3292
|
+
testResults["create_speech_normalized_text_sona_speech_2"] = success;
|
|
3293
|
+
|
|
3294
|
+
[success, result] = await testCreateSpeechWithNormalizedTextSonaSpeech2Flash(voiceIdForTTS);
|
|
3295
|
+
testResults["create_speech_normalized_text_sona_speech_2_flash"] = success;
|
|
3296
|
+
|
|
3164
3297
|
[success, result] = await testCreateSpeechWithUnsupportedModel(
|
|
3165
3298
|
voiceIdForTTS
|
|
3166
3299
|
);
|
|
@@ -3412,7 +3545,13 @@ async function main(): Promise<boolean> {
|
|
|
3412
3545
|
console.log("");
|
|
3413
3546
|
console.log("🤖 New Model & Language Tests:");
|
|
3414
3547
|
console.log(
|
|
3415
|
-
" • New Models: sona_speech_2, supertonic_api_1 (createSpeech & predictDuration)"
|
|
3548
|
+
" • New Models: sona_speech_2, sona_speech_2_flash, supertonic_api_1 (createSpeech & predictDuration)"
|
|
3549
|
+
);
|
|
3550
|
+
console.log(
|
|
3551
|
+
" • normalized_text Parameter: Explicit pronunciation control (kanji -> hiragana)"
|
|
3552
|
+
);
|
|
3553
|
+
console.log(
|
|
3554
|
+
" - Supported models: sona_speech_2, sona_speech_2_flash"
|
|
3416
3555
|
);
|
|
3417
3556
|
console.log(
|
|
3418
3557
|
" • Unsupported Model Validation: Error handling for invalid model names"
|
|
@@ -30,9 +30,9 @@ export type SDKOptions = {
|
|
|
30
30
|
export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
31
31
|
export declare const SDK_METADATA: {
|
|
32
32
|
readonly language: "typescript";
|
|
33
|
-
readonly openapiDocVersion: "0.
|
|
34
|
-
readonly sdkVersion: "0.
|
|
33
|
+
readonly openapiDocVersion: "0.9.0";
|
|
34
|
+
readonly sdkVersion: "0.2.0";
|
|
35
35
|
readonly genVersion: "2.686.7";
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.2.0 2.686.7 0.9.0 @supertone/supertone";
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -30,9 +30,9 @@ function serverURLFromOptions(options) {
|
|
|
30
30
|
}
|
|
31
31
|
exports.SDK_METADATA = {
|
|
32
32
|
language: "typescript",
|
|
33
|
-
openapiDocVersion: "0.
|
|
34
|
-
sdkVersion: "0.
|
|
33
|
+
openapiDocVersion: "0.9.0",
|
|
34
|
+
sdkVersion: "0.2.0",
|
|
35
35
|
genVersion: "2.686.7",
|
|
36
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
36
|
+
userAgent: "speakeasy-sdk/typescript 0.2.0 2.686.7 0.9.0 @supertone/supertone",
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAyCH,oDAeC;AAnDD,qCAA8C;AAE9C;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB;;OAEG;IACH,0BAA0B;CAClB,CAAC;AA0BX,SAAgB,oBAAoB,CAAC,OAAmB;IACtD,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAElC,MAAM,MAAM,GAAW,EAAE,CAAC;IAE1B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC;QACzC,IAAI,SAAS,GAAG,CAAC,IAAI,SAAS,IAAI,kBAAU,CAAC,MAAM,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,SAAS,GAAG,kBAAU,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,GAAG,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAEY,QAAA,YAAY,GAAG;IAC1B,QAAQ,EAAE,YAAY;IACtB,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAyCH,oDAeC;AAnDD,qCAA8C;AAE9C;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB;;OAEG;IACH,0BAA0B;CAClB,CAAC;AA0BX,SAAgB,oBAAoB,CAAC,OAAmB;IACtD,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAElC,MAAM,MAAM,GAAW,EAAE,CAAC;IAE1B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC;QACzC,IAAI,SAAS,GAAG,CAAC,IAAI,SAAS,IAAI,kBAAU,CAAC,MAAM,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,SAAS,GAAG,kBAAU,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,GAAG,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAEY,QAAA,YAAY,GAAG;IAC1B,QAAQ,EAAE,YAAY;IACtB,iBAAiB,EAAE,OAAO;IAC1B,UAAU,EAAE,OAAO;IACnB,UAAU,EAAE,SAAS;IACrB,SAAS,EACP,mEAAmE;CAC7D,CAAC"}
|
|
@@ -86,6 +86,10 @@ export type APIConvertTextToSpeechUsingCharacterRequest = {
|
|
|
86
86
|
* Return phoneme timing data with the audio
|
|
87
87
|
*/
|
|
88
88
|
includePhonemes?: boolean | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Pre-normalized text for TTS. Only used with sona_speech_2 and sona_speech_2_flash models.
|
|
91
|
+
*/
|
|
92
|
+
normalizedText?: string | undefined;
|
|
89
93
|
};
|
|
90
94
|
/** @internal */
|
|
91
95
|
export declare const APIConvertTextToSpeechUsingCharacterRequestLanguage$inboundSchema: z.ZodNativeEnum<typeof APIConvertTextToSpeechUsingCharacterRequestLanguage>;
|
|
@@ -206,6 +210,7 @@ export type APIConvertTextToSpeechUsingCharacterRequest$Outbound = {
|
|
|
206
210
|
output_format: string;
|
|
207
211
|
voice_settings?: ConvertTextToSpeechParameters$Outbound | undefined;
|
|
208
212
|
include_phonemes: boolean;
|
|
213
|
+
normalized_text?: string | undefined;
|
|
209
214
|
};
|
|
210
215
|
/** @internal */
|
|
211
216
|
export declare const APIConvertTextToSpeechUsingCharacterRequest$outboundSchema: z.ZodType<APIConvertTextToSpeechUsingCharacterRequest$Outbound, z.ZodTypeDef, APIConvertTextToSpeechUsingCharacterRequest>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiconverttexttospeechusingcharacterrequest.d.ts","sourceRoot":"","sources":["../../../src/models/apiconverttexttospeechusingcharacterrequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,6BAA6B,EAE7B,sCAAsC,EAEvC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;CAwBtD,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,mDAAmD,GAAG,UAAU,CAC1E,OAAO,mDAAmD,CAC3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gDAAgD;;;;;;CAMnD,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,gDAAgD,GAAG,UAAU,CACvE,OAAO,gDAAgD,CACxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uDAAuD;;;CAG1D,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,uDAAuD,GACjE,UAAU,CAAC,OAAO,uDAAuD,CAAC,CAAC;AAE7E,MAAM,MAAM,2CAA2C,GAAG;IACxD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,mDAAmD,CAAC;IAC9D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,gDAAgD,GAAG,SAAS,CAAC;IACrE;;OAEG;IACH,YAAY,CAAC,EACT,uDAAuD,GACvD,SAAS,CAAC;IACd,aAAa,CAAC,EAAE,6BAA6B,GAAG,SAAS,CAAC;IAC1D;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"apiconverttexttospeechusingcharacterrequest.d.ts","sourceRoot":"","sources":["../../../src/models/apiconverttexttospeechusingcharacterrequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,6BAA6B,EAE7B,sCAAsC,EAEvC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;CAwBtD,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,mDAAmD,GAAG,UAAU,CAC1E,OAAO,mDAAmD,CAC3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gDAAgD;;;;;;CAMnD,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,gDAAgD,GAAG,UAAU,CACvE,OAAO,gDAAgD,CACxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uDAAuD;;;CAG1D,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,uDAAuD,GACjE,UAAU,CAAC,OAAO,uDAAuD,CAAC,CAA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B,mDAAmD,CACjE,UAAU,EAAE,MAAM,GACjB,eAAe,CAChB,2CAA2C,EAC3C,kBAAkB,CACnB,CASA"}
|
|
@@ -145,11 +145,13 @@ exports.APIConvertTextToSpeechUsingCharacterRequest$inboundSchema = z.object({
|
|
|
145
145
|
.default("wav"),
|
|
146
146
|
voice_settings: converttexttospeechparameters_js_1.ConvertTextToSpeechParameters$inboundSchema.optional(),
|
|
147
147
|
include_phonemes: z.boolean().default(false),
|
|
148
|
+
normalized_text: z.string().optional(),
|
|
148
149
|
}).transform((v) => {
|
|
149
150
|
return (0, primitives_js_1.remap)(v, {
|
|
150
151
|
"output_format": "outputFormat",
|
|
151
152
|
"voice_settings": "voiceSettings",
|
|
152
153
|
"include_phonemes": "includePhonemes",
|
|
154
|
+
"normalized_text": "normalizedText",
|
|
153
155
|
});
|
|
154
156
|
});
|
|
155
157
|
/** @internal */
|
|
@@ -163,11 +165,13 @@ exports.APIConvertTextToSpeechUsingCharacterRequest$outboundSchema = z.object({
|
|
|
163
165
|
.default("wav"),
|
|
164
166
|
voiceSettings: converttexttospeechparameters_js_1.ConvertTextToSpeechParameters$outboundSchema.optional(),
|
|
165
167
|
includePhonemes: z.boolean().default(false),
|
|
168
|
+
normalizedText: z.string().optional(),
|
|
166
169
|
}).transform((v) => {
|
|
167
170
|
return (0, primitives_js_1.remap)(v, {
|
|
168
171
|
outputFormat: "output_format",
|
|
169
172
|
voiceSettings: "voice_settings",
|
|
170
173
|
includePhonemes: "include_phonemes",
|
|
174
|
+
normalizedText: "normalized_text",
|
|
171
175
|
});
|
|
172
176
|
});
|
|
173
177
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiconverttexttospeechusingcharacterrequest.js","sourceRoot":"","sources":["../../../src/models/apiconverttexttospeechusingcharacterrequest.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"apiconverttexttospeechusingcharacterrequest.js","sourceRoot":"","sources":["../../../src/models/apiconverttexttospeechusingcharacterrequest.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2QH,8GASC;AAED,kHAcC;AAlSD,uCAAyB;AACzB,wDAAuD;AACvD,kDAA8C;AAG9C,yFAK4C;AAG5C;;GAEG;AACU,QAAA,mDAAmD,GAAG;IACjE,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACA,CAAC;AAQX;;GAEG;AACU,QAAA,gDAAgD,GAAG;IAC9D,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,eAAe;IAC5B,gBAAgB,EAAE,qBAAqB;IACvC,YAAY,EAAE,gBAAgB;IAC9B,cAAc,EAAE,kBAAkB;CAC1B,CAAC;AAQX;;GAEG;AACU,QAAA,uDAAuD,GAAG;IACrE,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;CACF,CAAC;AAyCX,gBAAgB;AACH,QAAA,iEAAiE,GAE1E,CAAC,CAAC,UAAU,CAAC,2DAAmD,CAAC,CAAC;AAEtE,gBAAgB;AACH,QAAA,kEAAkE,GAE3E,yEAAiE,CAAC;AAEtE;;;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0DAAa,GACxB,iEAAyD,CAAC;IAC5D,4FAA4F;IAC/E,2DAAc,GACzB,kEAA0D,CAAC;AAG/D,CAAC,EATgB,4CAA4C,4DAA5C,4CAA4C,QAS5D;AAED,SAAgB,iDAAiD,CAC/D,2CAC6C;IAE7C,OAAO,IAAI,CAAC,SAAS,CACnB,kEAA0D,CAAC,KAAK,CAC9D,2CAA2C,CAC5C,CACF,CAAC;AACJ,CAAC;AAED,SAAgB,mDAAmD,CACjE,UAAkB;IAKlB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CACJ,iEAAyD,CAAC,KAAK,CAC7D,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACd,EACH,yEAAyE,CAC1E,CAAC;AACJ,CAAC"}
|
package/dist/esm/lib/config.d.ts
CHANGED
|
@@ -30,9 +30,9 @@ export type SDKOptions = {
|
|
|
30
30
|
export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
31
31
|
export declare const SDK_METADATA: {
|
|
32
32
|
readonly language: "typescript";
|
|
33
|
-
readonly openapiDocVersion: "0.
|
|
34
|
-
readonly sdkVersion: "0.
|
|
33
|
+
readonly openapiDocVersion: "0.9.0";
|
|
34
|
+
readonly sdkVersion: "0.2.0";
|
|
35
35
|
readonly genVersion: "2.686.7";
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.2.0 2.686.7 0.9.0 @supertone/supertone";
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/esm/lib/config.js
CHANGED
|
@@ -26,9 +26,9 @@ export function serverURLFromOptions(options) {
|
|
|
26
26
|
}
|
|
27
27
|
export const SDK_METADATA = {
|
|
28
28
|
language: "typescript",
|
|
29
|
-
openapiDocVersion: "0.
|
|
30
|
-
sdkVersion: "0.
|
|
29
|
+
openapiDocVersion: "0.9.0",
|
|
30
|
+
sdkVersion: "0.2.0",
|
|
31
31
|
genVersion: "2.686.7",
|
|
32
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
32
|
+
userAgent: "speakeasy-sdk/typescript 0.2.0 2.686.7 0.9.0 @supertone/supertone",
|
|
33
33
|
};
|
|
34
34
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAU,UAAU,EAAE,MAAM,UAAU,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;;OAEG;IACH,0BAA0B;CAClB,CAAC;AA0BX,MAAM,UAAU,oBAAoB,CAAC,OAAmB;IACtD,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAElC,MAAM,MAAM,GAAW,EAAE,CAAC;IAE1B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC;QACzC,IAAI,SAAS,GAAG,CAAC,IAAI,SAAS,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,YAAY;IACtB,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAU,UAAU,EAAE,MAAM,UAAU,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;;OAEG;IACH,0BAA0B;CAClB,CAAC;AA0BX,MAAM,UAAU,oBAAoB,CAAC,OAAmB;IACtD,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAElC,MAAM,MAAM,GAAW,EAAE,CAAC;IAE1B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC;QACzC,IAAI,SAAS,GAAG,CAAC,IAAI,SAAS,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,YAAY;IACtB,iBAAiB,EAAE,OAAO;IAC1B,UAAU,EAAE,OAAO;IACnB,UAAU,EAAE,SAAS;IACrB,SAAS,EACP,mEAAmE;CAC7D,CAAC"}
|
|
@@ -86,6 +86,10 @@ export type APIConvertTextToSpeechUsingCharacterRequest = {
|
|
|
86
86
|
* Return phoneme timing data with the audio
|
|
87
87
|
*/
|
|
88
88
|
includePhonemes?: boolean | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Pre-normalized text for TTS. Only used with sona_speech_2 and sona_speech_2_flash models.
|
|
91
|
+
*/
|
|
92
|
+
normalizedText?: string | undefined;
|
|
89
93
|
};
|
|
90
94
|
/** @internal */
|
|
91
95
|
export declare const APIConvertTextToSpeechUsingCharacterRequestLanguage$inboundSchema: z.ZodNativeEnum<typeof APIConvertTextToSpeechUsingCharacterRequestLanguage>;
|
|
@@ -206,6 +210,7 @@ export type APIConvertTextToSpeechUsingCharacterRequest$Outbound = {
|
|
|
206
210
|
output_format: string;
|
|
207
211
|
voice_settings?: ConvertTextToSpeechParameters$Outbound | undefined;
|
|
208
212
|
include_phonemes: boolean;
|
|
213
|
+
normalized_text?: string | undefined;
|
|
209
214
|
};
|
|
210
215
|
/** @internal */
|
|
211
216
|
export declare const APIConvertTextToSpeechUsingCharacterRequest$outboundSchema: z.ZodType<APIConvertTextToSpeechUsingCharacterRequest$Outbound, z.ZodTypeDef, APIConvertTextToSpeechUsingCharacterRequest>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiconverttexttospeechusingcharacterrequest.d.ts","sourceRoot":"","sources":["../../../src/models/apiconverttexttospeechusingcharacterrequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,6BAA6B,EAE7B,sCAAsC,EAEvC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;CAwBtD,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,mDAAmD,GAAG,UAAU,CAC1E,OAAO,mDAAmD,CAC3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gDAAgD;;;;;;CAMnD,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,gDAAgD,GAAG,UAAU,CACvE,OAAO,gDAAgD,CACxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uDAAuD;;;CAG1D,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,uDAAuD,GACjE,UAAU,CAAC,OAAO,uDAAuD,CAAC,CAAC;AAE7E,MAAM,MAAM,2CAA2C,GAAG;IACxD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,mDAAmD,CAAC;IAC9D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,gDAAgD,GAAG,SAAS,CAAC;IACrE;;OAEG;IACH,YAAY,CAAC,EACT,uDAAuD,GACvD,SAAS,CAAC;IACd,aAAa,CAAC,EAAE,6BAA6B,GAAG,SAAS,CAAC;IAC1D;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"apiconverttexttospeechusingcharacterrequest.d.ts","sourceRoot":"","sources":["../../../src/models/apiconverttexttospeechusingcharacterrequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,6BAA6B,EAE7B,sCAAsC,EAEvC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;CAwBtD,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,mDAAmD,GAAG,UAAU,CAC1E,OAAO,mDAAmD,CAC3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gDAAgD;;;;;;CAMnD,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,gDAAgD,GAAG,UAAU,CACvE,OAAO,gDAAgD,CACxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uDAAuD;;;CAG1D,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,uDAAuD,GACjE,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AA2C,GAC5C,MAAM,CAMR;AAED,wBAAgB,mDAAmD,CACjE,UAAU,EAAE,MAAM,GACjB,eAAe,CAChB,2CAA2C,EAC3C,kBAAkB,CACnB,CASA"}
|
|
@@ -107,11 +107,13 @@ export const APIConvertTextToSpeechUsingCharacterRequest$inboundSchema = z.objec
|
|
|
107
107
|
.default("wav"),
|
|
108
108
|
voice_settings: ConvertTextToSpeechParameters$inboundSchema.optional(),
|
|
109
109
|
include_phonemes: z.boolean().default(false),
|
|
110
|
+
normalized_text: z.string().optional(),
|
|
110
111
|
}).transform((v) => {
|
|
111
112
|
return remap$(v, {
|
|
112
113
|
"output_format": "outputFormat",
|
|
113
114
|
"voice_settings": "voiceSettings",
|
|
114
115
|
"include_phonemes": "includePhonemes",
|
|
116
|
+
"normalized_text": "normalizedText",
|
|
115
117
|
});
|
|
116
118
|
});
|
|
117
119
|
/** @internal */
|
|
@@ -125,11 +127,13 @@ export const APIConvertTextToSpeechUsingCharacterRequest$outboundSchema = z.obje
|
|
|
125
127
|
.default("wav"),
|
|
126
128
|
voiceSettings: ConvertTextToSpeechParameters$outboundSchema.optional(),
|
|
127
129
|
includePhonemes: z.boolean().default(false),
|
|
130
|
+
normalizedText: z.string().optional(),
|
|
128
131
|
}).transform((v) => {
|
|
129
132
|
return remap$(v, {
|
|
130
133
|
outputFormat: "output_format",
|
|
131
134
|
voiceSettings: "voice_settings",
|
|
132
135
|
includePhonemes: "include_phonemes",
|
|
136
|
+
normalizedText: "normalized_text",
|
|
133
137
|
});
|
|
134
138
|
});
|
|
135
139
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiconverttexttospeechusingcharacterrequest.js","sourceRoot":"","sources":["../../../src/models/apiconverttexttospeechusingcharacterrequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,OAAO,EAEL,2CAA2C,EAE3C,4CAA4C,GAC7C,MAAM,oCAAoC,CAAC;AAG5C;;GAEG;AACH,MAAM,CAAC,MAAM,mDAAmD,GAAG;IACjE,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACA,CAAC;AAQX;;GAEG;AACH,MAAM,CAAC,MAAM,gDAAgD,GAAG;IAC9D,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,eAAe;IAC5B,gBAAgB,EAAE,qBAAqB;IACvC,YAAY,EAAE,gBAAgB;IAC9B,cAAc,EAAE,kBAAkB;CAC1B,CAAC;AAQX;;GAEG;AACH,MAAM,CAAC,MAAM,uDAAuD,GAAG;IACrE,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;CACF,CAAC;
|
|
1
|
+
{"version":3,"file":"apiconverttexttospeechusingcharacterrequest.js","sourceRoot":"","sources":["../../../src/models/apiconverttexttospeechusingcharacterrequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM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W,4CAA4C,CAS5D;AATD,WAAiB,4CAA4C;IAC3D,2FAA2F;IAC9E,0DAAa,GACxB,yDAAyD,CAAC;IAC5D,4FAA4F;IAC/E,2DAAc,GACzB,0DAA0D,CAAC;AAG/D,CAAC,EATgB,4CAA4C,KAA5C,4CAA4C,QAS5D;AAED,MAAM,UAAU,iDAAiD,CAC/D,2CAC6C;IAE7C,OAAO,IAAI,CAAC,SAAS,CACnB,0DAA0D,CAAC,KAAK,CAC9D,2CAA2C,CAC5C,CACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mDAAmD,CACjE,UAAkB;IAKlB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CACJ,yDAAyD,CAAC,KAAK,CAC7D,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACd,EACH,yEAAyE,CAC1E,CAAC;AACJ,CAAC"}
|
package/jsr.json
CHANGED
package/openapi.json
CHANGED
|
@@ -1614,7 +1614,7 @@
|
|
|
1614
1614
|
"info": {
|
|
1615
1615
|
"title": "Supertone Public API",
|
|
1616
1616
|
"description": "Supertone API is a RESTful API for using our state-of-the-art AI voice models.",
|
|
1617
|
-
"version": "0.
|
|
1617
|
+
"version": "0.9.0",
|
|
1618
1618
|
"contact": {}
|
|
1619
1619
|
},
|
|
1620
1620
|
"tags": [
|
|
@@ -1976,6 +1976,10 @@
|
|
|
1976
1976
|
"type": "boolean",
|
|
1977
1977
|
"description": "Return phoneme timing data with the audio",
|
|
1978
1978
|
"default": false
|
|
1979
|
+
},
|
|
1980
|
+
"normalized_text": {
|
|
1981
|
+
"type": "string",
|
|
1982
|
+
"description": "Pre-normalized text for TTS. Only used with sona_speech_2 and sona_speech_2_flash models."
|
|
1979
1983
|
}
|
|
1980
1984
|
},
|
|
1981
1985
|
"required": [
|
package/package.json
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -60,9 +60,9 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
60
60
|
|
|
61
61
|
export const SDK_METADATA = {
|
|
62
62
|
language: "typescript",
|
|
63
|
-
openapiDocVersion: "0.
|
|
64
|
-
sdkVersion: "0.
|
|
63
|
+
openapiDocVersion: "0.9.0",
|
|
64
|
+
sdkVersion: "0.2.0",
|
|
65
65
|
genVersion: "2.686.7",
|
|
66
66
|
userAgent:
|
|
67
|
-
"speakeasy-sdk/typescript 0.
|
|
67
|
+
"speakeasy-sdk/typescript 0.2.0 2.686.7 0.9.0 @supertone/supertone",
|
|
68
68
|
} as const;
|
|
@@ -108,6 +108,10 @@ export type APIConvertTextToSpeechUsingCharacterRequest = {
|
|
|
108
108
|
* Return phoneme timing data with the audio
|
|
109
109
|
*/
|
|
110
110
|
includePhonemes?: boolean | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Pre-normalized text for TTS. Only used with sona_speech_2 and sona_speech_2_flash models.
|
|
113
|
+
*/
|
|
114
|
+
normalizedText?: string | undefined;
|
|
111
115
|
};
|
|
112
116
|
|
|
113
117
|
/** @internal */
|
|
@@ -198,11 +202,13 @@ export const APIConvertTextToSpeechUsingCharacterRequest$inboundSchema:
|
|
|
198
202
|
.default("wav"),
|
|
199
203
|
voice_settings: ConvertTextToSpeechParameters$inboundSchema.optional(),
|
|
200
204
|
include_phonemes: z.boolean().default(false),
|
|
205
|
+
normalized_text: z.string().optional(),
|
|
201
206
|
}).transform((v) => {
|
|
202
207
|
return remap$(v, {
|
|
203
208
|
"output_format": "outputFormat",
|
|
204
209
|
"voice_settings": "voiceSettings",
|
|
205
210
|
"include_phonemes": "includePhonemes",
|
|
211
|
+
"normalized_text": "normalizedText",
|
|
206
212
|
});
|
|
207
213
|
});
|
|
208
214
|
|
|
@@ -215,6 +221,7 @@ export type APIConvertTextToSpeechUsingCharacterRequest$Outbound = {
|
|
|
215
221
|
output_format: string;
|
|
216
222
|
voice_settings?: ConvertTextToSpeechParameters$Outbound | undefined;
|
|
217
223
|
include_phonemes: boolean;
|
|
224
|
+
normalized_text?: string | undefined;
|
|
218
225
|
};
|
|
219
226
|
|
|
220
227
|
/** @internal */
|
|
@@ -235,11 +242,13 @@ export const APIConvertTextToSpeechUsingCharacterRequest$outboundSchema:
|
|
|
235
242
|
.default("wav"),
|
|
236
243
|
voiceSettings: ConvertTextToSpeechParameters$outboundSchema.optional(),
|
|
237
244
|
includePhonemes: z.boolean().default(false),
|
|
245
|
+
normalizedText: z.string().optional(),
|
|
238
246
|
}).transform((v) => {
|
|
239
247
|
return remap$(v, {
|
|
240
248
|
outputFormat: "output_format",
|
|
241
249
|
voiceSettings: "voice_settings",
|
|
242
250
|
includePhonemes: "include_phonemes",
|
|
251
|
+
normalizedText: "normalized_text",
|
|
243
252
|
});
|
|
244
253
|
});
|
|
245
254
|
|