diff --git a/package.json b/package.json index e070922b..01f231f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@elevenlabs/elevenlabs-js", - "version": "v2.33.0", + "version": "v2.34.0", "private": false, "repository": "github:elevenlabs/elevenlabs-js", "license": "MIT", diff --git a/reference.md b/reference.md index c731ffb6..2aab15f1 100644 --- a/reference.md +++ b/reference.md @@ -1073,7 +1073,7 @@ Generate dialogue from text with precise character-level timing information for ```typescript await client.textToDialogue.convertWithTimestamps({ - outputFormat: "mp3_22050_32", + outputFormat: "alaw_8000", inputs: [{ text: "Hello, how are you?", voiceId: "bYTqZQo3Jz7LQtmGTgwi" @@ -6832,7 +6832,7 @@ await client.conversationalAi.settings.update(); ## ConversationalAi Secrets -
client.conversationalAi.secrets.list() -> ElevenLabs.GetWorkspaceSecretsResponseModel +
client.conversationalAi.secrets.list({ ...params }) -> ElevenLabs.GetWorkspaceSecretsResponseModel
@@ -6859,7 +6859,10 @@ Get all workspace secrets for the user
```typescript -await client.conversationalAi.secrets.list(); +await client.conversationalAi.secrets.list({ + pageSize: 1, + cursor: "cursor" +}); ```
@@ -6875,6 +6878,14 @@ await client.conversationalAi.secrets.list();
+**request:** `ElevenLabs.conversationalAi.SecretsListRequest` + +
+
+ +
+
+ **requestOptions:** `SecretsClient.RequestOptions`
@@ -7866,62 +7877,7 @@ await client.conversationalAi.mcpServers.update("mcp_server_id");
## ConversationalAi WhatsappAccounts -
client.conversationalAi.whatsappAccounts.list() -> ElevenLabs.ListWhatsAppAccountsResponse -
-
- -#### 📝 Description - -
-
- -
-
- -List all WhatsApp accounts -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.conversationalAi.whatsappAccounts.list(); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**requestOptions:** `WhatsappAccountsClient.RequestOptions` - -
-
-
-
- - -
-
-
- -
client.conversationalAi.whatsappAccounts.import({ ...params }) -> ElevenLabs.ImportWhatsAppAccountResponse +
client.conversationalAi.whatsappAccounts.get(phone_number_id) -> ElevenLabs.GetWhatsAppAccountResponse
@@ -7933,7 +7889,7 @@ await client.conversationalAi.whatsappAccounts.list();
-Import a WhatsApp account +Get a WhatsApp account
@@ -7948,11 +7904,7 @@ Import a WhatsApp account
```typescript -await client.conversationalAi.whatsappAccounts.import({ - businessAccountId: "business_account_id", - phoneNumberId: "phone_number_id", - tokenCode: "token_code" -}); +await client.conversationalAi.whatsappAccounts.get("phone_number_id"); ```
@@ -7968,7 +7920,7 @@ await client.conversationalAi.whatsappAccounts.import({
-**request:** `ElevenLabs.conversationalAi.ImportWhatsAppAccountRequest` +**phone_number_id:** `string`
@@ -7988,7 +7940,7 @@ await client.conversationalAi.whatsappAccounts.import({
-
client.conversationalAi.whatsappAccounts.get(phone_number_id) -> ElevenLabs.GetWhatsAppAccountResponse +
client.conversationalAi.whatsappAccounts.delete(phone_number_id) -> unknown
@@ -8000,7 +7952,7 @@ await client.conversationalAi.whatsappAccounts.import({
-Get a WhatsApp account +Delete a WhatsApp account
@@ -8015,7 +7967,7 @@ Get a WhatsApp account
```typescript -await client.conversationalAi.whatsappAccounts.get("phone_number_id"); +await client.conversationalAi.whatsappAccounts.delete("phone_number_id"); ```
@@ -8051,7 +8003,7 @@ await client.conversationalAi.whatsappAccounts.get("phone_number_id");
-
client.conversationalAi.whatsappAccounts.delete(phone_number_id) -> unknown +
client.conversationalAi.whatsappAccounts.update(phone_number_id, { ...params }) -> unknown
@@ -8063,7 +8015,7 @@ await client.conversationalAi.whatsappAccounts.get("phone_number_id");
-Delete a WhatsApp account +Update a WhatsApp account
@@ -8078,7 +8030,7 @@ Delete a WhatsApp account
```typescript -await client.conversationalAi.whatsappAccounts.delete("phone_number_id"); +await client.conversationalAi.whatsappAccounts.update("phone_number_id"); ```
@@ -8102,6 +8054,14 @@ await client.conversationalAi.whatsappAccounts.delete("phone_number_id");
+**request:** `ElevenLabs.conversationalAi.UpdateWhatsAppAccountRequest` + +
+
+ +
+
+ **requestOptions:** `WhatsappAccountsClient.RequestOptions`
@@ -8114,7 +8074,7 @@ await client.conversationalAi.whatsappAccounts.delete("phone_number_id");
-
client.conversationalAi.whatsappAccounts.update(phone_number_id, { ...params }) -> unknown +
client.conversationalAi.whatsappAccounts.list() -> ElevenLabs.ListWhatsAppAccountsResponse
@@ -8126,7 +8086,7 @@ await client.conversationalAi.whatsappAccounts.delete("phone_number_id");
-Update a WhatsApp account +List all WhatsApp accounts
@@ -8141,7 +8101,7 @@ Update a WhatsApp account
```typescript -await client.conversationalAi.whatsappAccounts.update("phone_number_id"); +await client.conversationalAi.whatsappAccounts.list(); ```
@@ -8157,22 +8117,6 @@ await client.conversationalAi.whatsappAccounts.update("phone_number_id");
-**phone_number_id:** `string` - -
-
- -
-
- -**request:** `ElevenLabs.conversationalAi.UpdateWhatsAppAccountRequest` - -
-
- -
-
- **requestOptions:** `WhatsappAccountsClient.RequestOptions`
@@ -16437,7 +16381,7 @@ await client.workspace.groups.search({
-Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned. +Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. If the user is already in the workspace a 400 error will be returned.
@@ -16502,7 +16446,7 @@ await client.workspace.invites.create({
-Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. +Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission.
@@ -16567,7 +16511,7 @@ await client.workspace.invites.createBatch({
-Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators. +Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission.
@@ -16920,7 +16864,7 @@ await client.workspace.resources.unshare("resource_id", {
-Removes a member from the specified group. This endpoint may only be called by workspace administrators. +Removes a member from the specified group. Requires `group_members_manage` permission.
@@ -16993,7 +16937,7 @@ await client.workspace.groups.members.remove("group_id", {
-Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators. +Adds a member of your workspace to the specified group. Requires `group_members_manage` permission.
diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 2d15c16d..c2107817 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -47,8 +47,8 @@ export function normalizeClientOptions(options: T): { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", - "X-Fern-SDK-Version": "v2.33.0", - "User-Agent": "@elevenlabs/elevenlabs-js/v2.33.0", + "X-Fern-SDK-Version": "v2.34.0", + "User-Agent": "@elevenlabs/elevenlabs-js/v2.34.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, "xi-api-key": options?.apiKey, diff --git a/src/Client.ts b/src/Client.ts index 5a264ea9..2101e36f 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -165,6 +165,57 @@ export class ElevenLabsClient { return (this._workspace ??= new WorkspaceClient(this._options)); } + /** + * @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.postV1ConvaiWhatsappAccounts() + */ + public postV1ConvaiWhatsappAccounts( + requestOptions?: ElevenLabsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__postV1ConvaiWhatsappAccounts(requestOptions)); + } + + private async __postV1ConvaiWhatsappAccounts( + requestOptions?: ElevenLabsClient.RequestOptions, + ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ "xi-api-key": requestOptions?.apiKey ?? this._options?.apiKey }), + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ElevenLabsEnvironment.Production, + "v1/convai/whatsapp-accounts", + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 240) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/convai/whatsapp-accounts"); + } + /** * @param {string} agent_id * @param {string} branch_id diff --git a/src/api/resources/conversationalAi/resources/agents/client/requests/UpdateAgentRequest.ts b/src/api/resources/conversationalAi/resources/agents/client/requests/UpdateAgentRequest.ts index c3462cf4..8c5c1965 100644 --- a/src/api/resources/conversationalAi/resources/agents/client/requests/UpdateAgentRequest.ts +++ b/src/api/resources/conversationalAi/resources/agents/client/requests/UpdateAgentRequest.ts @@ -19,4 +19,6 @@ export interface UpdateAgentRequest { tags?: string[]; /** Description for this version when publishing changes (only applicable for versioned agents) */ versionDescription?: string; + /** List of procedure refs used for this agent version. */ + procedureRefs?: ElevenLabs.conversationalAi.BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem[]; } diff --git a/src/api/resources/conversationalAi/resources/agents/index.ts b/src/api/resources/conversationalAi/resources/agents/index.ts index 33a87f10..fb00ab43 100644 --- a/src/api/resources/conversationalAi/resources/agents/index.ts +++ b/src/api/resources/conversationalAi/resources/agents/index.ts @@ -1,2 +1,3 @@ export * from "./client"; export * from "./resources"; +export * from "./types"; diff --git a/src/api/resources/conversationalAi/resources/agents/resources/branches/client/requests/BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch.ts b/src/api/resources/conversationalAi/resources/agents/resources/branches/client/requests/BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch.ts index be094509..56f419dd 100644 --- a/src/api/resources/conversationalAi/resources/agents/resources/branches/client/requests/BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch.ts +++ b/src/api/resources/conversationalAi/resources/agents/resources/branches/client/requests/BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch.ts @@ -7,6 +7,8 @@ import type * as ElevenLabs from "../../../../../../../../index"; * {} */ export interface BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch { + /** New name for the branch. Must be unique within the agent. */ + name?: string; /** Whether the branch should be archived */ isArchived?: boolean; /** The protection level for the branch */ diff --git a/src/api/resources/conversationalAi/resources/agents/types/BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem.ts b/src/api/resources/conversationalAi/resources/agents/types/BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem.ts new file mode 100644 index 00000000..cab311a3 --- /dev/null +++ b/src/api/resources/conversationalAi/resources/agents/types/BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as ElevenLabs from "../../../../../index"; + +export type BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem = + | ElevenLabs.ProcedureVersionRef + | ElevenLabs.ProcedureDraftRef; diff --git a/src/api/resources/conversationalAi/resources/agents/types/index.ts b/src/api/resources/conversationalAi/resources/agents/types/index.ts new file mode 100644 index 00000000..a78e5988 --- /dev/null +++ b/src/api/resources/conversationalAi/resources/agents/types/index.ts @@ -0,0 +1 @@ +export * from "./BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem"; diff --git a/src/api/resources/conversationalAi/resources/index.ts b/src/api/resources/conversationalAi/resources/index.ts index db65e016..d310da80 100644 --- a/src/api/resources/conversationalAi/resources/index.ts +++ b/src/api/resources/conversationalAi/resources/index.ts @@ -1,5 +1,6 @@ export * as agents from "./agents"; export * from "./agents/client/requests"; +export * from "./agents/types"; export * as analytics from "./analytics"; export * as batchCalls from "./batchCalls"; export * from "./batchCalls/client/requests"; diff --git a/src/api/resources/conversationalAi/resources/secrets/client/Client.ts b/src/api/resources/conversationalAi/resources/secrets/client/Client.ts index af58983b..d0522619 100644 --- a/src/api/resources/conversationalAi/resources/secrets/client/Client.ts +++ b/src/api/resources/conversationalAi/resources/secrets/client/Client.ts @@ -26,22 +26,38 @@ export class SecretsClient { /** * Get all workspace secrets for the user * + * @param {ElevenLabs.conversationalAi.SecretsListRequest} request * @param {SecretsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.conversationalAi.secrets.list() + * await client.conversationalAi.secrets.list({ + * pageSize: 1, + * cursor: "cursor" + * }) */ public list( + request: ElevenLabs.conversationalAi.SecretsListRequest = {}, requestOptions?: SecretsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( + request: ElevenLabs.conversationalAi.SecretsListRequest = {}, requestOptions?: SecretsClient.RequestOptions, ): Promise> { + const { pageSize, cursor } = request; + const _queryParams: Record = {}; + if (pageSize != null) { + _queryParams.page_size = pageSize.toString(); + } + + if (cursor != null) { + _queryParams.cursor = cursor; + } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ "xi-api-key": requestOptions?.apiKey ?? this._options?.apiKey }), @@ -56,7 +72,7 @@ export class SecretsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 240) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/conversationalAi/resources/secrets/client/requests/SecretsListRequest.ts b/src/api/resources/conversationalAi/resources/secrets/client/requests/SecretsListRequest.ts new file mode 100644 index 00000000..7ef107c5 --- /dev/null +++ b/src/api/resources/conversationalAi/resources/secrets/client/requests/SecretsListRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pageSize: 1, + * cursor: "cursor" + * } + */ +export interface SecretsListRequest { + /** How many documents to return at maximum. Can not exceed 100. If not provided, returns all secrets. */ + pageSize?: number; + /** Used for fetching next page. Cursor is returned in the response. */ + cursor?: string; +} diff --git a/src/api/resources/conversationalAi/resources/secrets/client/requests/index.ts b/src/api/resources/conversationalAi/resources/secrets/client/requests/index.ts index bbe2630a..6b0208fe 100644 --- a/src/api/resources/conversationalAi/resources/secrets/client/requests/index.ts +++ b/src/api/resources/conversationalAi/resources/secrets/client/requests/index.ts @@ -1,2 +1,3 @@ export type { PatchWorkspaceSecretRequest } from "./PatchWorkspaceSecretRequest"; export type { PostWorkspaceSecretRequest } from "./PostWorkspaceSecretRequest"; +export type { SecretsListRequest } from "./SecretsListRequest"; diff --git a/src/api/resources/conversationalAi/resources/tests/client/requests/CreateUnitTestRequest.ts b/src/api/resources/conversationalAi/resources/tests/client/requests/CreateUnitTestRequest.ts index ebab9402..145cecfc 100644 --- a/src/api/resources/conversationalAi/resources/tests/client/requests/CreateUnitTestRequest.ts +++ b/src/api/resources/conversationalAi/resources/tests/client/requests/CreateUnitTestRequest.ts @@ -31,6 +31,8 @@ export interface CreateUnitTestRequest { failureExamples: ElevenLabs.AgentFailureResponseExample[]; /** How to evaluate the agent's tool call (if any). If empty, the tool call is not evaluated. */ toolCallParameters?: ElevenLabs.UnitTestToolCallEvaluationModelInput; + /** If set to True this test will pass if any tool call returned by the LLM matches the criteria. Otherwise it will fail if more than one tool is returned by the agent. */ + checkAnyToolMatches?: boolean; /** Dynamic variables to replace in the agent config during testing */ dynamicVariables?: Record< string, diff --git a/src/api/resources/conversationalAi/resources/tests/client/requests/UpdateUnitTestRequest.ts b/src/api/resources/conversationalAi/resources/tests/client/requests/UpdateUnitTestRequest.ts index fb947399..0ffe724b 100644 --- a/src/api/resources/conversationalAi/resources/tests/client/requests/UpdateUnitTestRequest.ts +++ b/src/api/resources/conversationalAi/resources/tests/client/requests/UpdateUnitTestRequest.ts @@ -31,6 +31,8 @@ export interface UpdateUnitTestRequest { failureExamples: ElevenLabs.AgentFailureResponseExample[]; /** How to evaluate the agent's tool call (if any). If empty, the tool call is not evaluated. */ toolCallParameters?: ElevenLabs.UnitTestToolCallEvaluationModelInput; + /** If set to True this test will pass if any tool call returned by the LLM matches the criteria. Otherwise it will fail if more than one tool is returned by the agent. */ + checkAnyToolMatches?: boolean; /** Dynamic variables to replace in the agent config during testing */ dynamicVariables?: Record< string, diff --git a/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts b/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts index 26afa79a..e95ed12b 100644 --- a/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts +++ b/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts @@ -24,24 +24,27 @@ export class WhatsappAccountsClient { } /** - * List all WhatsApp accounts + * Get a WhatsApp account * + * @param {string} phone_number_id * @param {WhatsappAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.conversationalAi.whatsappAccounts.list() + * await client.conversationalAi.whatsappAccounts.get("phone_number_id") */ - public list( + public get( + phone_number_id: string, requestOptions?: WhatsappAccountsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(phone_number_id, requestOptions)); } - private async __list( + private async __get( + phone_number_id: string, requestOptions?: WhatsappAccountsClient.RequestOptions, - ): Promise> { + ): Promise> { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ "xi-api-key": requestOptions?.apiKey ?? this._options?.apiKey }), @@ -52,7 +55,7 @@ export class WhatsappAccountsClient { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.ElevenLabsEnvironment.Production, - "v1/convai/whatsapp-accounts", + `v1/convai/whatsapp-accounts/${core.url.encodePathParam(phone_number_id)}`, ), method: "GET", headers: _headers, @@ -65,7 +68,7 @@ export class WhatsappAccountsClient { }); if (_response.ok) { return { - data: serializers.ListWhatsAppAccountsResponse.parseOrThrow(_response.body, { + data: serializers.GetWhatsAppAccountResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -96,99 +99,16 @@ export class WhatsappAccountsClient { } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/convai/whatsapp-accounts"); - } - - /** - * Import a WhatsApp account - * - * @param {ElevenLabs.conversationalAi.ImportWhatsAppAccountRequest} request - * @param {WhatsappAccountsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link ElevenLabs.UnprocessableEntityError} - * - * @example - * await client.conversationalAi.whatsappAccounts.import({ - * businessAccountId: "business_account_id", - * phoneNumberId: "phone_number_id", - * tokenCode: "token_code" - * }) - */ - public import( - request: ElevenLabs.conversationalAi.ImportWhatsAppAccountRequest, - requestOptions?: WhatsappAccountsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__import(request, requestOptions)); - } - - private async __import( - request: ElevenLabs.conversationalAi.ImportWhatsAppAccountRequest, - requestOptions?: WhatsappAccountsClient.RequestOptions, - ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ "xi-api-key": requestOptions?.apiKey ?? this._options?.apiKey }), - requestOptions?.headers, + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v1/convai/whatsapp-accounts/{phone_number_id}", ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.ElevenLabsEnvironment.Production, - "v1/convai/whatsapp-accounts", - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.conversationalAi.ImportWhatsAppAccountRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 240) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.ImportWhatsAppAccountResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 422: - throw new ElevenLabs.UnprocessableEntityError( - serializers.HttpValidationError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - default: - throw new errors.ElevenLabsError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/convai/whatsapp-accounts"); } /** - * Get a WhatsApp account + * Delete a WhatsApp account * * @param {string} phone_number_id * @param {WhatsappAccountsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -196,19 +116,19 @@ export class WhatsappAccountsClient { * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.conversationalAi.whatsappAccounts.get("phone_number_id") + * await client.conversationalAi.whatsappAccounts.delete("phone_number_id") */ - public get( + public delete( phone_number_id: string, requestOptions?: WhatsappAccountsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(phone_number_id, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(phone_number_id, requestOptions)); } - private async __get( + private async __delete( phone_number_id: string, requestOptions?: WhatsappAccountsClient.RequestOptions, - ): Promise> { + ): Promise> { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ "xi-api-key": requestOptions?.apiKey ?? this._options?.apiKey }), @@ -221,7 +141,7 @@ export class WhatsappAccountsClient { environments.ElevenLabsEnvironment.Production, `v1/convai/whatsapp-accounts/${core.url.encodePathParam(phone_number_id)}`, ), - method: "GET", + method: "DELETE", headers: _headers, queryParameters: requestOptions?.queryParams, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 240) * 1000, @@ -231,15 +151,7 @@ export class WhatsappAccountsClient { logging: this._options.logging, }); if (_response.ok) { - return { - data: serializers.GetWhatsAppAccountResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -266,31 +178,34 @@ export class WhatsappAccountsClient { return handleNonStatusCodeError( _response.error, _response.rawResponse, - "GET", + "DELETE", "/v1/convai/whatsapp-accounts/{phone_number_id}", ); } /** - * Delete a WhatsApp account + * Update a WhatsApp account * * @param {string} phone_number_id + * @param {ElevenLabs.conversationalAi.UpdateWhatsAppAccountRequest} request * @param {WhatsappAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.conversationalAi.whatsappAccounts.delete("phone_number_id") + * await client.conversationalAi.whatsappAccounts.update("phone_number_id") */ - public delete( + public update( phone_number_id: string, + request: ElevenLabs.conversationalAi.UpdateWhatsAppAccountRequest = {}, requestOptions?: WhatsappAccountsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(phone_number_id, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__update(phone_number_id, request, requestOptions)); } - private async __delete( + private async __update( phone_number_id: string, + request: ElevenLabs.conversationalAi.UpdateWhatsAppAccountRequest = {}, requestOptions?: WhatsappAccountsClient.RequestOptions, ): Promise> { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -305,9 +220,14 @@ export class WhatsappAccountsClient { environments.ElevenLabsEnvironment.Production, `v1/convai/whatsapp-accounts/${core.url.encodePathParam(phone_number_id)}`, ), - method: "DELETE", + method: "PATCH", headers: _headers, + contentType: "application/json", queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.conversationalAi.UpdateWhatsAppAccountRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 240) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -342,36 +262,30 @@ export class WhatsappAccountsClient { return handleNonStatusCodeError( _response.error, _response.rawResponse, - "DELETE", + "PATCH", "/v1/convai/whatsapp-accounts/{phone_number_id}", ); } /** - * Update a WhatsApp account + * List all WhatsApp accounts * - * @param {string} phone_number_id - * @param {ElevenLabs.conversationalAi.UpdateWhatsAppAccountRequest} request * @param {WhatsappAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.conversationalAi.whatsappAccounts.update("phone_number_id") + * await client.conversationalAi.whatsappAccounts.list() */ - public update( - phone_number_id: string, - request: ElevenLabs.conversationalAi.UpdateWhatsAppAccountRequest = {}, + public list( requestOptions?: WhatsappAccountsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__update(phone_number_id, request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(requestOptions)); } - private async __update( - phone_number_id: string, - request: ElevenLabs.conversationalAi.UpdateWhatsAppAccountRequest = {}, + private async __list( requestOptions?: WhatsappAccountsClient.RequestOptions, - ): Promise> { + ): Promise> { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ "xi-api-key": requestOptions?.apiKey ?? this._options?.apiKey }), @@ -382,16 +296,11 @@ export class WhatsappAccountsClient { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.ElevenLabsEnvironment.Production, - `v1/convai/whatsapp-accounts/${core.url.encodePathParam(phone_number_id)}`, + "v1/convai/whatsapp-accounts", ), - method: "PATCH", + method: "GET", headers: _headers, - contentType: "application/json", queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.conversationalAi.UpdateWhatsAppAccountRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 240) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -399,7 +308,15 @@ export class WhatsappAccountsClient { logging: this._options.logging, }); if (_response.ok) { - return { data: _response.body, rawResponse: _response.rawResponse }; + return { + data: serializers.ListWhatsAppAccountsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { @@ -423,11 +340,6 @@ export class WhatsappAccountsClient { } } - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "PATCH", - "/v1/convai/whatsapp-accounts/{phone_number_id}", - ); + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/convai/whatsapp-accounts"); } } diff --git a/src/api/resources/conversationalAi/resources/whatsappAccounts/client/requests/ImportWhatsAppAccountRequest.ts b/src/api/resources/conversationalAi/resources/whatsappAccounts/client/requests/ImportWhatsAppAccountRequest.ts deleted file mode 100644 index e59d78f2..00000000 --- a/src/api/resources/conversationalAi/resources/whatsappAccounts/client/requests/ImportWhatsAppAccountRequest.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * businessAccountId: "business_account_id", - * phoneNumberId: "phone_number_id", - * tokenCode: "token_code" - * } - */ -export interface ImportWhatsAppAccountRequest { - businessAccountId: string; - phoneNumberId: string; - tokenCode: string; -} diff --git a/src/api/resources/conversationalAi/resources/whatsappAccounts/client/requests/index.ts b/src/api/resources/conversationalAi/resources/whatsappAccounts/client/requests/index.ts index 8339541c..50c0f07a 100644 --- a/src/api/resources/conversationalAi/resources/whatsappAccounts/client/requests/index.ts +++ b/src/api/resources/conversationalAi/resources/whatsappAccounts/client/requests/index.ts @@ -1,2 +1 @@ -export type { ImportWhatsAppAccountRequest } from "./ImportWhatsAppAccountRequest"; export type { UpdateWhatsAppAccountRequest } from "./UpdateWhatsAppAccountRequest"; diff --git a/src/api/resources/textToDialogue/client/Client.ts b/src/api/resources/textToDialogue/client/Client.ts index 8b891717..26acbcfa 100644 --- a/src/api/resources/textToDialogue/client/Client.ts +++ b/src/api/resources/textToDialogue/client/Client.ts @@ -41,9 +41,10 @@ export class TextToDialogueClient { const { outputFormat, ..._body } = request; const _queryParams: Record = {}; if (outputFormat != null) { - _queryParams.output_format = serializers.AllowedOutputFormats.jsonOrThrow(outputFormat, { - unrecognizedObjectKeys: "strip", - }); + _queryParams.output_format = serializers.TextToDialogueConvertRequestOutputFormat.jsonOrThrow( + outputFormat, + { unrecognizedObjectKeys: "strip" }, + ); } const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -296,7 +297,7 @@ export class TextToDialogueClient { * * @example * await client.textToDialogue.convertWithTimestamps({ - * outputFormat: "mp3_22050_32", + * outputFormat: "alaw_8000", * inputs: [{ * text: "Hello, how are you?", * voiceId: "bYTqZQo3Jz7LQtmGTgwi" @@ -320,9 +321,10 @@ export class TextToDialogueClient { const { outputFormat, ..._body } = request; const _queryParams: Record = {}; if (outputFormat != null) { - _queryParams.output_format = serializers.AllowedOutputFormats.jsonOrThrow(outputFormat, { - unrecognizedObjectKeys: "strip", - }); + _queryParams.output_format = serializers.TextToDialogueConvertWithTimestampsRequestOutputFormat.jsonOrThrow( + outputFormat, + { unrecognizedObjectKeys: "strip" }, + ); } const _headers: core.Fetcher.Args["headers"] = mergeHeaders( diff --git a/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.ts b/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.ts index 44726996..686bb750 100644 --- a/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.ts +++ b/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.ts @@ -5,7 +5,7 @@ import type * as ElevenLabs from "../../../../index"; /** * @example * { - * outputFormat: "mp3_22050_32", + * outputFormat: "alaw_8000", * inputs: [{ * text: "Hello, how are you?", * voiceId: "bYTqZQo3Jz7LQtmGTgwi" @@ -16,9 +16,9 @@ import type * as ElevenLabs from "../../../../index"; * } */ export interface BodyTextToDialogueFullWithTimestamps { - /** Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. */ - outputFormat?: ElevenLabs.AllowedOutputFormats; - /** A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. */ + /** Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. */ + outputFormat?: ElevenLabs.TextToDialogueConvertWithTimestampsRequestOutputFormat; + /** A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. */ inputs: ElevenLabs.DialogueInput[]; /** Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. */ modelId?: string; diff --git a/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPost.ts b/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPost.ts index 9fc8f4b2..c2f99428 100644 --- a/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPost.ts +++ b/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPost.ts @@ -17,7 +17,7 @@ import type * as ElevenLabs from "../../../../index"; export interface BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPost { /** Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. */ outputFormat?: ElevenLabs.AllowedOutputFormats; - /** A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. */ + /** A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. */ inputs: ElevenLabs.DialogueInput[]; /** Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. */ modelId?: string; diff --git a/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueMultiVoiceV1TextToDialoguePost.ts b/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueMultiVoiceV1TextToDialoguePost.ts index 52c26a42..042b78b6 100644 --- a/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueMultiVoiceV1TextToDialoguePost.ts +++ b/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueMultiVoiceV1TextToDialoguePost.ts @@ -15,9 +15,9 @@ import type * as ElevenLabs from "../../../../index"; * } */ export interface BodyTextToDialogueMultiVoiceV1TextToDialoguePost { - /** Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. */ - outputFormat?: ElevenLabs.AllowedOutputFormats; - /** A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. */ + /** Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. */ + outputFormat?: ElevenLabs.TextToDialogueConvertRequestOutputFormat; + /** A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. */ inputs: ElevenLabs.DialogueInput[]; /** Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. */ modelId?: string; diff --git a/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.ts b/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.ts index cf081464..55567352 100644 --- a/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.ts +++ b/src/api/resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.ts @@ -18,7 +18,7 @@ import type * as ElevenLabs from "../../../../index"; export interface BodyTextToDialogueStreamWithTimestamps { /** Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. */ outputFormat?: ElevenLabs.AllowedOutputFormats; - /** A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. */ + /** A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. */ inputs: ElevenLabs.DialogueInput[]; /** Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. */ modelId?: string; diff --git a/src/api/resources/textToDialogue/types/TextToDialogueConvertRequestOutputFormat.ts b/src/api/resources/textToDialogue/types/TextToDialogueConvertRequestOutputFormat.ts new file mode 100644 index 00000000..7c949ab9 --- /dev/null +++ b/src/api/resources/textToDialogue/types/TextToDialogueConvertRequestOutputFormat.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. */ +export const TextToDialogueConvertRequestOutputFormat = { + Alaw8000: "alaw_8000", + Mp32205032: "mp3_22050_32", + Mp32400048: "mp3_24000_48", + Mp344100128: "mp3_44100_128", + Mp344100192: "mp3_44100_192", + Mp34410032: "mp3_44100_32", + Mp34410064: "mp3_44100_64", + Mp34410096: "mp3_44100_96", + Opus48000128: "opus_48000_128", + Opus48000192: "opus_48000_192", + Opus4800032: "opus_48000_32", + Opus4800064: "opus_48000_64", + Opus4800096: "opus_48000_96", + Pcm16000: "pcm_16000", + Pcm22050: "pcm_22050", + Pcm24000: "pcm_24000", + Pcm32000: "pcm_32000", + Pcm44100: "pcm_44100", + Pcm48000: "pcm_48000", + Pcm8000: "pcm_8000", + Ulaw8000: "ulaw_8000", + Wav16000: "wav_16000", + Wav22050: "wav_22050", + Wav24000: "wav_24000", + Wav32000: "wav_32000", + Wav44100: "wav_44100", + Wav48000: "wav_48000", + Wav8000: "wav_8000", +} as const; +export type TextToDialogueConvertRequestOutputFormat = + (typeof TextToDialogueConvertRequestOutputFormat)[keyof typeof TextToDialogueConvertRequestOutputFormat]; diff --git a/src/api/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.ts b/src/api/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.ts new file mode 100644 index 00000000..0c6cfddb --- /dev/null +++ b/src/api/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. */ +export const TextToDialogueConvertWithTimestampsRequestOutputFormat = { + Alaw8000: "alaw_8000", + Mp32205032: "mp3_22050_32", + Mp32400048: "mp3_24000_48", + Mp344100128: "mp3_44100_128", + Mp344100192: "mp3_44100_192", + Mp34410032: "mp3_44100_32", + Mp34410064: "mp3_44100_64", + Mp34410096: "mp3_44100_96", + Opus48000128: "opus_48000_128", + Opus48000192: "opus_48000_192", + Opus4800032: "opus_48000_32", + Opus4800064: "opus_48000_64", + Opus4800096: "opus_48000_96", + Pcm16000: "pcm_16000", + Pcm22050: "pcm_22050", + Pcm24000: "pcm_24000", + Pcm32000: "pcm_32000", + Pcm44100: "pcm_44100", + Pcm48000: "pcm_48000", + Pcm8000: "pcm_8000", + Ulaw8000: "ulaw_8000", + Wav16000: "wav_16000", + Wav22050: "wav_22050", + Wav24000: "wav_24000", + Wav32000: "wav_32000", + Wav44100: "wav_44100", + Wav48000: "wav_48000", + Wav8000: "wav_8000", +} as const; +export type TextToDialogueConvertWithTimestampsRequestOutputFormat = + (typeof TextToDialogueConvertWithTimestampsRequestOutputFormat)[keyof typeof TextToDialogueConvertWithTimestampsRequestOutputFormat]; diff --git a/src/api/resources/textToDialogue/types/index.ts b/src/api/resources/textToDialogue/types/index.ts index 4e35fcd0..7cfa1f6e 100644 --- a/src/api/resources/textToDialogue/types/index.ts +++ b/src/api/resources/textToDialogue/types/index.ts @@ -2,3 +2,5 @@ export * from "./BodyTextToDialogueFullWithTimestampsApplyTextNormalization"; export * from "./BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization"; export * from "./BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization"; export * from "./BodyTextToDialogueStreamWithTimestampsApplyTextNormalization"; +export * from "./TextToDialogueConvertRequestOutputFormat"; +export * from "./TextToDialogueConvertWithTimestampsRequestOutputFormat"; diff --git a/src/api/resources/workspace/resources/groups/resources/members/client/Client.ts b/src/api/resources/workspace/resources/groups/resources/members/client/Client.ts index 5fc24a89..65800a31 100644 --- a/src/api/resources/workspace/resources/groups/resources/members/client/Client.ts +++ b/src/api/resources/workspace/resources/groups/resources/members/client/Client.ts @@ -24,7 +24,7 @@ export class MembersClient { } /** - * Removes a member from the specified group. This endpoint may only be called by workspace administrators. + * Removes a member from the specified group. Requires `group_members_manage` permission. * * @param {string} group_id - The ID of the target group. * @param {ElevenLabs.workspace.groups.BodyDeleteMemberFromUserGroupV1WorkspaceGroupsGroupIdMembersRemovePost} request @@ -119,7 +119,7 @@ export class MembersClient { } /** - * Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators. + * Adds a member of your workspace to the specified group. Requires `group_members_manage` permission. * * @param {string} group_id - The ID of the target group. * @param {ElevenLabs.workspace.groups.AddMemberToGroupRequest} request diff --git a/src/api/resources/workspace/resources/invites/client/Client.ts b/src/api/resources/workspace/resources/invites/client/Client.ts index e4ca15b4..4a1d92e6 100644 --- a/src/api/resources/workspace/resources/invites/client/Client.ts +++ b/src/api/resources/workspace/resources/invites/client/Client.ts @@ -24,7 +24,7 @@ export class InvitesClient { } /** - * Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned. + * Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. If the user is already in the workspace a 400 error will be returned. * * @param {ElevenLabs.workspace.InviteUserRequest} request * @param {InvitesClient.RequestOptions} requestOptions - Request-specific configuration. @@ -108,7 +108,7 @@ export class InvitesClient { } /** - * Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. + * Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. * * @param {ElevenLabs.workspace.BodyInviteMultipleUsersV1WorkspaceInvitesAddBulkPost} request * @param {InvitesClient.RequestOptions} requestOptions - Request-specific configuration. @@ -199,7 +199,7 @@ export class InvitesClient { } /** - * Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators. + * Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. * * @param {ElevenLabs.workspace.BodyDeleteExistingInvitationV1WorkspaceInvitesDelete} request * @param {InvitesClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/types/AlignmentGuardrail.ts b/src/api/types/AlignmentGuardrail.ts new file mode 100644 index 00000000..c2e8935e --- /dev/null +++ b/src/api/types/AlignmentGuardrail.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AlignmentGuardrail { + isEnabled?: boolean; +} diff --git a/src/api/types/ApiIntegrationWebhookOverridesInput.ts b/src/api/types/ApiIntegrationWebhookOverridesInput.ts index d7b6523b..bf14810a 100644 --- a/src/api/types/ApiIntegrationWebhookOverridesInput.ts +++ b/src/api/types/ApiIntegrationWebhookOverridesInput.ts @@ -11,4 +11,6 @@ export interface ApiIntegrationWebhookOverridesInput { queryParamsSchema?: ElevenLabs.QueryOverride; requestBodySchema?: ElevenLabs.ObjectOverrideInput; requestHeaders?: Record; + responseFilterMode?: ElevenLabs.ResponseFilterMode; + responseFilters?: string[]; } diff --git a/src/api/types/ApiIntegrationWebhookOverridesOutput.ts b/src/api/types/ApiIntegrationWebhookOverridesOutput.ts index 1e3108e6..f09972e1 100644 --- a/src/api/types/ApiIntegrationWebhookOverridesOutput.ts +++ b/src/api/types/ApiIntegrationWebhookOverridesOutput.ts @@ -11,4 +11,6 @@ export interface ApiIntegrationWebhookOverridesOutput { queryParamsSchema?: ElevenLabs.QueryOverride; requestBodySchema?: ElevenLabs.ObjectOverrideOutput; requestHeaders?: Record; + responseFilterMode?: ElevenLabs.ResponseFilterMode; + responseFilters?: string[]; } diff --git a/src/api/types/ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModel.ts b/src/api/types/ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModel.ts index f4114f5d..3658c62a 100644 --- a/src/api/types/ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModel.ts +++ b/src/api/types/ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModel.ts @@ -10,6 +10,7 @@ export interface ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCo toolHasBeenCalled: boolean; toolLatencySecs?: number; errorType?: string; + rawErrorMessage?: string; dynamicVariableUpdates?: ElevenLabs.DynamicVariableUpdateCommonModel[]; type: "api_integration_webhook"; integrationId: string; diff --git a/src/api/types/ConversationHistoryTranscriptOtherToolsResultCommonModel.ts b/src/api/types/ConversationHistoryTranscriptOtherToolsResultCommonModel.ts index 98e951f1..11f53706 100644 --- a/src/api/types/ConversationHistoryTranscriptOtherToolsResultCommonModel.ts +++ b/src/api/types/ConversationHistoryTranscriptOtherToolsResultCommonModel.ts @@ -10,6 +10,7 @@ export interface ConversationHistoryTranscriptOtherToolsResultCommonModel { toolHasBeenCalled: boolean; toolLatencySecs?: number; errorType?: string; + rawErrorMessage?: string; dynamicVariableUpdates?: ElevenLabs.DynamicVariableUpdateCommonModel[]; type?: ElevenLabs.ConversationHistoryTranscriptOtherToolsResultCommonModelType; } diff --git a/src/api/types/ConversationHistoryTranscriptSystemToolResultCommonModel.ts b/src/api/types/ConversationHistoryTranscriptSystemToolResultCommonModel.ts index a9749737..995e6d1c 100644 --- a/src/api/types/ConversationHistoryTranscriptSystemToolResultCommonModel.ts +++ b/src/api/types/ConversationHistoryTranscriptSystemToolResultCommonModel.ts @@ -10,6 +10,7 @@ export interface ConversationHistoryTranscriptSystemToolResultCommonModel { toolHasBeenCalled: boolean; toolLatencySecs?: number; errorType?: string; + rawErrorMessage?: string; dynamicVariableUpdates?: ElevenLabs.DynamicVariableUpdateCommonModel[]; type: "system"; result?: ElevenLabs.ConversationHistoryTranscriptSystemToolResultCommonModelResult; diff --git a/src/api/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput.ts b/src/api/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput.ts index 825d2cee..51980bae 100644 --- a/src/api/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput.ts +++ b/src/api/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput.ts @@ -10,6 +10,7 @@ export interface ConversationHistoryTranscriptWorkflowToolsResultCommonModelInpu toolHasBeenCalled: boolean; toolLatencySecs?: number; errorType?: string; + rawErrorMessage?: string; dynamicVariableUpdates?: ElevenLabs.DynamicVariableUpdateCommonModel[]; type: "workflow"; result?: ElevenLabs.WorkflowToolResponseModelInput; diff --git a/src/api/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput.ts b/src/api/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput.ts index 7824057d..5774b948 100644 --- a/src/api/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput.ts +++ b/src/api/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput.ts @@ -10,6 +10,7 @@ export interface ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutp toolHasBeenCalled: boolean; toolLatencySecs?: number; errorType?: string; + rawErrorMessage?: string; dynamicVariableUpdates?: ElevenLabs.DynamicVariableUpdateCommonModel[]; type: "workflow"; result?: ElevenLabs.WorkflowToolResponseModelOutput; diff --git a/src/api/types/ConversationTurnMetrics.ts b/src/api/types/ConversationTurnMetrics.ts index 5ba02368..3d87791c 100644 --- a/src/api/types/ConversationTurnMetrics.ts +++ b/src/api/types/ConversationTurnMetrics.ts @@ -4,4 +4,5 @@ import type * as ElevenLabs from "../index"; export interface ConversationTurnMetrics { metrics?: Record; + convaiAsrProvider?: string; } diff --git a/src/api/types/DirectPublishingReadResponseModel.ts b/src/api/types/DirectPublishingReadResponseModel.ts index 5055426f..aa6308d1 100644 --- a/src/api/types/DirectPublishingReadResponseModel.ts +++ b/src/api/types/DirectPublishingReadResponseModel.ts @@ -41,6 +41,7 @@ export interface DirectPublishingReadResponseModel { payoutType?: ElevenLabs.DirectPublishingReadResponseModelPayoutType; listPrice?: number; currency?: "usd"; + originalAudioProjectExportId?: string; originalAudioDocumentId?: string; seriesId?: string; volume?: number; diff --git a/src/api/types/GetUnitTestResponseModel.ts b/src/api/types/GetUnitTestResponseModel.ts index 8cd5606d..d18d02d5 100644 --- a/src/api/types/GetUnitTestResponseModel.ts +++ b/src/api/types/GetUnitTestResponseModel.ts @@ -12,6 +12,8 @@ export interface GetUnitTestResponseModel { failureExamples: ElevenLabs.AgentFailureResponseExample[]; /** How to evaluate the agent's tool call (if any). If empty, the tool call is not evaluated. */ toolCallParameters?: ElevenLabs.UnitTestToolCallEvaluationModelOutput; + /** If set to True this test will pass if any tool call returned by the LLM matches the criteria. Otherwise it will fail if more than one tool is returned by the agent. */ + checkAnyToolMatches?: boolean; /** Dynamic variables to replace in the agent config during testing */ dynamicVariables?: Record; type?: ElevenLabs.UnitTestCommonModelType; diff --git a/src/api/types/GetWorkspaceSecretsResponseModel.ts b/src/api/types/GetWorkspaceSecretsResponseModel.ts index 4a8c046e..cd3dce11 100644 --- a/src/api/types/GetWorkspaceSecretsResponseModel.ts +++ b/src/api/types/GetWorkspaceSecretsResponseModel.ts @@ -4,4 +4,8 @@ import type * as ElevenLabs from "../index"; export interface GetWorkspaceSecretsResponseModel { secrets: ElevenLabs.ConvAiWorkspaceStoredSecretConfig[]; + /** Cursor for fetching the next page of secrets */ + nextCursor?: string; + /** Whether there are more secrets to fetch */ + hasMore?: boolean; } diff --git a/src/api/types/GuardrailsV1Input.ts b/src/api/types/GuardrailsV1Input.ts index 89d187df..75764b91 100644 --- a/src/api/types/GuardrailsV1Input.ts +++ b/src/api/types/GuardrailsV1Input.ts @@ -4,5 +4,6 @@ import type * as ElevenLabs from "../index"; export interface GuardrailsV1Input { version?: "1"; + alignment?: ElevenLabs.AlignmentGuardrail; moderation?: ElevenLabs.ModerationGuardrailInput; } diff --git a/src/api/types/GuardrailsV1Output.ts b/src/api/types/GuardrailsV1Output.ts index 4f9076d7..6080a5d1 100644 --- a/src/api/types/GuardrailsV1Output.ts +++ b/src/api/types/GuardrailsV1Output.ts @@ -4,5 +4,6 @@ import type * as ElevenLabs from "../index"; export interface GuardrailsV1Output { version?: "1"; + alignment?: ElevenLabs.AlignmentGuardrail; moderation?: ElevenLabs.ModerationGuardrailOutput; } diff --git a/src/api/types/ImportWhatsAppAccountResponse.ts b/src/api/types/ImportWhatsAppAccountResponse.ts deleted file mode 100644 index 55ace2aa..00000000 --- a/src/api/types/ImportWhatsAppAccountResponse.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface ImportWhatsAppAccountResponse { - phoneNumberId: string; -} diff --git a/src/api/types/InvoiceResponse.ts b/src/api/types/InvoiceResponse.ts index 23d5d238..6be56880 100644 --- a/src/api/types/InvoiceResponse.ts +++ b/src/api/types/InvoiceResponse.ts @@ -15,7 +15,7 @@ export interface InvoiceResponse { discountAmountOff?: number; /** The discounts applied to the invoice. */ discounts: ElevenLabs.DiscountResponseModel[]; - /** The Unix timestamp of the next payment attempt. */ + /** The Unix timestamp of the next payment attempt. -1 when there is no next payment attempt. */ nextPaymentAttemptUnix: number; /** Deprecated. Use [payment_intent_statusses] instead. The status of this invoice's first payment intent. None when there is no payment intent. */ paymentIntentStatus?: ElevenLabs.InvoiceResponseModelPaymentIntentStatus; diff --git a/src/api/types/NonStreamingOutputFormats.ts b/src/api/types/NonStreamingOutputFormats.ts new file mode 100644 index 00000000..0afcdf00 --- /dev/null +++ b/src/api/types/NonStreamingOutputFormats.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export const NonStreamingOutputFormats = { + Wav8000: "wav_8000", + Wav16000: "wav_16000", + Wav22050: "wav_22050", + Wav24000: "wav_24000", + Wav32000: "wav_32000", + Wav44100: "wav_44100", + Wav48000: "wav_48000", +} as const; +export type NonStreamingOutputFormats = (typeof NonStreamingOutputFormats)[keyof typeof NonStreamingOutputFormats]; diff --git a/src/api/types/PermissionType.ts b/src/api/types/PermissionType.ts index 32e6ed1b..2d5979e2 100644 --- a/src/api/types/PermissionType.ts +++ b/src/api/types/PermissionType.ts @@ -36,5 +36,11 @@ export const PermissionType = { ShareVoiceExternally: "share_voice_externally", CreateUserApiKey: "create_user_api_key", WorkspaceAnalyticsFullRead: "workspace_analytics_full_read", + WebhooksWrite: "webhooks_write", + ServiceAccountWrite: "service_account_write", + GroupMembersManage: "group_members_manage", + WorkspaceMembersInvite: "workspace_members_invite", + WorkspaceMembersRemove: "workspace_members_remove", + TermsOfServiceAccept: "terms_of_service_accept", } as const; export type PermissionType = (typeof PermissionType)[keyof typeof PermissionType]; diff --git a/src/api/types/ProcedureDraftRef.ts b/src/api/types/ProcedureDraftRef.ts new file mode 100644 index 00000000..87374a57 --- /dev/null +++ b/src/api/types/ProcedureDraftRef.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface ProcedureDraftRef { + /** Procedure ID */ + procedureId: string; +} diff --git a/src/api/types/ProcedureVersionRef.ts b/src/api/types/ProcedureVersionRef.ts new file mode 100644 index 00000000..809e4145 --- /dev/null +++ b/src/api/types/ProcedureVersionRef.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface ProcedureVersionRef { + /** Procedure ID */ + procedureId: string; + /** Version ID of the procedure version. */ + versionId: string; +} diff --git a/src/api/types/ResponseFilterMode.ts b/src/api/types/ResponseFilterMode.ts new file mode 100644 index 00000000..e1f27d6e --- /dev/null +++ b/src/api/types/ResponseFilterMode.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Controls how tool responses are filtered before being visible to the agent. */ +export const ResponseFilterMode = { + All: "all", + Allow: "allow", +} as const; +export type ResponseFilterMode = (typeof ResponseFilterMode)[keyof typeof ResponseFilterMode]; diff --git a/src/api/types/SongMetadata.ts b/src/api/types/SongMetadata.ts index 50d66928..8168d702 100644 --- a/src/api/types/SongMetadata.ts +++ b/src/api/types/SongMetadata.ts @@ -11,8 +11,4 @@ export interface SongMetadata { languages: string[]; /** Whether the song is explicit */ isExplicit?: boolean; - /** The BPM of the song */ - bpm?: number; - /** The time signature of the song */ - timeSignature?: string; } diff --git a/src/api/types/TurnConfig.ts b/src/api/types/TurnConfig.ts index 077228ee..2d47299c 100644 --- a/src/api/types/TurnConfig.ts +++ b/src/api/types/TurnConfig.ts @@ -15,4 +15,6 @@ export interface TurnConfig { turnEagerness?: ElevenLabs.TurnEagerness; /** Controls if the agent should be more patient when user is spelling numbers and named entities. Auto = model based, Off = never wait extra */ spellingPatience?: ElevenLabs.SpellingPatience; + /** When enabled, starts generating LLM responses during silence before full turn confidence is reached, reducing perceived latency. May increase LLM costs. */ + speculativeTurn?: boolean; } diff --git a/src/api/types/TurnConfigWorkflowOverride.ts b/src/api/types/TurnConfigWorkflowOverride.ts index 153e9814..7d14cea2 100644 --- a/src/api/types/TurnConfigWorkflowOverride.ts +++ b/src/api/types/TurnConfigWorkflowOverride.ts @@ -15,4 +15,6 @@ export interface TurnConfigWorkflowOverride { turnEagerness?: ElevenLabs.TurnEagerness; /** Controls if the agent should be more patient when user is spelling numbers and named entities. Auto = model based, Off = never wait extra */ spellingPatience?: ElevenLabs.SpellingPatience; + /** When enabled, starts generating LLM responses during silence before full turn confidence is reached, reducing perceived latency. May increase LLM costs. */ + speculativeTurn?: boolean; } diff --git a/src/api/types/UnitTestCommonModel.ts b/src/api/types/UnitTestCommonModel.ts index f669d44a..5df85845 100644 --- a/src/api/types/UnitTestCommonModel.ts +++ b/src/api/types/UnitTestCommonModel.ts @@ -15,6 +15,8 @@ export interface UnitTestCommonModel { failureExamples: ElevenLabs.AgentFailureResponseExample[]; /** How to evaluate the agent's tool call (if any). If empty, the tool call is not evaluated. */ toolCallParameters?: ElevenLabs.UnitTestToolCallEvaluationModelOutput; + /** If set to True this test will pass if any tool call returned by the LLM matches the criteria. Otherwise it will fail if more than one tool is returned by the agent. */ + checkAnyToolMatches?: boolean; /** Dynamic variables to replace in the agent config during testing */ dynamicVariables?: Record; type?: ElevenLabs.UnitTestCommonModelType; diff --git a/src/api/types/User.ts b/src/api/types/User.ts index 986565dd..39f247ac 100644 --- a/src/api/types/User.ts +++ b/src/api/types/User.ts @@ -17,6 +17,8 @@ export interface User { isOnboardingCompleted: boolean; /** Whether the user's onboarding checklist is completed. */ isOnboardingChecklistCompleted: boolean; + /** Whether to show compliance terms (ToS, Privacy Policy, biometric consent) during onboarding. Set for users signing up from the marketing site. */ + showComplianceTerms?: boolean; /** First name of the user. */ firstName?: string; /** Whether the user's API key is hashed. */ diff --git a/src/api/types/index.ts b/src/api/types/index.ts index d6905f1d..adf20650 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -48,6 +48,7 @@ export * from "./AgentWorkflowResponseModel"; export * from "./AgentWorkflowResponseModelNodesValue"; export * from "./AgentWorkspaceOverridesInput"; export * from "./AgentWorkspaceOverridesOutput"; +export * from "./AlignmentGuardrail"; export * from "./AllowedOutputFormats"; export * from "./AllowlistItem"; export * from "./ApiIntegrationWebhookOverridesInput"; @@ -446,7 +447,6 @@ export * from "./HistoryItemResponse"; export * from "./HtmlExportOptions"; export * from "./HttpValidationError"; export * from "./ImageAvatar"; -export * from "./ImportWhatsAppAccountResponse"; export * from "./InboundSipTrunkConfigRequestModel"; export * from "./IntegrationType"; export * from "./InvoiceResponse"; @@ -523,6 +523,7 @@ export * from "./ModerationGuardrailOutput"; export * from "./MultichannelSpeechToTextResponseModel"; export * from "./MultipartMusicResponse"; export * from "./MusicPrompt"; +export * from "./NonStreamingOutputFormats"; export * from "./ObjectJsonSchemaPropertyInput"; export * from "./ObjectJsonSchemaPropertyInputPropertiesValue"; export * from "./ObjectJsonSchemaPropertyOutput"; @@ -564,6 +565,8 @@ export * from "./PostAgentAvatarResponseModel"; export * from "./PostWorkspaceSecretResponseModel"; export * from "./PreviewAudioDbModel"; export * from "./PrivacyConfig"; +export * from "./ProcedureDraftRef"; +export * from "./ProcedureVersionRef"; export * from "./ProjectCreationMetaResponseModel"; export * from "./ProjectCreationMetaResponseModelStatus"; export * from "./ProjectCreationMetaResponseModelType"; @@ -647,6 +650,7 @@ export * from "./ResourceAccessInfo"; export * from "./ResourceAccessInfoRole"; export * from "./ResourceMetadataResponseModel"; export * from "./ResourceMetadataResponseModelAnonymousAccessLevelOverride"; +export * from "./ResponseFilterMode"; export * from "./ReviewResponseModel"; export * from "./ReviewResponseModelRejectReasonsItem"; export * from "./ReviewResponseModelReviewStatus"; diff --git a/src/serialization/resources/conversationalAi/resources/agents/client/requests/UpdateAgentRequest.ts b/src/serialization/resources/conversationalAi/resources/agents/client/requests/UpdateAgentRequest.ts index 3b686e5d..6abf5f5f 100644 --- a/src/serialization/resources/conversationalAi/resources/agents/client/requests/UpdateAgentRequest.ts +++ b/src/serialization/resources/conversationalAi/resources/agents/client/requests/UpdateAgentRequest.ts @@ -6,6 +6,7 @@ import type * as serializers from "../../../../../../index"; import { AgentPlatformSettingsRequestModel } from "../../../../../../types/AgentPlatformSettingsRequestModel"; import { AgentWorkflowRequestModel } from "../../../../../../types/AgentWorkflowRequestModel"; import { ConversationalConfig } from "../../../../../../types/ConversationalConfig"; +import { BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem } from "../../types/BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem"; export const UpdateAgentRequest: core.serialization.Schema< serializers.conversationalAi.UpdateAgentRequest.Raw, @@ -17,6 +18,10 @@ export const UpdateAgentRequest: core.serialization.Schema< name: core.serialization.string().optional(), tags: core.serialization.list(core.serialization.string()).optional(), versionDescription: core.serialization.property("version_description", core.serialization.string().optional()), + procedureRefs: core.serialization.property( + "procedure_refs", + core.serialization.list(BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem).optional(), + ), }); export declare namespace UpdateAgentRequest { @@ -27,5 +32,6 @@ export declare namespace UpdateAgentRequest { name?: string | null; tags?: string[] | null; version_description?: string | null; + procedure_refs?: BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem.Raw[] | null; } } diff --git a/src/serialization/resources/conversationalAi/resources/agents/index.ts b/src/serialization/resources/conversationalAi/resources/agents/index.ts index 33a87f10..fb00ab43 100644 --- a/src/serialization/resources/conversationalAi/resources/agents/index.ts +++ b/src/serialization/resources/conversationalAi/resources/agents/index.ts @@ -1,2 +1,3 @@ export * from "./client"; export * from "./resources"; +export * from "./types"; diff --git a/src/serialization/resources/conversationalAi/resources/agents/resources/branches/client/requests/BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch.ts b/src/serialization/resources/conversationalAi/resources/agents/resources/branches/client/requests/BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch.ts index 76a710c1..1faac352 100644 --- a/src/serialization/resources/conversationalAi/resources/agents/resources/branches/client/requests/BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch.ts +++ b/src/serialization/resources/conversationalAi/resources/agents/resources/branches/client/requests/BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch.ts @@ -9,12 +9,14 @@ export const BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch: co serializers.conversationalAi.agents.BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch.Raw, ElevenLabs.conversationalAi.agents.BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch > = core.serialization.object({ + name: core.serialization.string().optional(), isArchived: core.serialization.property("is_archived", core.serialization.boolean().optional()), protectionStatus: core.serialization.property("protection_status", BranchProtectionStatus.optional()), }); export declare namespace BodyUpdateAgentBranchV1ConvaiAgentsAgentIdBranchesBranchIdPatch { export interface Raw { + name?: string | null; is_archived?: boolean | null; protection_status?: BranchProtectionStatus.Raw | null; } diff --git a/src/serialization/resources/conversationalAi/resources/agents/types/BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem.ts b/src/serialization/resources/conversationalAi/resources/agents/types/BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem.ts new file mode 100644 index 00000000..f893851e --- /dev/null +++ b/src/serialization/resources/conversationalAi/resources/agents/types/BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as ElevenLabs from "../../../../../../api/index"; +import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; +import { ProcedureDraftRef } from "../../../../../types/ProcedureDraftRef"; +import { ProcedureVersionRef } from "../../../../../types/ProcedureVersionRef"; + +export const BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem: core.serialization.Schema< + serializers.conversationalAi.BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem.Raw, + ElevenLabs.conversationalAi.BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem +> = core.serialization.undiscriminatedUnion([ProcedureVersionRef, ProcedureDraftRef]); + +export declare namespace BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem { + export type Raw = ProcedureVersionRef.Raw | ProcedureDraftRef.Raw; +} diff --git a/src/serialization/resources/conversationalAi/resources/agents/types/index.ts b/src/serialization/resources/conversationalAi/resources/agents/types/index.ts new file mode 100644 index 00000000..a78e5988 --- /dev/null +++ b/src/serialization/resources/conversationalAi/resources/agents/types/index.ts @@ -0,0 +1 @@ +export * from "./BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem"; diff --git a/src/serialization/resources/conversationalAi/resources/index.ts b/src/serialization/resources/conversationalAi/resources/index.ts index 935e13d0..50fee9cd 100644 --- a/src/serialization/resources/conversationalAi/resources/index.ts +++ b/src/serialization/resources/conversationalAi/resources/index.ts @@ -1,5 +1,6 @@ export * as agents from "./agents"; export * from "./agents/client/requests"; +export * from "./agents/types"; export * as batchCalls from "./batchCalls"; export * from "./batchCalls/client/requests"; export * as conversations from "./conversations"; diff --git a/src/serialization/resources/conversationalAi/resources/tests/client/requests/CreateUnitTestRequest.ts b/src/serialization/resources/conversationalAi/resources/tests/client/requests/CreateUnitTestRequest.ts index 3ee095e2..1619f4ef 100644 --- a/src/serialization/resources/conversationalAi/resources/tests/client/requests/CreateUnitTestRequest.ts +++ b/src/serialization/resources/conversationalAi/resources/tests/client/requests/CreateUnitTestRequest.ts @@ -32,6 +32,7 @@ export const CreateUnitTestRequest: core.serialization.Schema< "tool_call_parameters", UnitTestToolCallEvaluationModelInput.optional(), ), + checkAnyToolMatches: core.serialization.property("check_any_tool_matches", core.serialization.boolean().optional()), dynamicVariables: core.serialization.property( "dynamic_variables", core.serialization @@ -53,6 +54,7 @@ export declare namespace CreateUnitTestRequest { success_examples: AgentSuccessfulResponseExample.Raw[]; failure_examples: AgentFailureResponseExample.Raw[]; tool_call_parameters?: UnitTestToolCallEvaluationModelInput.Raw | null; + check_any_tool_matches?: boolean | null; dynamic_variables?: Record | null; type?: UnitTestCommonModelType.Raw | null; from_conversation_metadata?: TestFromConversationMetadataInput.Raw | null; diff --git a/src/serialization/resources/conversationalAi/resources/tests/client/requests/UpdateUnitTestRequest.ts b/src/serialization/resources/conversationalAi/resources/tests/client/requests/UpdateUnitTestRequest.ts index 5d5fd3b1..ee6bf45a 100644 --- a/src/serialization/resources/conversationalAi/resources/tests/client/requests/UpdateUnitTestRequest.ts +++ b/src/serialization/resources/conversationalAi/resources/tests/client/requests/UpdateUnitTestRequest.ts @@ -32,6 +32,7 @@ export const UpdateUnitTestRequest: core.serialization.Schema< "tool_call_parameters", UnitTestToolCallEvaluationModelInput.optional(), ), + checkAnyToolMatches: core.serialization.property("check_any_tool_matches", core.serialization.boolean().optional()), dynamicVariables: core.serialization.property( "dynamic_variables", core.serialization @@ -53,6 +54,7 @@ export declare namespace UpdateUnitTestRequest { success_examples: AgentSuccessfulResponseExample.Raw[]; failure_examples: AgentFailureResponseExample.Raw[]; tool_call_parameters?: UnitTestToolCallEvaluationModelInput.Raw | null; + check_any_tool_matches?: boolean | null; dynamic_variables?: Record | null; type?: UnitTestCommonModelType.Raw | null; from_conversation_metadata?: TestFromConversationMetadataInput.Raw | null; diff --git a/src/serialization/resources/conversationalAi/resources/whatsappAccounts/client/requests/ImportWhatsAppAccountRequest.ts b/src/serialization/resources/conversationalAi/resources/whatsappAccounts/client/requests/ImportWhatsAppAccountRequest.ts deleted file mode 100644 index 761fbf9d..00000000 --- a/src/serialization/resources/conversationalAi/resources/whatsappAccounts/client/requests/ImportWhatsAppAccountRequest.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as ElevenLabs from "../../../../../../../api/index"; -import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; - -export const ImportWhatsAppAccountRequest: core.serialization.Schema< - serializers.conversationalAi.ImportWhatsAppAccountRequest.Raw, - ElevenLabs.conversationalAi.ImportWhatsAppAccountRequest -> = core.serialization.object({ - businessAccountId: core.serialization.property("business_account_id", core.serialization.string()), - phoneNumberId: core.serialization.property("phone_number_id", core.serialization.string()), - tokenCode: core.serialization.property("token_code", core.serialization.string()), -}); - -export declare namespace ImportWhatsAppAccountRequest { - export interface Raw { - business_account_id: string; - phone_number_id: string; - token_code: string; - } -} diff --git a/src/serialization/resources/conversationalAi/resources/whatsappAccounts/client/requests/index.ts b/src/serialization/resources/conversationalAi/resources/whatsappAccounts/client/requests/index.ts index 99e9858d..f378552d 100644 --- a/src/serialization/resources/conversationalAi/resources/whatsappAccounts/client/requests/index.ts +++ b/src/serialization/resources/conversationalAi/resources/whatsappAccounts/client/requests/index.ts @@ -1,2 +1 @@ -export { ImportWhatsAppAccountRequest } from "./ImportWhatsAppAccountRequest"; export { UpdateWhatsAppAccountRequest } from "./UpdateWhatsAppAccountRequest"; diff --git a/src/serialization/resources/textToDialogue/types/TextToDialogueConvertRequestOutputFormat.ts b/src/serialization/resources/textToDialogue/types/TextToDialogueConvertRequestOutputFormat.ts new file mode 100644 index 00000000..7cbea7a3 --- /dev/null +++ b/src/serialization/resources/textToDialogue/types/TextToDialogueConvertRequestOutputFormat.ts @@ -0,0 +1,71 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as ElevenLabs from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; + +export const TextToDialogueConvertRequestOutputFormat: core.serialization.Schema< + serializers.TextToDialogueConvertRequestOutputFormat.Raw, + ElevenLabs.TextToDialogueConvertRequestOutputFormat +> = core.serialization.enum_([ + "alaw_8000", + "mp3_22050_32", + "mp3_24000_48", + "mp3_44100_128", + "mp3_44100_192", + "mp3_44100_32", + "mp3_44100_64", + "mp3_44100_96", + "opus_48000_128", + "opus_48000_192", + "opus_48000_32", + "opus_48000_64", + "opus_48000_96", + "pcm_16000", + "pcm_22050", + "pcm_24000", + "pcm_32000", + "pcm_44100", + "pcm_48000", + "pcm_8000", + "ulaw_8000", + "wav_16000", + "wav_22050", + "wav_24000", + "wav_32000", + "wav_44100", + "wav_48000", + "wav_8000", +]); + +export declare namespace TextToDialogueConvertRequestOutputFormat { + export type Raw = + | "alaw_8000" + | "mp3_22050_32" + | "mp3_24000_48" + | "mp3_44100_128" + | "mp3_44100_192" + | "mp3_44100_32" + | "mp3_44100_64" + | "mp3_44100_96" + | "opus_48000_128" + | "opus_48000_192" + | "opus_48000_32" + | "opus_48000_64" + | "opus_48000_96" + | "pcm_16000" + | "pcm_22050" + | "pcm_24000" + | "pcm_32000" + | "pcm_44100" + | "pcm_48000" + | "pcm_8000" + | "ulaw_8000" + | "wav_16000" + | "wav_22050" + | "wav_24000" + | "wav_32000" + | "wav_44100" + | "wav_48000" + | "wav_8000"; +} diff --git a/src/serialization/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.ts b/src/serialization/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.ts new file mode 100644 index 00000000..7b448515 --- /dev/null +++ b/src/serialization/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.ts @@ -0,0 +1,71 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as ElevenLabs from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; + +export const TextToDialogueConvertWithTimestampsRequestOutputFormat: core.serialization.Schema< + serializers.TextToDialogueConvertWithTimestampsRequestOutputFormat.Raw, + ElevenLabs.TextToDialogueConvertWithTimestampsRequestOutputFormat +> = core.serialization.enum_([ + "alaw_8000", + "mp3_22050_32", + "mp3_24000_48", + "mp3_44100_128", + "mp3_44100_192", + "mp3_44100_32", + "mp3_44100_64", + "mp3_44100_96", + "opus_48000_128", + "opus_48000_192", + "opus_48000_32", + "opus_48000_64", + "opus_48000_96", + "pcm_16000", + "pcm_22050", + "pcm_24000", + "pcm_32000", + "pcm_44100", + "pcm_48000", + "pcm_8000", + "ulaw_8000", + "wav_16000", + "wav_22050", + "wav_24000", + "wav_32000", + "wav_44100", + "wav_48000", + "wav_8000", +]); + +export declare namespace TextToDialogueConvertWithTimestampsRequestOutputFormat { + export type Raw = + | "alaw_8000" + | "mp3_22050_32" + | "mp3_24000_48" + | "mp3_44100_128" + | "mp3_44100_192" + | "mp3_44100_32" + | "mp3_44100_64" + | "mp3_44100_96" + | "opus_48000_128" + | "opus_48000_192" + | "opus_48000_32" + | "opus_48000_64" + | "opus_48000_96" + | "pcm_16000" + | "pcm_22050" + | "pcm_24000" + | "pcm_32000" + | "pcm_44100" + | "pcm_48000" + | "pcm_8000" + | "ulaw_8000" + | "wav_16000" + | "wav_22050" + | "wav_24000" + | "wav_32000" + | "wav_44100" + | "wav_48000" + | "wav_8000"; +} diff --git a/src/serialization/resources/textToDialogue/types/index.ts b/src/serialization/resources/textToDialogue/types/index.ts index 4e35fcd0..7cfa1f6e 100644 --- a/src/serialization/resources/textToDialogue/types/index.ts +++ b/src/serialization/resources/textToDialogue/types/index.ts @@ -2,3 +2,5 @@ export * from "./BodyTextToDialogueFullWithTimestampsApplyTextNormalization"; export * from "./BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization"; export * from "./BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization"; export * from "./BodyTextToDialogueStreamWithTimestampsApplyTextNormalization"; +export * from "./TextToDialogueConvertRequestOutputFormat"; +export * from "./TextToDialogueConvertWithTimestampsRequestOutputFormat"; diff --git a/src/serialization/types/AlignmentGuardrail.ts b/src/serialization/types/AlignmentGuardrail.ts new file mode 100644 index 00000000..d3218a62 --- /dev/null +++ b/src/serialization/types/AlignmentGuardrail.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as ElevenLabs from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const AlignmentGuardrail: core.serialization.ObjectSchema< + serializers.AlignmentGuardrail.Raw, + ElevenLabs.AlignmentGuardrail +> = core.serialization.object({ + isEnabled: core.serialization.property("is_enabled", core.serialization.boolean().optional()), +}); + +export declare namespace AlignmentGuardrail { + export interface Raw { + is_enabled?: boolean | null; + } +} diff --git a/src/serialization/types/ApiIntegrationWebhookOverridesInput.ts b/src/serialization/types/ApiIntegrationWebhookOverridesInput.ts index ac6a50df..e1f91c45 100644 --- a/src/serialization/types/ApiIntegrationWebhookOverridesInput.ts +++ b/src/serialization/types/ApiIntegrationWebhookOverridesInput.ts @@ -6,6 +6,7 @@ import * as serializers from "../index"; import { ApiIntegrationWebhookOverridesInputRequestHeadersValue } from "./ApiIntegrationWebhookOverridesInputRequestHeadersValue"; import { LiteralOverride } from "./LiteralOverride"; import { QueryOverride } from "./QueryOverride"; +import { ResponseFilterMode } from "./ResponseFilterMode"; export const ApiIntegrationWebhookOverridesInput: core.serialization.ObjectSchema< serializers.ApiIntegrationWebhookOverridesInput.Raw, @@ -26,6 +27,11 @@ export const ApiIntegrationWebhookOverridesInput: core.serialization.ObjectSchem .record(core.serialization.string(), ApiIntegrationWebhookOverridesInputRequestHeadersValue.optional()) .optional(), ), + responseFilterMode: core.serialization.property("response_filter_mode", ResponseFilterMode.optional()), + responseFilters: core.serialization.property( + "response_filters", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace ApiIntegrationWebhookOverridesInput { @@ -37,5 +43,7 @@ export declare namespace ApiIntegrationWebhookOverridesInput { string, ApiIntegrationWebhookOverridesInputRequestHeadersValue.Raw | null | undefined > | null; + response_filter_mode?: ResponseFilterMode.Raw | null; + response_filters?: string[] | null; } } diff --git a/src/serialization/types/ApiIntegrationWebhookOverridesOutput.ts b/src/serialization/types/ApiIntegrationWebhookOverridesOutput.ts index 4b863303..d2d18147 100644 --- a/src/serialization/types/ApiIntegrationWebhookOverridesOutput.ts +++ b/src/serialization/types/ApiIntegrationWebhookOverridesOutput.ts @@ -6,6 +6,7 @@ import * as serializers from "../index"; import { ApiIntegrationWebhookOverridesOutputRequestHeadersValue } from "./ApiIntegrationWebhookOverridesOutputRequestHeadersValue"; import { LiteralOverride } from "./LiteralOverride"; import { QueryOverride } from "./QueryOverride"; +import { ResponseFilterMode } from "./ResponseFilterMode"; export const ApiIntegrationWebhookOverridesOutput: core.serialization.ObjectSchema< serializers.ApiIntegrationWebhookOverridesOutput.Raw, @@ -26,6 +27,11 @@ export const ApiIntegrationWebhookOverridesOutput: core.serialization.ObjectSche .record(core.serialization.string(), ApiIntegrationWebhookOverridesOutputRequestHeadersValue.optional()) .optional(), ), + responseFilterMode: core.serialization.property("response_filter_mode", ResponseFilterMode.optional()), + responseFilters: core.serialization.property( + "response_filters", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace ApiIntegrationWebhookOverridesOutput { @@ -37,5 +43,7 @@ export declare namespace ApiIntegrationWebhookOverridesOutput { string, ApiIntegrationWebhookOverridesOutputRequestHeadersValue.Raw | null | undefined > | null; + response_filter_mode?: ResponseFilterMode.Raw | null; + response_filters?: string[] | null; } } diff --git a/src/serialization/types/ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModel.ts b/src/serialization/types/ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModel.ts index be899205..478760e4 100644 --- a/src/serialization/types/ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModel.ts +++ b/src/serialization/types/ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModel.ts @@ -16,6 +16,7 @@ export const ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommon toolHasBeenCalled: core.serialization.property("tool_has_been_called", core.serialization.boolean()), toolLatencySecs: core.serialization.property("tool_latency_secs", core.serialization.number().optional()), errorType: core.serialization.property("error_type", core.serialization.string().optional()), + rawErrorMessage: core.serialization.property("raw_error_message", core.serialization.string().optional()), dynamicVariableUpdates: core.serialization.property( "dynamic_variable_updates", core.serialization.list(DynamicVariableUpdateCommonModel).optional(), @@ -35,6 +36,7 @@ export declare namespace ConversationHistoryTranscriptApiIntegrationWebhookTools tool_has_been_called: boolean; tool_latency_secs?: number | null; error_type?: string | null; + raw_error_message?: string | null; dynamic_variable_updates?: DynamicVariableUpdateCommonModel.Raw[] | null; type: "api_integration_webhook"; integration_id: string; diff --git a/src/serialization/types/ConversationHistoryTranscriptOtherToolsResultCommonModel.ts b/src/serialization/types/ConversationHistoryTranscriptOtherToolsResultCommonModel.ts index 60f5e527..38dc63be 100644 --- a/src/serialization/types/ConversationHistoryTranscriptOtherToolsResultCommonModel.ts +++ b/src/serialization/types/ConversationHistoryTranscriptOtherToolsResultCommonModel.ts @@ -17,6 +17,7 @@ export const ConversationHistoryTranscriptOtherToolsResultCommonModel: core.seri toolHasBeenCalled: core.serialization.property("tool_has_been_called", core.serialization.boolean()), toolLatencySecs: core.serialization.property("tool_latency_secs", core.serialization.number().optional()), errorType: core.serialization.property("error_type", core.serialization.string().optional()), + rawErrorMessage: core.serialization.property("raw_error_message", core.serialization.string().optional()), dynamicVariableUpdates: core.serialization.property( "dynamic_variable_updates", core.serialization.list(DynamicVariableUpdateCommonModel).optional(), @@ -33,6 +34,7 @@ export declare namespace ConversationHistoryTranscriptOtherToolsResultCommonMode tool_has_been_called: boolean; tool_latency_secs?: number | null; error_type?: string | null; + raw_error_message?: string | null; dynamic_variable_updates?: DynamicVariableUpdateCommonModel.Raw[] | null; type?: ConversationHistoryTranscriptOtherToolsResultCommonModelType.Raw | null; } diff --git a/src/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModel.ts b/src/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModel.ts index 8772bc80..5731c7e2 100644 --- a/src/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModel.ts +++ b/src/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModel.ts @@ -17,6 +17,7 @@ export const ConversationHistoryTranscriptSystemToolResultCommonModel: core.seri toolHasBeenCalled: core.serialization.property("tool_has_been_called", core.serialization.boolean()), toolLatencySecs: core.serialization.property("tool_latency_secs", core.serialization.number().optional()), errorType: core.serialization.property("error_type", core.serialization.string().optional()), + rawErrorMessage: core.serialization.property("raw_error_message", core.serialization.string().optional()), dynamicVariableUpdates: core.serialization.property( "dynamic_variable_updates", core.serialization.list(DynamicVariableUpdateCommonModel).optional(), @@ -34,6 +35,7 @@ export declare namespace ConversationHistoryTranscriptSystemToolResultCommonMode tool_has_been_called: boolean; tool_latency_secs?: number | null; error_type?: string | null; + raw_error_message?: string | null; dynamic_variable_updates?: DynamicVariableUpdateCommonModel.Raw[] | null; type: "system"; result?: ConversationHistoryTranscriptSystemToolResultCommonModelResult.Raw | null; diff --git a/src/serialization/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput.ts b/src/serialization/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput.ts index 28e322d6..85ad5fca 100644 --- a/src/serialization/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput.ts +++ b/src/serialization/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput.ts @@ -16,6 +16,7 @@ export const ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput: c toolHasBeenCalled: core.serialization.property("tool_has_been_called", core.serialization.boolean()), toolLatencySecs: core.serialization.property("tool_latency_secs", core.serialization.number().optional()), errorType: core.serialization.property("error_type", core.serialization.string().optional()), + rawErrorMessage: core.serialization.property("raw_error_message", core.serialization.string().optional()), dynamicVariableUpdates: core.serialization.property( "dynamic_variable_updates", core.serialization.list(DynamicVariableUpdateCommonModel).optional(), @@ -33,6 +34,7 @@ export declare namespace ConversationHistoryTranscriptWorkflowToolsResultCommonM tool_has_been_called: boolean; tool_latency_secs?: number | null; error_type?: string | null; + raw_error_message?: string | null; dynamic_variable_updates?: DynamicVariableUpdateCommonModel.Raw[] | null; type: "workflow"; result?: serializers.WorkflowToolResponseModelInput.Raw | null; diff --git a/src/serialization/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput.ts b/src/serialization/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput.ts index 5304634f..4d34f907 100644 --- a/src/serialization/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput.ts +++ b/src/serialization/types/ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput.ts @@ -16,6 +16,7 @@ export const ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput: toolHasBeenCalled: core.serialization.property("tool_has_been_called", core.serialization.boolean()), toolLatencySecs: core.serialization.property("tool_latency_secs", core.serialization.number().optional()), errorType: core.serialization.property("error_type", core.serialization.string().optional()), + rawErrorMessage: core.serialization.property("raw_error_message", core.serialization.string().optional()), dynamicVariableUpdates: core.serialization.property( "dynamic_variable_updates", core.serialization.list(DynamicVariableUpdateCommonModel).optional(), @@ -33,6 +34,7 @@ export declare namespace ConversationHistoryTranscriptWorkflowToolsResultCommonM tool_has_been_called: boolean; tool_latency_secs?: number | null; error_type?: string | null; + raw_error_message?: string | null; dynamic_variable_updates?: DynamicVariableUpdateCommonModel.Raw[] | null; type: "workflow"; result?: serializers.WorkflowToolResponseModelOutput.Raw | null; diff --git a/src/serialization/types/ConversationTurnMetrics.ts b/src/serialization/types/ConversationTurnMetrics.ts index eac86cc9..a145e8da 100644 --- a/src/serialization/types/ConversationTurnMetrics.ts +++ b/src/serialization/types/ConversationTurnMetrics.ts @@ -10,10 +10,12 @@ export const ConversationTurnMetrics: core.serialization.ObjectSchema< ElevenLabs.ConversationTurnMetrics > = core.serialization.object({ metrics: core.serialization.record(core.serialization.string(), MetricRecord).optional(), + convaiAsrProvider: core.serialization.property("convai_asr_provider", core.serialization.string().optional()), }); export declare namespace ConversationTurnMetrics { export interface Raw { metrics?: Record | null; + convai_asr_provider?: string | null; } } diff --git a/src/serialization/types/DirectPublishingReadResponseModel.ts b/src/serialization/types/DirectPublishingReadResponseModel.ts index 68e0b5ad..704cbc1f 100644 --- a/src/serialization/types/DirectPublishingReadResponseModel.ts +++ b/src/serialization/types/DirectPublishingReadResponseModel.ts @@ -65,6 +65,10 @@ export const DirectPublishingReadResponseModel: core.serialization.ObjectSchema< payoutType: core.serialization.property("payout_type", DirectPublishingReadResponseModelPayoutType.optional()), listPrice: core.serialization.property("list_price", core.serialization.number().optional()), currency: core.serialization.stringLiteral("usd").optional(), + originalAudioProjectExportId: core.serialization.property( + "original_audio_project_export_id", + core.serialization.string().optional(), + ), originalAudioDocumentId: core.serialization.property( "original_audio_document_id", core.serialization.string().optional(), @@ -120,6 +124,7 @@ export declare namespace DirectPublishingReadResponseModel { payout_type?: DirectPublishingReadResponseModelPayoutType.Raw | null; list_price?: number | null; currency?: "usd" | null; + original_audio_project_export_id?: string | null; original_audio_document_id?: string | null; series_id?: string | null; volume?: number | null; diff --git a/src/serialization/types/GetUnitTestResponseModel.ts b/src/serialization/types/GetUnitTestResponseModel.ts index ccd98b6f..274c0ef6 100644 --- a/src/serialization/types/GetUnitTestResponseModel.ts +++ b/src/serialization/types/GetUnitTestResponseModel.ts @@ -32,6 +32,7 @@ export const GetUnitTestResponseModel: core.serialization.ObjectSchema< "tool_call_parameters", UnitTestToolCallEvaluationModelOutput.optional(), ), + checkAnyToolMatches: core.serialization.property("check_any_tool_matches", core.serialization.boolean().optional()), dynamicVariables: core.serialization.property( "dynamic_variables", core.serialization @@ -54,6 +55,7 @@ export declare namespace GetUnitTestResponseModel { success_examples: AgentSuccessfulResponseExample.Raw[]; failure_examples: AgentFailureResponseExample.Raw[]; tool_call_parameters?: UnitTestToolCallEvaluationModelOutput.Raw | null; + check_any_tool_matches?: boolean | null; dynamic_variables?: Record | null; type?: UnitTestCommonModelType.Raw | null; from_conversation_metadata?: TestFromConversationMetadataOutput.Raw | null; diff --git a/src/serialization/types/GetWorkspaceSecretsResponseModel.ts b/src/serialization/types/GetWorkspaceSecretsResponseModel.ts index b4bc9b16..d78b1920 100644 --- a/src/serialization/types/GetWorkspaceSecretsResponseModel.ts +++ b/src/serialization/types/GetWorkspaceSecretsResponseModel.ts @@ -10,10 +10,14 @@ export const GetWorkspaceSecretsResponseModel: core.serialization.ObjectSchema< ElevenLabs.GetWorkspaceSecretsResponseModel > = core.serialization.object({ secrets: core.serialization.list(ConvAiWorkspaceStoredSecretConfig), + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + hasMore: core.serialization.property("has_more", core.serialization.boolean().optional()), }); export declare namespace GetWorkspaceSecretsResponseModel { export interface Raw { secrets: ConvAiWorkspaceStoredSecretConfig.Raw[]; + next_cursor?: string | null; + has_more?: boolean | null; } } diff --git a/src/serialization/types/GuardrailsV1Input.ts b/src/serialization/types/GuardrailsV1Input.ts index 6be1b754..52a6c153 100644 --- a/src/serialization/types/GuardrailsV1Input.ts +++ b/src/serialization/types/GuardrailsV1Input.ts @@ -3,6 +3,7 @@ import type * as ElevenLabs from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; +import { AlignmentGuardrail } from "./AlignmentGuardrail"; import { ModerationGuardrailInput } from "./ModerationGuardrailInput"; export const GuardrailsV1Input: core.serialization.ObjectSchema< @@ -10,12 +11,14 @@ export const GuardrailsV1Input: core.serialization.ObjectSchema< ElevenLabs.GuardrailsV1Input > = core.serialization.object({ version: core.serialization.stringLiteral("1").optional(), + alignment: AlignmentGuardrail.optional(), moderation: ModerationGuardrailInput.optional(), }); export declare namespace GuardrailsV1Input { export interface Raw { version?: "1" | null; + alignment?: AlignmentGuardrail.Raw | null; moderation?: ModerationGuardrailInput.Raw | null; } } diff --git a/src/serialization/types/GuardrailsV1Output.ts b/src/serialization/types/GuardrailsV1Output.ts index 641044d1..d1ad38f8 100644 --- a/src/serialization/types/GuardrailsV1Output.ts +++ b/src/serialization/types/GuardrailsV1Output.ts @@ -3,6 +3,7 @@ import type * as ElevenLabs from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; +import { AlignmentGuardrail } from "./AlignmentGuardrail"; import { ModerationGuardrailOutput } from "./ModerationGuardrailOutput"; export const GuardrailsV1Output: core.serialization.ObjectSchema< @@ -10,12 +11,14 @@ export const GuardrailsV1Output: core.serialization.ObjectSchema< ElevenLabs.GuardrailsV1Output > = core.serialization.object({ version: core.serialization.stringLiteral("1").optional(), + alignment: AlignmentGuardrail.optional(), moderation: ModerationGuardrailOutput.optional(), }); export declare namespace GuardrailsV1Output { export interface Raw { version?: "1" | null; + alignment?: AlignmentGuardrail.Raw | null; moderation?: ModerationGuardrailOutput.Raw | null; } } diff --git a/src/serialization/types/ImportWhatsAppAccountResponse.ts b/src/serialization/types/ImportWhatsAppAccountResponse.ts deleted file mode 100644 index 9d0bfedc..00000000 --- a/src/serialization/types/ImportWhatsAppAccountResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as ElevenLabs from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const ImportWhatsAppAccountResponse: core.serialization.ObjectSchema< - serializers.ImportWhatsAppAccountResponse.Raw, - ElevenLabs.ImportWhatsAppAccountResponse -> = core.serialization.object({ - phoneNumberId: core.serialization.property("phone_number_id", core.serialization.string()), -}); - -export declare namespace ImportWhatsAppAccountResponse { - export interface Raw { - phone_number_id: string; - } -} diff --git a/src/serialization/types/NonStreamingOutputFormats.ts b/src/serialization/types/NonStreamingOutputFormats.ts new file mode 100644 index 00000000..17812027 --- /dev/null +++ b/src/serialization/types/NonStreamingOutputFormats.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as ElevenLabs from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const NonStreamingOutputFormats: core.serialization.Schema< + serializers.NonStreamingOutputFormats.Raw, + ElevenLabs.NonStreamingOutputFormats +> = core.serialization.enum_([ + "wav_8000", + "wav_16000", + "wav_22050", + "wav_24000", + "wav_32000", + "wav_44100", + "wav_48000", +]); + +export declare namespace NonStreamingOutputFormats { + export type Raw = "wav_8000" | "wav_16000" | "wav_22050" | "wav_24000" | "wav_32000" | "wav_44100" | "wav_48000"; +} diff --git a/src/serialization/types/PermissionType.ts b/src/serialization/types/PermissionType.ts index 2a0dd6d3..2cd506c4 100644 --- a/src/serialization/types/PermissionType.ts +++ b/src/serialization/types/PermissionType.ts @@ -41,6 +41,12 @@ export const PermissionType: core.serialization.Schema = core.serialization.object({ + procedureId: core.serialization.property("procedure_id", core.serialization.string()), +}); + +export declare namespace ProcedureDraftRef { + export interface Raw { + procedure_id: string; + } +} diff --git a/src/serialization/types/ProcedureVersionRef.ts b/src/serialization/types/ProcedureVersionRef.ts new file mode 100644 index 00000000..414d3566 --- /dev/null +++ b/src/serialization/types/ProcedureVersionRef.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as ElevenLabs from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const ProcedureVersionRef: core.serialization.ObjectSchema< + serializers.ProcedureVersionRef.Raw, + ElevenLabs.ProcedureVersionRef +> = core.serialization.object({ + procedureId: core.serialization.property("procedure_id", core.serialization.string()), + versionId: core.serialization.property("version_id", core.serialization.string()), +}); + +export declare namespace ProcedureVersionRef { + export interface Raw { + procedure_id: string; + version_id: string; + } +} diff --git a/src/serialization/types/ResponseFilterMode.ts b/src/serialization/types/ResponseFilterMode.ts new file mode 100644 index 00000000..6775fbab --- /dev/null +++ b/src/serialization/types/ResponseFilterMode.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as ElevenLabs from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const ResponseFilterMode: core.serialization.Schema< + serializers.ResponseFilterMode.Raw, + ElevenLabs.ResponseFilterMode +> = core.serialization.enum_(["all", "allow"]); + +export declare namespace ResponseFilterMode { + export type Raw = "all" | "allow"; +} diff --git a/src/serialization/types/SongMetadata.ts b/src/serialization/types/SongMetadata.ts index c1104205..5995066e 100644 --- a/src/serialization/types/SongMetadata.ts +++ b/src/serialization/types/SongMetadata.ts @@ -11,8 +11,6 @@ export const SongMetadata: core.serialization.ObjectSchema | null; type?: UnitTestCommonModelType.Raw | null; from_conversation_metadata?: TestFromConversationMetadataOutput.Raw | null; diff --git a/src/serialization/types/User.ts b/src/serialization/types/User.ts index 4f4b2848..b3f5bf2b 100644 --- a/src/serialization/types/User.ts +++ b/src/serialization/types/User.ts @@ -19,6 +19,7 @@ export const User: core.serialization.ObjectSchema { soft_timeout_config: { timeout_seconds: -1, message: "Hhmmmm...yeah." }, turn_eagerness: "normal", spelling_patience: "auto", + speculative_turn: false, }, tts: { model_id: "eleven_turbo_v2", @@ -344,6 +345,7 @@ describe("AgentsClient", () => { }, turn_eagerness: "normal", spelling_patience: "auto", + speculative_turn: false, }, tts: { model_id: "eleven_turbo_v2", @@ -430,6 +432,7 @@ describe("AgentsClient", () => { }, turn_eagerness: "normal", spelling_patience: "auto", + speculative_turn: false, }, tts: { model_id: "eleven_turbo_v2", @@ -517,6 +520,7 @@ describe("AgentsClient", () => { }, turn_eagerness: "normal", spelling_patience: "auto", + speculative_turn: false, }, tts: { model_id: "eleven_turbo_v2", @@ -657,6 +661,7 @@ describe("AgentsClient", () => { }, turnEagerness: "normal", spellingPatience: "auto", + speculativeTurn: false, }, tts: { modelId: "eleven_turbo_v2", @@ -1096,6 +1101,7 @@ describe("AgentsClient", () => { }, turnEagerness: "normal", spellingPatience: "auto", + speculativeTurn: false, }, tts: { modelId: "eleven_turbo_v2", @@ -1204,6 +1210,7 @@ describe("AgentsClient", () => { }, turnEagerness: "normal", spellingPatience: "auto", + speculativeTurn: false, }, tts: { modelId: "eleven_turbo_v2", @@ -1320,6 +1327,7 @@ describe("AgentsClient", () => { }, turnEagerness: "normal", spellingPatience: "auto", + speculativeTurn: false, }, tts: { modelId: "eleven_turbo_v2", @@ -1526,6 +1534,7 @@ describe("AgentsClient", () => { soft_timeout_config: { timeout_seconds: -1, message: "Hhmmmm...yeah." }, turn_eagerness: "normal", spelling_patience: "auto", + speculative_turn: false, }, tts: { model_id: "eleven_turbo_v2", @@ -1823,6 +1832,7 @@ describe("AgentsClient", () => { }, turn_eagerness: "normal", spelling_patience: "auto", + speculative_turn: false, }, tts: { model_id: "eleven_turbo_v2", @@ -1909,6 +1919,7 @@ describe("AgentsClient", () => { }, turn_eagerness: "normal", spelling_patience: "auto", + speculative_turn: false, }, tts: { model_id: "eleven_turbo_v2", @@ -1996,6 +2007,7 @@ describe("AgentsClient", () => { }, turn_eagerness: "normal", spelling_patience: "auto", + speculative_turn: false, }, tts: { model_id: "eleven_turbo_v2", @@ -2137,6 +2149,7 @@ describe("AgentsClient", () => { }, turnEagerness: "normal", spellingPatience: "auto", + speculativeTurn: false, }, tts: { modelId: "eleven_turbo_v2", @@ -2576,6 +2589,7 @@ describe("AgentsClient", () => { }, turnEagerness: "normal", spellingPatience: "auto", + speculativeTurn: false, }, tts: { modelId: "eleven_turbo_v2", @@ -2684,6 +2698,7 @@ describe("AgentsClient", () => { }, turnEagerness: "normal", spellingPatience: "auto", + speculativeTurn: false, }, tts: { modelId: "eleven_turbo_v2", @@ -2800,6 +2815,7 @@ describe("AgentsClient", () => { }, turnEagerness: "normal", spellingPatience: "auto", + speculativeTurn: false, }, tts: { modelId: "eleven_turbo_v2", diff --git a/tests/wire/conversationalAi/secrets.test.ts b/tests/wire/conversationalAi/secrets.test.ts index 669e6d9b..ea96f84d 100644 --- a/tests/wire/conversationalAi/secrets.test.ts +++ b/tests/wire/conversationalAi/secrets.test.ts @@ -37,10 +37,15 @@ describe("SecretsClient", () => { }, }, ], + next_cursor: "next_cursor", + has_more: true, }; server.mockEndpoint().get("/v1/convai/secrets").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.conversationalAi.secrets.list(); + const response = await client.conversationalAi.secrets.list({ + pageSize: 1, + cursor: "cursor", + }); expect(response).toEqual({ secrets: [ { @@ -70,6 +75,8 @@ describe("SecretsClient", () => { }, }, ], + nextCursor: "next_cursor", + hasMore: true, }); }); diff --git a/tests/wire/conversationalAi/tests.test.ts b/tests/wire/conversationalAi/tests.test.ts index 916f864f..94d82648 100644 --- a/tests/wire/conversationalAi/tests.test.ts +++ b/tests/wire/conversationalAi/tests.test.ts @@ -101,6 +101,7 @@ describe("TestsClient", () => { referenced_tool: { id: "id", type: "system" }, verify_absence: true, }, + check_any_tool_matches: true, dynamic_variables: { key: "value" }, type: "llm", from_conversation_metadata: { @@ -204,6 +205,7 @@ describe("TestsClient", () => { }, verifyAbsence: true, }, + checkAnyToolMatches: true, dynamicVariables: { key: "value", }, @@ -280,6 +282,7 @@ describe("TestsClient", () => { referenced_tool: { id: "id", type: "system" }, verify_absence: true, }, + check_any_tool_matches: true, dynamic_variables: { key: "value" }, type: "llm", from_conversation_metadata: { @@ -405,6 +408,7 @@ describe("TestsClient", () => { }, verifyAbsence: true, }, + checkAnyToolMatches: true, dynamicVariables: { key: "value", }, diff --git a/tests/wire/conversationalAi/whatsappAccounts.test.ts b/tests/wire/conversationalAi/whatsappAccounts.test.ts index 45cdcb87..4313e92c 100644 --- a/tests/wire/conversationalAi/whatsappAccounts.test.ts +++ b/tests/wire/conversationalAi/whatsappAccounts.test.ts @@ -4,75 +4,6 @@ import { ElevenLabsClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("WhatsappAccountsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new ElevenLabsClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { - items: [ - { - business_account_id: "business_account_id", - phone_number_id: "phone_number_id", - business_account_name: "business_account_name", - phone_number_name: "phone_number_name", - phone_number: "phone_number", - assigned_agent_id: "assigned_agent_id", - assigned_agent_name: "assigned_agent_name", - }, - ], - }; - server - .mockEndpoint() - .get("/v1/convai/whatsapp-accounts") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.conversationalAi.whatsappAccounts.list(); - expect(response).toEqual({ - items: [ - { - businessAccountId: "business_account_id", - phoneNumberId: "phone_number_id", - businessAccountName: "business_account_name", - phoneNumberName: "phone_number_name", - phoneNumber: "phone_number", - assignedAgentId: "assigned_agent_id", - assignedAgentName: "assigned_agent_name", - }, - ], - }); - }); - - test("import", async () => { - const server = mockServerPool.createServer(); - const client = new ElevenLabsClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { - business_account_id: "business_account_id", - phone_number_id: "phone_number_id", - token_code: "token_code", - }; - const rawResponseBody = { phone_number_id: "phone_number_id" }; - server - .mockEndpoint() - .post("/v1/convai/whatsapp-accounts") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.conversationalAi.whatsappAccounts.import({ - businessAccountId: "business_account_id", - phoneNumberId: "phone_number_id", - tokenCode: "token_code", - }); - expect(response).toEqual({ - phoneNumberId: "phone_number_id", - }); - }); - test("get", async () => { const server = mockServerPool.createServer(); const client = new ElevenLabsClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -144,4 +75,45 @@ describe("WhatsappAccountsClient", () => { key: "value", }); }); + + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new ElevenLabsClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + items: [ + { + business_account_id: "business_account_id", + phone_number_id: "phone_number_id", + business_account_name: "business_account_name", + phone_number_name: "phone_number_name", + phone_number: "phone_number", + assigned_agent_id: "assigned_agent_id", + assigned_agent_name: "assigned_agent_name", + }, + ], + }; + server + .mockEndpoint() + .get("/v1/convai/whatsapp-accounts") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversationalAi.whatsappAccounts.list(); + expect(response).toEqual({ + items: [ + { + businessAccountId: "business_account_id", + phoneNumberId: "phone_number_id", + businessAccountName: "business_account_name", + phoneNumberName: "phone_number_name", + phoneNumber: "phone_number", + assignedAgentId: "assigned_agent_id", + assignedAgentName: "assigned_agent_name", + }, + ], + }); + }); }); diff --git a/tests/wire/main.test.ts b/tests/wire/main.test.ts index cc5b4526..84a89475 100644 --- a/tests/wire/main.test.ts +++ b/tests/wire/main.test.ts @@ -4,6 +4,16 @@ import { ElevenLabsClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("ElevenLabsClient", () => { + test("postV1ConvaiWhatsappAccounts", async () => { + const server = mockServerPool.createServer(); + const client = new ElevenLabsClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().post("/v1/convai/whatsapp-accounts").respondWith().statusCode(200).build(); + + const response = await client.postV1ConvaiWhatsappAccounts(); + expect(response).toEqual(undefined); + }); + test("deleteV1ConvaiAgentsAgentIdBranchesBranchId", async () => { const server = mockServerPool.createServer(); const client = new ElevenLabsClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); diff --git a/tests/wire/studio/projects.test.ts b/tests/wire/studio/projects.test.ts index e68281f2..34e753ca 100644 --- a/tests/wire/studio/projects.test.ts +++ b/tests/wire/studio/projects.test.ts @@ -455,6 +455,7 @@ describe("ProjectsClient", () => { payout_type: "none", list_price: 1.1, currency: "usd", + original_audio_project_export_id: "original_audio_project_export_id", original_audio_document_id: "original_audio_document_id", series_id: "series_id", volume: 1, @@ -933,6 +934,7 @@ describe("ProjectsClient", () => { payoutType: "none", listPrice: 1.1, currency: "usd", + originalAudioProjectExportId: "original_audio_project_export_id", originalAudioDocumentId: "original_audio_document_id", seriesId: "series_id", volume: 1, diff --git a/tests/wire/textToDialogue.test.ts b/tests/wire/textToDialogue.test.ts index 5acc91bf..acc291b6 100644 --- a/tests/wire/textToDialogue.test.ts +++ b/tests/wire/textToDialogue.test.ts @@ -54,7 +54,7 @@ describe("TextToDialogueClient", () => { .build(); const response = await client.textToDialogue.convertWithTimestamps({ - outputFormat: "mp3_22050_32", + outputFormat: "alaw_8000", inputs: [ { text: "Hello, how are you?", diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts index af6d7c01..ad5ed1d2 100644 --- a/tests/wire/user.test.ts +++ b/tests/wire/user.test.ts @@ -37,6 +37,7 @@ describe("UserClient", () => { can_use_delayed_payment_methods: false, is_onboarding_completed: true, is_onboarding_checklist_completed: true, + show_compliance_terms: false, first_name: "John", is_api_key_hashed: false, xi_api_key_preview: "xi_api_key_preview", @@ -76,6 +77,7 @@ describe("UserClient", () => { canUseDelayedPaymentMethods: false, isOnboardingCompleted: true, isOnboardingChecklistCompleted: true, + showComplianceTerms: false, firstName: "John", isApiKeyHashed: false, xiApiKeyPreview: "xi_api_key_preview",