Skip to content

Commit e5bf5c0

Browse files
SDK regeneration (#332)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 05e0380 commit e5bf5c0

File tree

110 files changed

+713
-1140
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+713
-1140
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elevenlabs/elevenlabs-js",
3-
"version": "v2.30.0",
3+
"version": "v2.31.0",
44
"private": false,
55
"repository": "github:elevenlabs/elevenlabs-js",
66
"license": "MIT",

reference.md

Lines changed: 147 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4327,7 +4327,8 @@ await client.conversationalAi.conversations.list({
43274327
userId: "user_id",
43284328
pageSize: 1,
43294329
summaryMode: "exclude",
4330-
search: "search"
4330+
search: "search",
4331+
conversationInitiationSource: "unknown"
43314332
});
43324333

43334334
```
@@ -9323,6 +9324,69 @@ await client.conversationalAi.knowledgeBase.documents.getContent("21m00Tcm4TlvDq
93239324
</dl>
93249325

93259326

9327+
</dd>
9328+
</dl>
9329+
</details>
9330+
9331+
<details><summary><code>client.conversationalAi.knowledgeBase.documents.<a href="/src/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.ts">getSourceFileUrl</a>(documentation_id) -> ElevenLabs.KnowledgeBaseSourceFileUrlResponseModel</code></summary>
9332+
<dl>
9333+
<dd>
9334+
9335+
#### 📝 Description
9336+
9337+
<dl>
9338+
<dd>
9339+
9340+
<dl>
9341+
<dd>
9342+
9343+
Get a signed URL to download the original source file of a file-type document from the knowledge base
9344+
</dd>
9345+
</dl>
9346+
</dd>
9347+
</dl>
9348+
9349+
#### 🔌 Usage
9350+
9351+
<dl>
9352+
<dd>
9353+
9354+
<dl>
9355+
<dd>
9356+
9357+
```typescript
9358+
await client.conversationalAi.knowledgeBase.documents.getSourceFileUrl("21m00Tcm4TlvDq8ikWAM");
9359+
9360+
```
9361+
</dd>
9362+
</dl>
9363+
</dd>
9364+
</dl>
9365+
9366+
#### ⚙️ Parameters
9367+
9368+
<dl>
9369+
<dd>
9370+
9371+
<dl>
9372+
<dd>
9373+
9374+
**documentation_id:** `string` — The id of a document from the knowledge base. This is returned on document addition.
9375+
9376+
</dd>
9377+
</dl>
9378+
9379+
<dl>
9380+
<dd>
9381+
9382+
**requestOptions:** `DocumentsClient.RequestOptions`
9383+
9384+
</dd>
9385+
</dl>
9386+
</dd>
9387+
</dl>
9388+
9389+
93269390
</dd>
93279391
</dl>
93289392
</details>
@@ -10859,7 +10923,7 @@ Returns transcript for the dub as an SRT or WEBVTT file.
1085910923
<dd>
1086010924

1086110925
```typescript
10862-
await client.dubbing.transcript.getTranscriptForDub("dubbing_id", "language_code", {
10926+
await client.dubbing.transcript.getTranscriptForDub("dubbing_id", "source", {
1086310927
formatType: "srt"
1086410928
});
1086510929

@@ -10885,7 +10949,7 @@ await client.dubbing.transcript.getTranscriptForDub("dubbing_id", "language_code
1088510949
<dl>
1088610950
<dd>
1088710951

10888-
**language_code:** `string`ID of the language.
10952+
**language_code:** `string`ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media.
1088910953

1089010954
</dd>
1089110955
</dl>
@@ -10909,6 +10973,86 @@ await client.dubbing.transcript.getTranscriptForDub("dubbing_id", "language_code
1090910973
</dl>
1091010974

1091110975

10976+
</dd>
10977+
</dl>
10978+
</details>
10979+
10980+
## Dubbing Transcripts
10981+
<details><summary><code>client.dubbing.transcripts.<a href="/src/api/resources/dubbing/resources/transcripts/client/Client.ts">get</a>(dubbing_id, language_code, format_type) -> ElevenLabs.DubbingTranscriptsResponseModel</code></summary>
10982+
<dl>
10983+
<dd>
10984+
10985+
#### 📝 Description
10986+
10987+
<dl>
10988+
<dd>
10989+
10990+
<dl>
10991+
<dd>
10992+
10993+
Fetch the transcript for one of the languages in a dub.
10994+
</dd>
10995+
</dl>
10996+
</dd>
10997+
</dl>
10998+
10999+
#### 🔌 Usage
11000+
11001+
<dl>
11002+
<dd>
11003+
11004+
<dl>
11005+
<dd>
11006+
11007+
```typescript
11008+
await client.dubbing.transcripts.get("dubbing_id", "source", "srt");
11009+
11010+
```
11011+
</dd>
11012+
</dl>
11013+
</dd>
11014+
</dl>
11015+
11016+
#### ⚙️ Parameters
11017+
11018+
<dl>
11019+
<dd>
11020+
11021+
<dl>
11022+
<dd>
11023+
11024+
**dubbing_id:** `string` — ID of the dubbing project.
11025+
11026+
</dd>
11027+
</dl>
11028+
11029+
<dl>
11030+
<dd>
11031+
11032+
**language_code:** `string` — ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media.
11033+
11034+
</dd>
11035+
</dl>
11036+
11037+
<dl>
11038+
<dd>
11039+
11040+
**format_type:** `ElevenLabs.TranscriptsGetRequestFormatType` — Format to return transcript in. For subtitles use either 'srt' or 'webvtt', and for a full transcript use 'json'. The 'json' format is not yet supported for Dubbing Studio.
11041+
11042+
</dd>
11043+
</dl>
11044+
11045+
<dl>
11046+
<dd>
11047+
11048+
**requestOptions:** `TranscriptsClient.RequestOptions`
11049+
11050+
</dd>
11051+
</dl>
11052+
</dd>
11053+
</dl>
11054+
11055+
1091211056
</dd>
1091311057
</dl>
1091411058
</details>

src/BaseClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export function normalizeClientOptions<T extends BaseClientOptions>(options: T):
4747
{
4848
"X-Fern-Language": "JavaScript",
4949
"X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
50-
"X-Fern-SDK-Version": "v2.30.0",
51-
"User-Agent": "@elevenlabs/elevenlabs-js/v2.30.0",
50+
"X-Fern-SDK-Version": "v2.31.0",
51+
"User-Agent": "@elevenlabs/elevenlabs-js/v2.31.0",
5252
"X-Fern-Runtime": core.RUNTIME.type,
5353
"X-Fern-Runtime-Version": core.RUNTIME.version,
5454
"xi-api-key": options?.apiKey,

src/api/resources/conversationalAi/resources/batchCalls/client/requests/BodySubmitABatchCallRequestV1ConvaiBatchCallingSubmitPost.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ export interface BodySubmitABatchCallRequestV1ConvaiBatchCallingSubmitPost {
1717
scheduledTimeUnix?: number;
1818
agentPhoneNumberId?: string;
1919
whatsappParams?: ElevenLabs.BatchCallWhatsAppParams;
20+
timezone?: string;
2021
}

src/api/resources/conversationalAi/resources/conversations/client/Client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ export class ConversationsClient {
241241
* userId: "user_id",
242242
* pageSize: 1,
243243
* summaryMode: "exclude",
244-
* search: "search"
244+
* search: "search",
245+
* conversationInitiationSource: "unknown"
245246
* })
246247
*/
247248
public list(
@@ -274,6 +275,7 @@ export class ConversationsClient {
274275
pageSize,
275276
summaryMode,
276277
search,
278+
conversationInitiationSource,
277279
} = request;
278280
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
279281
if (cursor != null) {
@@ -369,6 +371,13 @@ export class ConversationsClient {
369371
_queryParams.search = search;
370372
}
371373

374+
if (conversationInitiationSource != null) {
375+
_queryParams.conversation_initiation_source = serializers.ConversationInitiationSource.jsonOrThrow(
376+
conversationInitiationSource,
377+
{ unrecognizedObjectKeys: "strip" },
378+
);
379+
}
380+
372381
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
373382
this._options?.headers,
374383
mergeOnlyDefinedHeaders({ "xi-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),

src/api/resources/conversationalAi/resources/conversations/client/requests/ConversationsListRequest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import type * as ElevenLabs from "../../../../../../index";
1818
* userId: "user_id",
1919
* pageSize: 1,
2020
* summaryMode: "exclude",
21-
* search: "search"
21+
* search: "search",
22+
* conversationInitiationSource: "unknown"
2223
* }
2324
*/
2425
export interface ConversationsListRequest {
@@ -58,4 +59,5 @@ export interface ConversationsListRequest {
5859
summaryMode?: ElevenLabs.conversationalAi.ConversationsListRequestSummaryMode;
5960
/** Full-text or fuzzy search over transcript messages */
6061
search?: string;
62+
conversationInitiationSource?: ElevenLabs.ConversationInitiationSource;
6163
}

src/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.ts

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,4 +782,88 @@ export class DocumentsClient {
782782
"/v1/convai/knowledge-base/{documentation_id}/content",
783783
);
784784
}
785+
786+
/**
787+
* Get a signed URL to download the original source file of a file-type document from the knowledge base
788+
*
789+
* @param {string} documentation_id - The id of a document from the knowledge base. This is returned on document addition.
790+
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
791+
*
792+
* @throws {@link ElevenLabs.UnprocessableEntityError}
793+
*
794+
* @example
795+
* await client.conversationalAi.knowledgeBase.documents.getSourceFileUrl("21m00Tcm4TlvDq8ikWAM")
796+
*/
797+
public getSourceFileUrl(
798+
documentation_id: string,
799+
requestOptions?: DocumentsClient.RequestOptions,
800+
): core.HttpResponsePromise<ElevenLabs.KnowledgeBaseSourceFileUrlResponseModel> {
801+
return core.HttpResponsePromise.fromPromise(this.__getSourceFileUrl(documentation_id, requestOptions));
802+
}
803+
804+
private async __getSourceFileUrl(
805+
documentation_id: string,
806+
requestOptions?: DocumentsClient.RequestOptions,
807+
): Promise<core.WithRawResponse<ElevenLabs.KnowledgeBaseSourceFileUrlResponseModel>> {
808+
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
809+
this._options?.headers,
810+
mergeOnlyDefinedHeaders({ "xi-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
811+
requestOptions?.headers,
812+
);
813+
const _response = await (this._options.fetcher ?? core.fetcher)({
814+
url: core.url.join(
815+
(await core.Supplier.get(this._options.baseUrl)) ??
816+
(await core.Supplier.get(this._options.environment)) ??
817+
environments.ElevenLabsEnvironment.Production,
818+
`v1/convai/knowledge-base/${core.url.encodePathParam(documentation_id)}/source-file-url`,
819+
),
820+
method: "GET",
821+
headers: _headers,
822+
queryParameters: requestOptions?.queryParams,
823+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 240) * 1000,
824+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
825+
abortSignal: requestOptions?.abortSignal,
826+
fetchFn: this._options?.fetch,
827+
logging: this._options.logging,
828+
});
829+
if (_response.ok) {
830+
return {
831+
data: serializers.KnowledgeBaseSourceFileUrlResponseModel.parseOrThrow(_response.body, {
832+
unrecognizedObjectKeys: "passthrough",
833+
allowUnrecognizedUnionMembers: true,
834+
allowUnrecognizedEnumValues: true,
835+
breadcrumbsPrefix: ["response"],
836+
}),
837+
rawResponse: _response.rawResponse,
838+
};
839+
}
840+
841+
if (_response.error.reason === "status-code") {
842+
switch (_response.error.statusCode) {
843+
case 422:
844+
throw new ElevenLabs.UnprocessableEntityError(
845+
serializers.HttpValidationError.parseOrThrow(_response.error.body, {
846+
unrecognizedObjectKeys: "passthrough",
847+
allowUnrecognizedUnionMembers: true,
848+
allowUnrecognizedEnumValues: true,
849+
breadcrumbsPrefix: ["response"],
850+
}),
851+
_response.rawResponse,
852+
);
853+
default:
854+
throw new errors.ElevenLabsError({
855+
statusCode: _response.error.statusCode,
856+
body: _response.error.body,
857+
rawResponse: _response.rawResponse,
858+
});
859+
}
860+
}
861+
862+
return handleNonStatusCodeError(
863+
_response.error,
864+
_response.rawResponse,
865+
"GET",
866+
"/v1/convai/knowledge-base/{documentation_id}/source-file-url",
867+
);
868+
}
785869
}

src/api/resources/dubbing/client/Client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import * as ElevenLabs from "../../../index";
1212
import { AudioClient } from "../resources/audio/client/Client";
1313
import { ResourceClient } from "../resources/resource/client/Client";
1414
import { TranscriptClient } from "../resources/transcript/client/Client";
15+
import { TranscriptsClient } from "../resources/transcripts/client/Client";
1516

1617
export declare namespace DubbingClient {
1718
export type Options = BaseClientOptions;
@@ -24,6 +25,7 @@ export class DubbingClient {
2425
protected _resource: ResourceClient | undefined;
2526
protected _audio: AudioClient | undefined;
2627
protected _transcript: TranscriptClient | undefined;
28+
protected _transcripts: TranscriptsClient | undefined;
2729

2830
constructor(options: DubbingClient.Options = {}) {
2931
this._options = normalizeClientOptions(options);
@@ -41,6 +43,10 @@ export class DubbingClient {
4143
return (this._transcript ??= new TranscriptClient(this._options));
4244
}
4345

46+
public get transcripts(): TranscriptsClient {
47+
return (this._transcripts ??= new TranscriptsClient(this._options));
48+
}
49+
4450
/**
4551
* List the dubs you have access to.
4652
*

src/api/resources/dubbing/resources/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ export * from "./resource/client/requests";
44
export * as transcript from "./transcript";
55
export * from "./transcript/client/requests";
66
export * from "./transcript/types";
7+
export * as transcripts from "./transcripts";
8+
export * from "./transcripts/types";

src/api/resources/dubbing/resources/transcript/client/Client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class TranscriptClient {
2727
* Returns transcript for the dub as an SRT or WEBVTT file.
2828
*
2929
* @param {string} dubbing_id - ID of the dubbing project.
30-
* @param {string} language_code - ID of the language.
30+
* @param {string} language_code - ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media.
3131
* @param {ElevenLabs.dubbing.TranscriptGetTranscriptForDubRequest} request
3232
* @param {TranscriptClient.RequestOptions} requestOptions - Request-specific configuration.
3333
*
@@ -37,7 +37,7 @@ export class TranscriptClient {
3737
* @throws {@link ElevenLabs.TooEarlyError}
3838
*
3939
* @example
40-
* await client.dubbing.transcript.getTranscriptForDub("dubbing_id", "language_code", {
40+
* await client.dubbing.transcript.getTranscriptForDub("dubbing_id", "source", {
4141
* formatType: "srt"
4242
* })
4343
*/

0 commit comments

Comments
 (0)