diff --git a/package.json b/package.json index 8614bab..4198c51 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/reference.md b/reference.md index 1270038..17c74b3 100644 --- a/reference.md +++ b/reference.md @@ -273,6 +273,7 @@ await client.tts.bytes({ container: "mp3", sampleRate: 44100, bitRate: 128000, + loudness: -17, }, }); ``` @@ -290,7 +291,7 @@ await client.tts.bytes({
-**request:** `Cartesia.TtsRequest` +**request:** `Cartesia.TtsBytesRequest`
@@ -354,7 +355,7 @@ for await (const item of response) {
-**request:** `Cartesia.TtsRequest` +**request:** `Cartesia.TtssseRequest`
diff --git a/src/api/resources/apiStatus/client/Client.ts b/src/api/resources/apiStatus/client/Client.ts index 5adaeb9..1a741ce 100644 --- a/src/api/resources/apiStatus/client/Client.ts +++ b/src/api/resources/apiStatus/client/Client.ts @@ -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()), diff --git a/src/api/resources/datasets/client/Client.ts b/src/api/resources/datasets/client/Client.ts index 93b2046..c21a77c 100644 --- a/src/api/resources/datasets/client/Client.ts +++ b/src/api/resources/datasets/client/Client.ts @@ -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()), @@ -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()), @@ -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()), @@ -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()), diff --git a/src/api/resources/tts/types/BytesOutputFormat.ts b/src/api/resources/tts/types/BytesOutputFormat.ts new file mode 100644 index 0000000..e9978cf --- /dev/null +++ b/src/api/resources/tts/types/BytesOutputFormat.ts @@ -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"; + } +} diff --git a/src/api/resources/tts/types/Mp3OutputFormat.ts b/src/api/resources/tts/types/Mp3OutputFormat.ts index a51c18a..f17d730 100644 --- a/src/api/resources/tts/types/Mp3OutputFormat.ts +++ b/src/api/resources/tts/types/Mp3OutputFormat.ts @@ -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; } diff --git a/src/api/resources/tts/types/RawBytesOutputFormat.ts b/src/api/resources/tts/types/RawBytesOutputFormat.ts new file mode 100644 index 0000000..f82759e --- /dev/null +++ b/src/api/resources/tts/types/RawBytesOutputFormat.ts @@ -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; +} diff --git a/src/api/resources/tts/types/SseOutputFormat.ts b/src/api/resources/tts/types/SseOutputFormat.ts new file mode 100644 index 0000000..aa632bc --- /dev/null +++ b/src/api/resources/tts/types/SseOutputFormat.ts @@ -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"; + } +} diff --git a/src/api/resources/tts/types/TtsBytesRequest.ts b/src/api/resources/tts/types/TtsBytesRequest.ts new file mode 100644 index 0000000..c4ae09a --- /dev/null +++ b/src/api/resources/tts/types/TtsBytesRequest.ts @@ -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; +} diff --git a/src/api/resources/tts/types/TtsRequest.ts b/src/api/resources/tts/types/TtssseRequest.ts similarity index 88% rename from src/api/resources/tts/types/TtsRequest.ts rename to src/api/resources/tts/types/TtssseRequest.ts index 154f6d1..daf6ddc 100644 --- a/src/api/resources/tts/types/TtsRequest.ts +++ b/src/api/resources/tts/types/TtssseRequest.ts @@ -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. diff --git a/src/api/resources/tts/types/WavBytesOutputFormat.ts b/src/api/resources/tts/types/WavBytesOutputFormat.ts new file mode 100644 index 0000000..43e021e --- /dev/null +++ b/src/api/resources/tts/types/WavBytesOutputFormat.ts @@ -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 {} diff --git a/src/api/resources/tts/types/WebSocketTtsRequest.ts b/src/api/resources/tts/types/WebSocketTtsRequest.ts index c0d3d8f..f40491c 100644 --- a/src/api/resources/tts/types/WebSocketTtsRequest.ts +++ b/src/api/resources/tts/types/WebSocketTtsRequest.ts @@ -13,5 +13,6 @@ export interface WebSocketTtsRequest { duration?: number; language?: string; addTimestamps?: boolean; + continue?: boolean; contextId?: string; } diff --git a/src/api/resources/tts/types/index.ts b/src/api/resources/tts/types/index.ts index 5212040..8d1e2ed 100644 --- a/src/api/resources/tts/types/index.ts +++ b/src/api/resources/tts/types/index.ts @@ -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"; @@ -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"; diff --git a/src/api/resources/voices/client/Client.ts b/src/api/resources/voices/client/Client.ts index da9a283..a6e8965 100644 --- a/src/api/resources/voices/client/Client.ts +++ b/src/api/resources/voices/client/Client.ts @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), diff --git a/src/serialization/resources/tts/types/BytesOutputFormat.ts b/src/serialization/resources/tts/types/BytesOutputFormat.ts new file mode 100644 index 0000000..4b74233 --- /dev/null +++ b/src/serialization/resources/tts/types/BytesOutputFormat.ts @@ -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({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace BytesOutputFormat { + type Raw = BytesOutputFormat.Raw | BytesOutputFormat.Wav | BytesOutputFormat.Mp3; + + interface Raw extends RawBytesOutputFormat.Raw { + container: "raw"; + } + + interface Wav extends WavBytesOutputFormat.Raw { + container: "wav"; + } + + interface Mp3 extends Mp3OutputFormat.Raw { + container: "mp3"; + } +} diff --git a/src/serialization/resources/tts/types/Mp3OutputFormat.ts b/src/serialization/resources/tts/types/Mp3OutputFormat.ts index d099ddc..0942d89 100644 --- a/src/serialization/resources/tts/types/Mp3OutputFormat.ts +++ b/src/serialization/resources/tts/types/Mp3OutputFormat.ts @@ -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; } } diff --git a/src/serialization/resources/tts/types/RawBytesOutputFormat.ts b/src/serialization/resources/tts/types/RawBytesOutputFormat.ts new file mode 100644 index 0000000..a7f8d76 --- /dev/null +++ b/src/serialization/resources/tts/types/RawBytesOutputFormat.ts @@ -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; + } +} diff --git a/src/serialization/resources/tts/types/SseOutputFormat.ts b/src/serialization/resources/tts/types/SseOutputFormat.ts new file mode 100644 index 0000000..27b37a3 --- /dev/null +++ b/src/serialization/resources/tts/types/SseOutputFormat.ts @@ -0,0 +1,32 @@ +/** + * 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"; +import { WavOutputFormat } from "./WavOutputFormat"; + +export const SseOutputFormat: core.serialization.Schema = + core.serialization + .union("container", { + raw: RawOutputFormat, + wav: WavOutputFormat, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace SseOutputFormat { + type Raw = SseOutputFormat.Raw | SseOutputFormat.Wav; + + interface Raw extends RawOutputFormat.Raw { + container: "raw"; + } + + interface Wav extends WavOutputFormat.Raw { + container: "wav"; + } +} diff --git a/src/serialization/resources/tts/types/TtsBytesRequest.ts b/src/serialization/resources/tts/types/TtsBytesRequest.ts new file mode 100644 index 0000000..09b4925 --- /dev/null +++ b/src/serialization/resources/tts/types/TtsBytesRequest.ts @@ -0,0 +1,33 @@ +/** + * 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 { TtsRequestVoiceSpecifier } from "./TtsRequestVoiceSpecifier"; +import { SupportedLanguage } from "./SupportedLanguage"; +import { BytesOutputFormat } from "./BytesOutputFormat"; + +export const TtsBytesRequest: core.serialization.ObjectSchema< + serializers.TtsBytesRequest.Raw, + Cartesia.TtsBytesRequest +> = core.serialization.object({ + modelId: core.serialization.property("model_id", core.serialization.string()), + transcript: core.serialization.string(), + voice: TtsRequestVoiceSpecifier, + language: SupportedLanguage.optional(), + outputFormat: core.serialization.property("output_format", BytesOutputFormat), + duration: core.serialization.number().optional(), +}); + +export declare namespace TtsBytesRequest { + interface Raw { + model_id: string; + transcript: string; + voice: TtsRequestVoiceSpecifier.Raw; + language?: SupportedLanguage.Raw | null; + output_format: BytesOutputFormat.Raw; + duration?: number | null; + } +} diff --git a/src/serialization/resources/tts/types/TtsRequest.ts b/src/serialization/resources/tts/types/TtssseRequest.ts similarity index 77% rename from src/serialization/resources/tts/types/TtsRequest.ts rename to src/serialization/resources/tts/types/TtssseRequest.ts index 685a0b5..947f0a1 100644 --- a/src/serialization/resources/tts/types/TtsRequest.ts +++ b/src/serialization/resources/tts/types/TtssseRequest.ts @@ -7,25 +7,25 @@ import * as Cartesia from "../../../../api/index"; import * as core from "../../../../core"; import { TtsRequestVoiceSpecifier } from "./TtsRequestVoiceSpecifier"; import { SupportedLanguage } from "./SupportedLanguage"; -import { OutputFormat } from "./OutputFormat"; +import { SseOutputFormat } from "./SseOutputFormat"; -export const TtsRequest: core.serialization.ObjectSchema = +export const TtssseRequest: core.serialization.ObjectSchema = core.serialization.object({ modelId: core.serialization.property("model_id", core.serialization.string()), transcript: core.serialization.string(), voice: TtsRequestVoiceSpecifier, language: SupportedLanguage.optional(), - outputFormat: core.serialization.property("output_format", OutputFormat), + outputFormat: core.serialization.property("output_format", SseOutputFormat), duration: core.serialization.number().optional(), }); -export declare namespace TtsRequest { +export declare namespace TtssseRequest { interface Raw { model_id: string; transcript: string; voice: TtsRequestVoiceSpecifier.Raw; language?: SupportedLanguage.Raw | null; - output_format: OutputFormat.Raw; + output_format: SseOutputFormat.Raw; duration?: number | null; } } diff --git a/src/serialization/resources/tts/types/WavBytesOutputFormat.ts b/src/serialization/resources/tts/types/WavBytesOutputFormat.ts new file mode 100644 index 0000000..0599ceb --- /dev/null +++ b/src/serialization/resources/tts/types/WavBytesOutputFormat.ts @@ -0,0 +1,17 @@ +/** + * 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"; + +export const WavBytesOutputFormat: core.serialization.ObjectSchema< + serializers.WavBytesOutputFormat.Raw, + Cartesia.WavBytesOutputFormat +> = core.serialization.object({}).extend(RawBytesOutputFormat); + +export declare namespace WavBytesOutputFormat { + interface Raw extends RawBytesOutputFormat.Raw {} +} diff --git a/src/serialization/resources/tts/types/WebSocketTtsRequest.ts b/src/serialization/resources/tts/types/WebSocketTtsRequest.ts index ce2e328..8c3e1f5 100644 --- a/src/serialization/resources/tts/types/WebSocketTtsRequest.ts +++ b/src/serialization/resources/tts/types/WebSocketTtsRequest.ts @@ -19,6 +19,7 @@ export const WebSocketTtsRequest: core.serialization.ObjectSchema< duration: core.serialization.number().optional(), language: core.serialization.string().optional(), addTimestamps: core.serialization.property("add_timestamps", core.serialization.boolean().optional()), + continue: core.serialization.boolean().optional(), contextId: core.serialization.property("context_id", core.serialization.string().optional()), }); @@ -31,6 +32,7 @@ export declare namespace WebSocketTtsRequest { duration?: number | null; language?: string | null; add_timestamps?: boolean | null; + continue?: boolean | null; context_id?: string | null; } } diff --git a/src/serialization/resources/tts/types/index.ts b/src/serialization/resources/tts/types/index.ts index 5212040..8d1e2ed 100644 --- a/src/serialization/resources/tts/types/index.ts +++ b/src/serialization/resources/tts/types/index.ts @@ -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"; @@ -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"; diff --git a/src/version.ts b/src/version.ts index 3c98902..b057ce5 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "2.1.2"; +export const SDK_VERSION = "2.1.3"; diff --git a/yarn.lock b/yarn.lock index fae65a7..94bfc35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -663,9 +663,9 @@ form-data "^4.0.0" "@types/node@*": - version "22.10.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.2.tgz#a485426e6d1fdafc7b0d4c7b24e2c78182ddabb9" - integrity sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ== + version "22.10.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.5.tgz#95af89a3fb74a2bb41ef9927f206e6472026e48b" + integrity sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ== dependencies: undici-types "~6.20.0" @@ -1313,7 +1313,7 @@ domexception@^4.0.0: dependencies: webidl-conversions "^7.0.0" -dunder-proto@^1.0.0: +dunder-proto@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== @@ -1323,9 +1323,9 @@ dunder-proto@^1.0.0: gopd "^1.2.0" electron-to-chromium@^1.5.73: - version "1.5.76" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.76.tgz#db20295c5061b68f07c8ea4dfcbd701485d94a3d" - integrity sha512-CjVQyG7n7Sr+eBXE86HIulnL5N8xZY1sgmOPGuq/F0Rr0FJq63lg0kEtOIDfZBk44FnDLf6FUJ+dsJcuiUDdDQ== + version "1.5.77" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.77.tgz#b9e7aa2d833084aac5253d36fc85f99d7cf8ce98" + integrity sha512-AnJSrt5JpRVgY6dgd5yccguLc5A7oMSF0Kt3fcW+Hp5WTuFbl5upeSFZbMZYy2o7jhmIhU8Ekrd82GhyXUqUUg== emittery@^0.13.1: version "0.13.1" @@ -1368,9 +1368,9 @@ es-errors@^1.3.0: integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== es-module-lexer@^1.2.1: - version "1.5.4" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.5.4.tgz#a8efec3a3da991e60efa6b633a7cad6ab8d26b78" - integrity sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw== + version "1.6.0" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.6.0.tgz#da49f587fd9e68ee2404fe4e256c0c7d3a81be21" + integrity sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ== es-object-atoms@^1.0.0: version "1.0.0" @@ -1487,9 +1487,9 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-sta integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fast-uri@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.3.tgz#892a1c91802d5d7860de728f18608a0573142241" - integrity sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw== + version "3.0.5" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.5.tgz#19f5f9691d0dab9b85861a7bb5d98fca961da9cd" + integrity sha512-5JnBCWpFlMo0a3ciDy/JckMzzv1U9coZrIhedq+HXxxUfDTAiS0LA8OKVao4G9BxmCVck/jtA5r3KAtRWEyD8Q== fb-watchman@^2.0.0: version "2.0.2" @@ -1581,26 +1581,34 @@ get-caller-file@^2.0.5: integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-intrinsic@^1.2.5, get-intrinsic@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.6.tgz#43dd3dd0e7b49b82b2dfcad10dc824bf7fc265d5" - integrity sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA== + version "1.2.7" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.7.tgz#dcfcb33d3272e15f445d15124bc0a216189b9044" + integrity sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA== dependencies: call-bind-apply-helpers "^1.0.1" - dunder-proto "^1.0.0" es-define-property "^1.0.1" es-errors "^1.3.0" es-object-atoms "^1.0.0" function-bind "^1.1.2" + get-proto "^1.0.0" gopd "^1.2.0" has-symbols "^1.1.0" hasown "^2.0.2" - math-intrinsics "^1.0.0" + math-intrinsics "^1.1.0" get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-proto@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" + get-stream@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" @@ -2351,7 +2359,7 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" -math-intrinsics@^1.0.0: +math-intrinsics@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==