Skip to content

Commit

Permalink
Release 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jan 6, 2025
1 parent 8d36b88 commit 724d2a4
Show file tree
Hide file tree
Showing 25 changed files with 312 additions and 58 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cartesia/cartesia-js",
"version": "2.1.2",
"version": "2.1.3",
"private": false,
"repository": "https://github.com/cartesia-ai/cartesia-js",
"main": "./index.js",
Expand Down
5 changes: 3 additions & 2 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ await client.tts.bytes({
container: "mp3",
sampleRate: 44100,
bitRate: 128000,
loudness: -17,
},
});
```
Expand All @@ -290,7 +291,7 @@ await client.tts.bytes({
<dl>
<dd>

**request:** `Cartesia.TtsRequest`
**request:** `Cartesia.TtsBytesRequest`

</dd>
</dl>
Expand Down Expand Up @@ -354,7 +355,7 @@ for await (const item of response) {
<dl>
<dd>

**request:** `Cartesia.TtsRequest`
**request:** `Cartesia.TtssseRequest`

</dd>
</dl>
Expand Down
4 changes: 2 additions & 2 deletions src/api/resources/apiStatus/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export class ApiStatus {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down
16 changes: 8 additions & 8 deletions src/api/resources/datasets/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export class Datasets {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -119,8 +119,8 @@ export class Datasets {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -185,8 +185,8 @@ export class Datasets {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -258,8 +258,8 @@ export class Datasets {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down
24 changes: 24 additions & 0 deletions src/api/resources/tts/types/BytesOutputFormat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Cartesia from "../../../index";

export type BytesOutputFormat =
| Cartesia.BytesOutputFormat.Raw
| Cartesia.BytesOutputFormat.Wav
| Cartesia.BytesOutputFormat.Mp3;

export declare namespace BytesOutputFormat {
interface Raw extends Cartesia.RawBytesOutputFormat {
container: "raw";
}

interface Wav extends Cartesia.WavBytesOutputFormat {
container: "wav";
}

interface Mp3 extends Cartesia.Mp3OutputFormat {
container: "mp3";
}
}
5 changes: 5 additions & 0 deletions src/api/resources/tts/types/Mp3OutputFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ export interface Mp3OutputFormat {
sampleRate: number;
/** The bit rate of the audio in bits per second. Supported bit rates are 32000, 64000, 96000, 128000, 192000. */
bitRate: number;
/**
* The loudness of the audio in LUFS.
* Supports values between -14 (loudest) and -24 (quietest).
*/
loudness?: number;
}
13 changes: 13 additions & 0 deletions src/api/resources/tts/types/RawBytesOutputFormat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Cartesia from "../../../index";

export interface RawBytesOutputFormat extends Cartesia.RawOutputFormat {
/**
* The loudness of the audio in LUFS.
* Supports values between -14 (loudest) and -24 (quietest).
*/
loudness?: number;
}
17 changes: 17 additions & 0 deletions src/api/resources/tts/types/SseOutputFormat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Cartesia from "../../../index";

export type SseOutputFormat = Cartesia.SseOutputFormat.Raw | Cartesia.SseOutputFormat.Wav;

export declare namespace SseOutputFormat {
interface Raw extends Cartesia.RawOutputFormat {
container: "raw";
}

interface Wav extends Cartesia.WavOutputFormat {
container: "wav";
}
}
19 changes: 19 additions & 0 deletions src/api/resources/tts/types/TtsBytesRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Cartesia from "../../../index";

export interface TtsBytesRequest {
/** The ID of the model to use for the generation. See [Models](/build-with-sonic/models) for available models. */
modelId: string;
transcript: string;
voice: Cartesia.TtsRequestVoiceSpecifier;
language?: Cartesia.SupportedLanguage;
outputFormat: Cartesia.BytesOutputFormat;
/**
* The maximum duration of the audio in seconds. You do not usually need to specify this.
* If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
*/
duration?: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

import * as Cartesia from "../../../index";

export interface TtsRequest {
export interface TtssseRequest {
/** The ID of the model to use for the generation. See [Models](/build-with-sonic/models) for available models. */
modelId: string;
transcript: string;
voice: Cartesia.TtsRequestVoiceSpecifier;
language?: Cartesia.SupportedLanguage;
outputFormat: Cartesia.OutputFormat;
outputFormat: Cartesia.SseOutputFormat;
/**
* The maximum duration of the audio in seconds. You do not usually need to specify this.
* If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
Expand Down
7 changes: 7 additions & 0 deletions src/api/resources/tts/types/WavBytesOutputFormat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Cartesia from "../../../index";

export interface WavBytesOutputFormat extends Cartesia.RawBytesOutputFormat {}
1 change: 1 addition & 0 deletions src/api/resources/tts/types/WebSocketTtsRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ export interface WebSocketTtsRequest {
duration?: number;
language?: string;
addTimestamps?: boolean;
continue?: boolean;
contextId?: string;
}
7 changes: 6 additions & 1 deletion src/api/resources/tts/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ export * from "./GenerationRequest";
export * from "./WebSocketRawOutputFormat";
export * from "./WebSocketRequest";
export * from "./WebSocketTtsRequest";
export * from "./TtsRequest";
export * from "./SupportedLanguage";
export * from "./OutputFormat";
export * from "./RawOutputFormat";
export * from "./RawBytesOutputFormat";
export * from "./RawEncoding";
export * from "./WavOutputFormat";
export * from "./WavBytesOutputFormat";
export * from "./Mp3OutputFormat";
export * from "./TtsRequestVoiceSpecifier";
export * from "./TtsRequestIdSpecifier";
Expand All @@ -28,3 +29,7 @@ export * from "./Speed";
export * from "./NumericalSpecifier";
export * from "./NaturalSpecifier";
export * from "./Emotion";
export * from "./TtsBytesRequest";
export * from "./BytesOutputFormat";
export * from "./TtssseRequest";
export * from "./SseOutputFormat";
32 changes: 16 additions & 16 deletions src/api/resources/voices/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export class Voices {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -123,8 +123,8 @@ export class Voices {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -186,8 +186,8 @@ export class Voices {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -250,8 +250,8 @@ export class Voices {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -313,8 +313,8 @@ export class Voices {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -383,8 +383,8 @@ export class Voices {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -454,8 +454,8 @@ export class Voices {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -559,8 +559,8 @@ export class Voices {
"Cartesia-Version": requestOptions?.cartesiaVersion ?? this._options?.cartesiaVersion ?? "2024-06-10",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@cartesia/cartesia-js",
"X-Fern-SDK-Version": "2.1.2",
"User-Agent": "@cartesia/cartesia-js/2.1.2",
"X-Fern-SDK-Version": "2.1.3",
"User-Agent": "@cartesia/cartesia-js/2.1.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down
40 changes: 40 additions & 0 deletions src/serialization/resources/tts/types/BytesOutputFormat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as serializers from "../../../index";
import * as Cartesia from "../../../../api/index";
import * as core from "../../../../core";
import { RawBytesOutputFormat } from "./RawBytesOutputFormat";
import { WavBytesOutputFormat } from "./WavBytesOutputFormat";
import { Mp3OutputFormat } from "./Mp3OutputFormat";

export const BytesOutputFormat: core.serialization.Schema<
serializers.BytesOutputFormat.Raw,
Cartesia.BytesOutputFormat
> = core.serialization
.union("container", {
raw: RawBytesOutputFormat,
wav: WavBytesOutputFormat,
mp3: Mp3OutputFormat,
})
.transform<Cartesia.BytesOutputFormat>({
transform: (value) => value,
untransform: (value) => value,
});

export declare namespace BytesOutputFormat {
type Raw = BytesOutputFormat.Raw | BytesOutputFormat.Wav | BytesOutputFormat.Mp3;

Check failure on line 27 in src/serialization/resources/tts/types/BytesOutputFormat.ts

View workflow job for this annotation

GitHub Actions / compile

Duplicate identifier 'Raw'.

Check failure on line 27 in src/serialization/resources/tts/types/BytesOutputFormat.ts

View workflow job for this annotation

GitHub Actions / compile

Type alias 'Raw' circularly references itself.

Check failure on line 27 in src/serialization/resources/tts/types/BytesOutputFormat.ts

View workflow job for this annotation

GitHub Actions / compile

Duplicate identifier 'Raw'.

Check failure on line 27 in src/serialization/resources/tts/types/BytesOutputFormat.ts

View workflow job for this annotation

GitHub Actions / compile

Type alias 'Raw' circularly references itself.

interface Raw extends RawBytesOutputFormat.Raw {

Check failure on line 29 in src/serialization/resources/tts/types/BytesOutputFormat.ts

View workflow job for this annotation

GitHub Actions / compile

Duplicate identifier 'Raw'.

Check failure on line 29 in src/serialization/resources/tts/types/BytesOutputFormat.ts

View workflow job for this annotation

GitHub Actions / compile

Duplicate identifier 'Raw'.
container: "raw";
}

interface Wav extends WavBytesOutputFormat.Raw {
container: "wav";
}

interface Mp3 extends Mp3OutputFormat.Raw {
container: "mp3";
}
}
2 changes: 2 additions & 0 deletions src/serialization/resources/tts/types/Mp3OutputFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ export const Mp3OutputFormat: core.serialization.ObjectSchema<
> = core.serialization.object({
sampleRate: core.serialization.property("sample_rate", core.serialization.number()),
bitRate: core.serialization.property("bit_rate", core.serialization.number()),
loudness: core.serialization.number().optional(),
});

export declare namespace Mp3OutputFormat {
interface Raw {
sample_rate: number;
bit_rate: number;
loudness?: number | null;
}
}
23 changes: 23 additions & 0 deletions src/serialization/resources/tts/types/RawBytesOutputFormat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as serializers from "../../../index";
import * as Cartesia from "../../../../api/index";
import * as core from "../../../../core";
import { RawOutputFormat } from "./RawOutputFormat";

export const RawBytesOutputFormat: core.serialization.ObjectSchema<
serializers.RawBytesOutputFormat.Raw,
Cartesia.RawBytesOutputFormat
> = core.serialization
.object({
loudness: core.serialization.number().optional(),
})
.extend(RawOutputFormat);

export declare namespace RawBytesOutputFormat {
interface Raw extends RawOutputFormat.Raw {
loudness?: number | null;
}
}
Loading

0 comments on commit 724d2a4

Please sign in to comment.