Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Dec 13, 2024
1 parent 3cf4051 commit 8ba696a
Show file tree
Hide file tree
Showing 111 changed files with 1,162 additions and 672 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elevenlabs",
"version": "0.18.1",
"version": "v0.19.0",
"private": false,
"repository": "https://github.com/elevenlabs/elevenlabs-js",
"license": "MIT",
Expand Down Expand Up @@ -28,7 +28,6 @@
"@types/qs": "6.9.8",
"@types/node-fetch": "2.6.9",
"@types/readable-stream": "^4.0.15",
"fetch-mock-jest": "^1.5.1",
"webpack": "^5.94.0",
"ts-loader": "^9.3.1",
"jest": "^29.7.0",
Expand Down
7 changes: 5 additions & 2 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ await client.textToSpeech.convertAsStream("pMsXgVXv3BLzUgSXRplE", {
</dl>
</details>

<details><summary><code>client.textToSpeech.<a href="/src/api/resources/textToSpeech/client/Client.ts">streamWithTimestamps</a>(voiceId, { ...params }) -> void</code></summary>
<details><summary><code>client.textToSpeech.<a href="/src/api/resources/textToSpeech/client/Client.ts">streamWithTimestamps</a>(voiceId, { ...params }) -> core.Stream<ElevenLabs.TextToSpeechStreamWithTimestampsResponse></code></summary>
<dl>
<dd>

Expand Down Expand Up @@ -733,9 +733,12 @@ Converts text into speech using a voice of your choice and returns a stream of J
<dd>

```typescript
await client.textToSpeech.streamWithTimestamps("21m00Tcm4TlvDq8ikWAM", {
const response = await client.textToSpeech.streamWithTimestamps("21m00Tcm4TlvDq8ikWAM", {
text: "text",
});
for await (const item of response) {
console.log(item);
}
```

</dd>
Expand Down
60 changes: 22 additions & 38 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,122 +40,106 @@ export declare namespace ElevenLabsClient {
abortSignal?: AbortSignal;
/** Override the xi-api-key header */
apiKey?: string | undefined;
/** Additional headers to include in the request. */
headers?: Record<string, string>;
}
}

export class ElevenLabsClient {
constructor(protected readonly _options: ElevenLabsClient.Options = {}) {}

protected _history: History | undefined;
protected _textToSoundEffects: TextToSoundEffects | undefined;
protected _audioIsolation: AudioIsolation | undefined;
protected _samples: Samples | undefined;
protected _textToSpeech: TextToSpeech | undefined;
protected _speechToSpeech: SpeechToSpeech | undefined;
protected _voiceGeneration: VoiceGeneration | undefined;
protected _textToVoice: TextToVoice | undefined;
protected _user: User | undefined;
protected _voices: Voices | undefined;
protected _projects: Projects | undefined;
protected _chapters: Chapters | undefined;
protected _dubbing: Dubbing | undefined;
protected _models: Models | undefined;
protected _audioNative: AudioNative | undefined;
protected _usage: Usage | undefined;
protected _pronunciationDictionary: PronunciationDictionary | undefined;
protected _workspace: Workspace | undefined;
protected _conversationalAi: ConversationalAi | undefined;

constructor(protected readonly _options: ElevenLabsClient.Options = {}) {}

public get history(): History {
return (this._history ??= new History(this._options));
}

protected _textToSoundEffects: TextToSoundEffects | undefined;

public get textToSoundEffects(): TextToSoundEffects {
return (this._textToSoundEffects ??= new TextToSoundEffects(this._options));
}

protected _audioIsolation: AudioIsolation | undefined;

public get audioIsolation(): AudioIsolation {
return (this._audioIsolation ??= new AudioIsolation(this._options));
}

protected _samples: Samples | undefined;

public get samples(): Samples {
return (this._samples ??= new Samples(this._options));
}

protected _textToSpeech: TextToSpeech | undefined;

public get textToSpeech(): TextToSpeech {
return (this._textToSpeech ??= new TextToSpeech(this._options));
}

protected _speechToSpeech: SpeechToSpeech | undefined;

public get speechToSpeech(): SpeechToSpeech {
return (this._speechToSpeech ??= new SpeechToSpeech(this._options));
}

protected _voiceGeneration: VoiceGeneration | undefined;

public get voiceGeneration(): VoiceGeneration {
return (this._voiceGeneration ??= new VoiceGeneration(this._options));
}

protected _textToVoice: TextToVoice | undefined;

public get textToVoice(): TextToVoice {
return (this._textToVoice ??= new TextToVoice(this._options));
}

protected _user: User | undefined;

public get user(): User {
return (this._user ??= new User(this._options));
}

protected _voices: Voices | undefined;

public get voices(): Voices {
return (this._voices ??= new Voices(this._options));
}

protected _projects: Projects | undefined;

public get projects(): Projects {
return (this._projects ??= new Projects(this._options));
}

protected _chapters: Chapters | undefined;

public get chapters(): Chapters {
return (this._chapters ??= new Chapters(this._options));
}

protected _dubbing: Dubbing | undefined;

public get dubbing(): Dubbing {
return (this._dubbing ??= new Dubbing(this._options));
}

protected _models: Models | undefined;

public get models(): Models {
return (this._models ??= new Models(this._options));
}

protected _audioNative: AudioNative | undefined;

public get audioNative(): AudioNative {
return (this._audioNative ??= new AudioNative(this._options));
}

protected _usage: Usage | undefined;

public get usage(): Usage {
return (this._usage ??= new Usage(this._options));
}

protected _pronunciationDictionary: PronunciationDictionary | undefined;

public get pronunciationDictionary(): PronunciationDictionary {
return (this._pronunciationDictionary ??= new PronunciationDictionary(this._options));
}

protected _workspace: Workspace | undefined;

public get workspace(): Workspace {
return (this._workspace ??= new Workspace(this._options));
}

protected _conversationalAi: ConversationalAi | undefined;

public get conversationalAi(): ConversationalAi {
return (this._conversationalAi ??= new ConversationalAi(this._options));
}
Expand Down
18 changes: 12 additions & 6 deletions src/api/resources/audioIsolation/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export declare namespace AudioIsolation {
abortSignal?: AbortSignal;
/** Override the xi-api-key header */
apiKey?: string | undefined;
/** Additional headers to include in the request. */
headers?: Record<string, string>;
}
}

Expand Down Expand Up @@ -55,11 +57,12 @@ export class AudioIsolation {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "elevenlabs",
"X-Fern-SDK-Version": "0.18.1",
"User-Agent": "elevenlabs/0.18.1",
"X-Fern-SDK-Version": "v0.19.0",
"User-Agent": "elevenlabs/v0.19.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
..._maybeEncodedRequest.headers,
...requestOptions?.headers,
},
requestType: "file",
duplex: _maybeEncodedRequest.duplex,
Expand Down Expand Up @@ -94,7 +97,7 @@ export class AudioIsolation {
body: _response.error.rawBody,
});
case "timeout":
throw new errors.ElevenLabsTimeoutError();
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/audio-isolation.");
case "unknown":
throw new errors.ElevenLabsError({
message: _response.error.errorMessage,
Expand Down Expand Up @@ -126,11 +129,12 @@ export class AudioIsolation {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "elevenlabs",
"X-Fern-SDK-Version": "0.18.1",
"User-Agent": "elevenlabs/0.18.1",
"X-Fern-SDK-Version": "v0.19.0",
"User-Agent": "elevenlabs/v0.19.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
..._maybeEncodedRequest.headers,
...requestOptions?.headers,
},
requestType: "file",
duplex: _maybeEncodedRequest.duplex,
Expand Down Expand Up @@ -165,7 +169,9 @@ export class AudioIsolation {
body: _response.error.rawBody,
});
case "timeout":
throw new errors.ElevenLabsTimeoutError();
throw new errors.ElevenLabsTimeoutError(
"Timeout exceeded when calling POST /v1/audio-isolation/stream."
);
case "unknown":
throw new errors.ElevenLabsError({
message: _response.error.errorMessage,
Expand Down
9 changes: 6 additions & 3 deletions src/api/resources/audioNative/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export declare namespace AudioNative {
abortSignal?: AbortSignal;
/** Override the xi-api-key header */
apiKey?: string | undefined;
/** Additional headers to include in the request. */
headers?: Record<string, string>;
}
}

Expand Down Expand Up @@ -107,11 +109,12 @@ export class AudioNative {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "elevenlabs",
"X-Fern-SDK-Version": "0.18.1",
"User-Agent": "elevenlabs/0.18.1",
"X-Fern-SDK-Version": "v0.19.0",
"User-Agent": "elevenlabs/v0.19.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
..._maybeEncodedRequest.headers,
...requestOptions?.headers,
},
requestType: "file",
duplex: _maybeEncodedRequest.duplex,
Expand Down Expand Up @@ -145,7 +148,7 @@ export class AudioNative {
body: _response.error.rawBody,
});
case "timeout":
throw new errors.ElevenLabsTimeoutError();
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/audio-native.");
case "unknown":
throw new errors.ElevenLabsError({
message: _response.error.errorMessage,
Expand Down
Loading

0 comments on commit 8ba696a

Please sign in to comment.