From 5880efff847268c4fa6e3b1dd819184f56d34d5b Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 12:37:07 +0000 Subject: [PATCH] SDK regeneration --- package.json | 2 +- reference.md | 567 ++++++++++++++-- .../resources/audioIsolation/client/Client.ts | 8 +- .../resources/audioNative/client/Client.ts | 4 +- src/api/resources/chapters/client/Client.ts | 104 ++- ...ojectV1ProjectsProjectIdChaptersAddPost.ts | 0 .../chapters/client/requests/index.ts | 1 + .../conversationalAi/client/Client.ts | 620 ++++++++++++++++-- ...ConversationsConversationIdFeedbackPost.ts | 16 + ... ConversationalAiGetAgentWidgetRequest.ts} | 2 +- .../requests/CreatePhoneNumberRequest.ts | 24 + .../requests/UpdatePhoneNumberRequest.ts | 11 + .../conversationalAi/client/requests/index.ts | 5 +- src/api/resources/dubbing/client/Client.ts | 24 +- ...s => DubbingGetTranscriptForDubRequest.ts} | 4 +- .../dubbing/client/requests/index.ts | 2 +- ...ingGetTranscriptForDubRequestFormatType.ts | 12 + ...nscriptLanguageCodeGetRequestFormatType.ts | 12 - src/api/resources/dubbing/types/index.ts | 2 +- src/api/resources/history/client/Client.ts | 20 +- src/api/resources/models/client/Client.ts | 4 +- src/api/resources/projects/client/Client.ts | 120 +--- .../projects/client/requests/index.ts | 1 - .../pronunciationDictionary/client/Client.ts | 32 +- src/api/resources/samples/client/Client.ts | 8 +- .../resources/speechToSpeech/client/Client.ts | 8 +- .../textToSoundEffects/client/Client.ts | 4 +- .../resources/textToSpeech/client/Client.ts | 16 +- .../resources/textToVoice/client/Client.ts | 8 +- src/api/resources/usage/client/Client.ts | 4 +- src/api/resources/user/client/Client.ts | 8 +- .../voiceGeneration/client/Client.ts | 12 +- src/api/resources/voices/client/Client.ts | 48 +- src/api/resources/workspace/client/Client.ts | 12 +- src/api/types/AgentConfigOverrideConfig.ts | 11 + src/api/types/AgentPlatformSettings.ts | 3 + .../ConversationConfigClientOverrideConfig.ts | 10 + .../ConversationHistoryFeedbackCommonModel.ts | 11 + .../ConversationHistoryMetadataCommonModel.ts | 1 + ...onversationHistoryTranscriptCommonModel.ts | 2 + .../ConversationInitiationClientDataConfig.ts | 10 + .../types/CreatePhoneNumberResponseModel.ts | 8 + src/api/types/EmbedConfig.ts | 1 + src/api/types/GetPhoneNumberResponseModel.ts | 16 + .../types/ModerationStatusResponseModel.ts | 16 + ...derationStatusResponseModelSafetyStatus.ts | 9 + ...erationStatusResponseModelWarningStatus.ts | 9 + src/api/types/PhoneNumberAgentInfo.ts | 8 + src/api/types/PrivacyConfig.ts | 7 + .../types/ProjectCreationMetaResponseModel.ts | 11 + .../ProjectCreationMetaResponseModelStatus.ts | 11 + .../ProjectCreationMetaResponseModelType.ts | 9 + src/api/types/ProjectExtendedResponseModel.ts | 1 + src/api/types/ProjectResponse.ts | 1 + src/api/types/ProjectState.ts | 3 +- src/api/types/PromptAgentOverrideConfig.ts | 7 + src/api/types/Safety.ts | 13 + src/api/types/SafetyEvaluation.ts | 16 + src/api/types/SafetyRule.ts | 28 + src/api/types/TelephonyProvider.ts | 8 + .../TtsConversationalConfigOverrideConfig.ts | 7 + src/api/types/User.ts | 1 + src/api/types/UserFeedback.ts | 10 + src/api/types/UserFeedbackScore.ts | 12 + src/api/types/WidgetFeedbackMode.ts | 13 + src/api/types/index.ts | 23 + src/core/streaming-fetcher/Stream.ts | 11 +- src/version.ts | 2 +- yarn.lock | 16 +- 69 files changed, 1692 insertions(+), 358 deletions(-) rename src/api/resources/{projects => chapters}/client/requests/BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost.ts (100%) create mode 100644 src/api/resources/conversationalAi/client/requests/BodySendConversationFeedbackV1ConvaiConversationsConversationIdFeedbackPost.ts rename src/api/resources/conversationalAi/client/requests/{ConversationalAiGetWidgetRequest.ts => ConversationalAiGetAgentWidgetRequest.ts} (84%) create mode 100644 src/api/resources/conversationalAi/client/requests/CreatePhoneNumberRequest.ts create mode 100644 src/api/resources/conversationalAi/client/requests/UpdatePhoneNumberRequest.ts rename src/api/resources/dubbing/client/requests/{GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequest.ts => DubbingGetTranscriptForDubRequest.ts} (54%) create mode 100644 src/api/resources/dubbing/types/DubbingGetTranscriptForDubRequestFormatType.ts delete mode 100644 src/api/resources/dubbing/types/GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequestFormatType.ts create mode 100644 src/api/types/AgentConfigOverrideConfig.ts create mode 100644 src/api/types/ConversationConfigClientOverrideConfig.ts create mode 100644 src/api/types/ConversationHistoryFeedbackCommonModel.ts create mode 100644 src/api/types/ConversationInitiationClientDataConfig.ts create mode 100644 src/api/types/CreatePhoneNumberResponseModel.ts create mode 100644 src/api/types/GetPhoneNumberResponseModel.ts create mode 100644 src/api/types/ModerationStatusResponseModel.ts create mode 100644 src/api/types/ModerationStatusResponseModelSafetyStatus.ts create mode 100644 src/api/types/ModerationStatusResponseModelWarningStatus.ts create mode 100644 src/api/types/PhoneNumberAgentInfo.ts create mode 100644 src/api/types/PrivacyConfig.ts create mode 100644 src/api/types/ProjectCreationMetaResponseModel.ts create mode 100644 src/api/types/ProjectCreationMetaResponseModelStatus.ts create mode 100644 src/api/types/ProjectCreationMetaResponseModelType.ts create mode 100644 src/api/types/PromptAgentOverrideConfig.ts create mode 100644 src/api/types/Safety.ts create mode 100644 src/api/types/SafetyEvaluation.ts create mode 100644 src/api/types/SafetyRule.ts create mode 100644 src/api/types/TelephonyProvider.ts create mode 100644 src/api/types/TtsConversationalConfigOverrideConfig.ts create mode 100644 src/api/types/UserFeedback.ts create mode 100644 src/api/types/UserFeedbackScore.ts create mode 100644 src/api/types/WidgetFeedbackMode.ts diff --git a/package.json b/package.json index b1bee22..6ebb38b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "elevenlabs", - "version": "0.18.2", + "version": "1.50.0", "private": false, "repository": "https://github.com/elevenlabs/elevenlabs-js", "license": "MIT", diff --git a/reference.md b/reference.md index 274e680..8f2c006 100644 --- a/reference.md +++ b/reference.md @@ -326,7 +326,7 @@ await client.history.download({ ## AudioIsolation -## Samples +## samples
client.samples.delete(voiceId, sampleId) -> unknown
@@ -2032,7 +2032,7 @@ await client.voices.getAProfilePage("talexgeorge");
-## Projects +## projects
client.projects.getAll() -> ElevenLabs.GetProjectsResponse
@@ -2555,7 +2555,7 @@ await client.projects.streamArchive("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWA
-
client.projects.addChapterToAProject(projectId, { ...params }) -> ElevenLabs.AddChapterResponseModel +
client.projects.updatePronunciationDictionaries(projectId, { ...params }) -> unknown
@@ -2567,7 +2567,7 @@ await client.projects.streamArchive("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWA
-Creates a new chapter either as blank or from a URL. +Updates the set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does.
@@ -2583,8 +2583,13 @@ Creates a new chapter either as blank or from a URL.
```typescript -await client.projects.addChapterToAProject("21m00Tcm4TlvDq8ikWAM", { - name: "name", +await client.projects.updatePronunciationDictionaries("21m00Tcm4TlvDq8ikWAM", { + pronunciation_dictionary_locators: [ + { + pronunciation_dictionary_id: "pronunciation_dictionary_id", + version_id: "version_id", + }, + ], }); ``` @@ -2609,7 +2614,7 @@ await client.projects.addChapterToAProject("21m00Tcm4TlvDq8ikWAM", {
-**request:** `ElevenLabs.BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost` +**request:** `ElevenLabs.UpdatePronunciationDictionariesRequest`
@@ -2628,7 +2633,9 @@ await client.projects.addChapterToAProject("21m00Tcm4TlvDq8ikWAM", {
-
client.projects.updatePronunciationDictionaries(projectId, { ...params }) -> unknown +## Chapters + +
client.chapters.getAll(projectId) -> ElevenLabs.GetChaptersResponse
@@ -2640,7 +2647,7 @@ await client.projects.addChapterToAProject("21m00Tcm4TlvDq8ikWAM", {
-Updates the set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does. +Returns a list of your chapters for a project together and its metadata.
@@ -2656,14 +2663,7 @@ Updates the set of pronunciation dictionaries acting on a project. This will aut
```typescript -await client.projects.updatePronunciationDictionaries("21m00Tcm4TlvDq8ikWAM", { - pronunciation_dictionary_locators: [ - { - pronunciation_dictionary_id: "pronunciation_dictionary_id", - version_id: "version_id", - }, - ], -}); +await client.chapters.getAll("21m00Tcm4TlvDq8ikWAM"); ```
@@ -2687,15 +2687,7 @@ await client.projects.updatePronunciationDictionaries("21m00Tcm4TlvDq8ikWAM", {
-**request:** `ElevenLabs.UpdatePronunciationDictionariesRequest` - -
-
- -
-
- -**requestOptions:** `Projects.RequestOptions` +**requestOptions:** `Chapters.RequestOptions`
@@ -2706,9 +2698,7 @@ await client.projects.updatePronunciationDictionaries("21m00Tcm4TlvDq8ikWAM", {
-## Chapters - -
client.chapters.getAll(projectId) -> ElevenLabs.GetChaptersResponse +
client.chapters.get(projectId, chapterId) -> ElevenLabs.ChapterResponse
@@ -2720,7 +2710,7 @@ await client.projects.updatePronunciationDictionaries("21m00Tcm4TlvDq8ikWAM", {
-Returns a list of your chapters for a project together and its metadata. +Returns information about a specific chapter.
@@ -2736,7 +2726,7 @@ Returns a list of your chapters for a project together and its metadata.
```typescript -await client.chapters.getAll("21m00Tcm4TlvDq8ikWAM"); +await client.chapters.get("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWAM"); ```
@@ -2760,6 +2750,14 @@ await client.chapters.getAll("21m00Tcm4TlvDq8ikWAM");
+**chapterId:** `string` — The chapter_id of the chapter. You can query GET https://api.elevenlabs.io/v1/projects/{project_id}/chapters to list all available chapters for a project. + +
+
+ +
+
+ **requestOptions:** `Chapters.RequestOptions`
@@ -2771,7 +2769,7 @@ await client.chapters.getAll("21m00Tcm4TlvDq8ikWAM");
-
client.chapters.get(projectId, chapterId) -> ElevenLabs.ChapterResponse +
client.chapters.delete(projectId, chapterId) -> unknown
@@ -2783,7 +2781,7 @@ await client.chapters.getAll("21m00Tcm4TlvDq8ikWAM");
-Returns information about a specific chapter. +Delete a chapter by its chapter_id.
@@ -2799,7 +2797,7 @@ Returns information about a specific chapter.
```typescript -await client.chapters.get("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWAM"); +await client.chapters.delete("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWAM"); ```
@@ -2842,7 +2840,7 @@ await client.chapters.get("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWAM");
-
client.chapters.delete(projectId, chapterId) -> unknown +
client.chapters.create(projectId, { ...params }) -> ElevenLabs.AddChapterResponseModel
@@ -2854,7 +2852,7 @@ await client.chapters.get("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWAM");
-Delete a chapter by its chapter_id. +Creates a new chapter either as blank or from a URL.
@@ -2870,7 +2868,9 @@ Delete a chapter by its chapter_id.
```typescript -await client.chapters.delete("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWAM"); +await client.chapters.create("21m00Tcm4TlvDq8ikWAM", { + name: "name", +}); ```
@@ -2894,7 +2894,7 @@ await client.chapters.delete("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWAM");
-**chapterId:** `string` — The chapter_id of the chapter. You can query GET https://api.elevenlabs.io/v1/projects/{project_id}/chapters to list all available chapters for a project. +**request:** `ElevenLabs.BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost`
@@ -3395,7 +3395,7 @@ await client.dubbing.getTranscriptForDub("dubbing_id", "language_code");
-**request:** `ElevenLabs.GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequest` +**request:** `ElevenLabs.DubbingGetTranscriptForDubRequest`
@@ -3414,7 +3414,7 @@ await client.dubbing.getTranscriptForDub("dubbing_id", "language_code");
-## Models +## models
client.models.getAll() -> ElevenLabs.Model[]
@@ -3673,7 +3673,7 @@ await client.pronunciationDictionary.addFromFile({
-
client.pronunciationDictionary.addRulesToThePronunciationDictionary(pronunciationDictionaryId, { ...params }) -> ElevenLabs.AddPronunciationDictionaryRulesResponseModel +
client.pronunciationDictionary.addRules(pronunciationDictionaryId, { ...params }) -> ElevenLabs.AddPronunciationDictionaryRulesResponseModel
@@ -3701,7 +3701,7 @@ Add rules to the pronunciation dictionary
```typescript -await client.pronunciationDictionary.addRulesToThePronunciationDictionary("21m00Tcm4TlvDq8ikWAM", { +await client.pronunciationDictionary.addRules("21m00Tcm4TlvDq8ikWAM", { rules: [ { type: "phoneme", @@ -3753,7 +3753,7 @@ await client.pronunciationDictionary.addRulesToThePronunciationDictionary("21m00
-
client.pronunciationDictionary.removeRulesFromThePronunciationDictionary(pronunciationDictionaryId, { ...params }) -> ElevenLabs.RemovePronunciationDictionaryRulesResponseModel +
client.pronunciationDictionary.removeRules(pronunciationDictionaryId, { ...params }) -> ElevenLabs.RemovePronunciationDictionaryRulesResponseModel
@@ -3781,7 +3781,7 @@ Remove rules from the pronunciation dictionary
```typescript -await client.pronunciationDictionary.removeRulesFromThePronunciationDictionary("21m00Tcm4TlvDq8ikWAM", { +await client.pronunciationDictionary.removeRules("21m00Tcm4TlvDq8ikWAM", { rule_strings: ["rule_strings"], }); ``` @@ -4551,7 +4551,7 @@ await client.conversationalAi.updateAgent("21m00Tcm4TlvDq8ikWAM");
-
client.conversationalAi.getWidget(agentId, { ...params }) -> ElevenLabs.GetAgentEmbedResponseModel +
client.conversationalAi.getAgentWidget(agentId, { ...params }) -> ElevenLabs.GetAgentEmbedResponseModel
@@ -4579,7 +4579,7 @@ Retrieve the widget configuration for an agent
```typescript -await client.conversationalAi.getWidget("21m00Tcm4TlvDq8ikWAM"); +await client.conversationalAi.getAgentWidget("21m00Tcm4TlvDq8ikWAM"); ```
@@ -4603,7 +4603,7 @@ await client.conversationalAi.getWidget("21m00Tcm4TlvDq8ikWAM");
-**request:** `ElevenLabs.ConversationalAiGetWidgetRequest` +**request:** `ElevenLabs.ConversationalAiGetAgentWidgetRequest`
@@ -4622,7 +4622,7 @@ await client.conversationalAi.getWidget("21m00Tcm4TlvDq8ikWAM");
-
client.conversationalAi.getLink(agentId) -> ElevenLabs.GetAgentLinkResponseModel +
client.conversationalAi.getAgentLink(agentId) -> ElevenLabs.GetAgentLinkResponseModel
@@ -4650,7 +4650,7 @@ Get the current link used to share the agent with others
```typescript -await client.conversationalAi.getLink("21m00Tcm4TlvDq8ikWAM"); +await client.conversationalAi.getAgentLink("21m00Tcm4TlvDq8ikWAM"); ```
@@ -4685,7 +4685,7 @@ await client.conversationalAi.getLink("21m00Tcm4TlvDq8ikWAM");
-
client.conversationalAi.postAvatar(agentId, { ...params }) -> ElevenLabs.PostAgentAvatarResponseModel +
client.conversationalAi.postAgentAvatar(agentId, { ...params }) -> ElevenLabs.PostAgentAvatarResponseModel
@@ -4713,7 +4713,7 @@ Sets the avatar for an agent displayed in the widget
```typescript -await client.conversationalAi.postAvatar("21m00Tcm4TlvDq8ikWAM", { +await client.conversationalAi.postAgentAvatar("21m00Tcm4TlvDq8ikWAM", { avatar_file: fs.createReadStream("/path/to/your/file"), }); ``` @@ -4758,7 +4758,7 @@ await client.conversationalAi.postAvatar("21m00Tcm4TlvDq8ikWAM", {
-
client.conversationalAi.getKnowledgeBaseDocument(agentId, documentationId) -> ElevenLabs.GetKnowledgeBaseReponseModel +
client.conversationalAi.getAgentKnowledgeBaseDocumentById(agentId, documentationId) -> ElevenLabs.GetKnowledgeBaseReponseModel
@@ -4786,7 +4786,7 @@ Get details about a specific documentation making up the agent's knowledge base
```typescript -await client.conversationalAi.getKnowledgeBaseDocument("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWAM"); +await client.conversationalAi.getAgentKnowledgeBaseDocumentById("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWAM"); ```
@@ -4903,7 +4903,7 @@ await client.conversationalAi.addAgentSecret("21m00Tcm4TlvDq8ikWAM", {
-
client.conversationalAi.createKnowledgeBaseDocument(agentId, { ...params }) -> ElevenLabs.AddKnowledgeBaseResponseModel +
client.conversationalAi.addToAgentKnowledgeBase(agentId, { ...params }) -> ElevenLabs.AddKnowledgeBaseResponseModel
@@ -4931,7 +4931,7 @@ Uploads a file or reference a webpage for the agent to use as part of it's knowl
```typescript -await client.conversationalAi.createKnowledgeBaseDocument("21m00Tcm4TlvDq8ikWAM", {}); +await client.conversationalAi.addToAgentKnowledgeBase("21m00Tcm4TlvDq8ikWAM", {}); ```
@@ -5165,6 +5165,69 @@ await client.conversationalAi.getConversation("21m00Tcm4TlvDq8ikWAM");
+
client.conversationalAi.deleteConversation(conversationId) -> unknown +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a particular conversation + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversationalAi.deleteConversation("21m00Tcm4TlvDq8ikWAM"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**conversationId:** `string` — The id of the conversation you're taking the action on. + +
+
+ +
+
+ +**requestOptions:** `ConversationalAi.RequestOptions` + +
+
+
+
+ +
+
+
+
client.conversationalAi.getConversationAudio(conversationId) -> void
@@ -5227,3 +5290,397 @@ await client.conversationalAi.getConversationAudio("21m00Tcm4TlvDq8ikWAM");
+ +
client.conversationalAi.postConversationFeedback(conversationId, { ...params }) -> unknown +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Send the feedback for the given conversation + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversationalAi.postConversationFeedback("21m00Tcm4TlvDq8ikWAM", { + feedback: "like", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**conversationId:** `string` — The id of the conversation you're taking the action on. + +
+
+ +
+
+ +**request:** `ElevenLabs.BodySendConversationFeedbackV1ConvaiConversationsConversationIdFeedbackPost` + +
+
+ +
+
+ +**requestOptions:** `ConversationalAi.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversationalAi.createPhoneNumber({ ...params }) -> ElevenLabs.CreatePhoneNumberResponseModel +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Import Phone Number from Twilio configuration + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversationalAi.createPhoneNumber({ + phone_number: "phone_number", + provider: "twilio", + label: "label", + sid: "sid", + token: "token", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ElevenLabs.CreatePhoneNumberRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationalAi.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversationalAi.getPhoneNumber(phoneNumberId) -> ElevenLabs.GetPhoneNumberResponseModel +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve Phone Number details by ID + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversationalAi.getPhoneNumber("TeaqRRdTcIfIu2i7BYfT"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**phoneNumberId:** `string` — The id of an agent. This is returned on agent creation. + +
+
+ +
+
+ +**requestOptions:** `ConversationalAi.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversationalAi.deletePhoneNumber(phoneNumberId) -> unknown +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete Phone Number by ID + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversationalAi.deletePhoneNumber("TeaqRRdTcIfIu2i7BYfT"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**phoneNumberId:** `string` — The id of an agent. This is returned on agent creation. + +
+
+ +
+
+ +**requestOptions:** `ConversationalAi.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversationalAi.updatePhoneNumber(phoneNumberId, { ...params }) -> ElevenLabs.GetPhoneNumberResponseModel +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update Phone Number details by ID + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversationalAi.updatePhoneNumber("TeaqRRdTcIfIu2i7BYfT"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**phoneNumberId:** `string` — The id of an agent. This is returned on agent creation. + +
+
+ +
+
+ +**request:** `ElevenLabs.UpdatePhoneNumberRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationalAi.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversationalAi.getPhoneNumbers() -> ElevenLabs.GetPhoneNumberResponseModel[] +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve all Phone Numbers + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversationalAi.getPhoneNumbers(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `ConversationalAi.RequestOptions` + +
+
+
+
+ +
+
+
diff --git a/src/api/resources/audioIsolation/client/Client.ts b/src/api/resources/audioIsolation/client/Client.ts index 3e99f39..9cc1a3a 100644 --- a/src/api/resources/audioIsolation/client/Client.ts +++ b/src/api/resources/audioIsolation/client/Client.ts @@ -57,8 +57,8 @@ export class AudioIsolation { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, @@ -129,8 +129,8 @@ export class AudioIsolation { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, diff --git a/src/api/resources/audioNative/client/Client.ts b/src/api/resources/audioNative/client/Client.ts index a8243cf..02023e8 100644 --- a/src/api/resources/audioNative/client/Client.ts +++ b/src/api/resources/audioNative/client/Client.ts @@ -109,8 +109,8 @@ export class AudioNative { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, diff --git a/src/api/resources/chapters/client/Client.ts b/src/api/resources/chapters/client/Client.ts index 655264b..61a7286 100644 --- a/src/api/resources/chapters/client/Client.ts +++ b/src/api/resources/chapters/client/Client.ts @@ -60,8 +60,8 @@ export class Chapters { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -137,8 +137,8 @@ export class Chapters { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -214,8 +214,8 @@ export class Chapters { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -261,6 +261,86 @@ export class Chapters { } } + /** + * Creates a new chapter either as blank or from a URL. + * + * @param {string} projectId - The project_id of the project, you can query GET https://api.elevenlabs.io/v1/projects to list all available projects. + * @param {ElevenLabs.BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost} request + * @param {Chapters.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link ElevenLabs.UnprocessableEntityError} + * + * @example + * await client.chapters.create("21m00Tcm4TlvDq8ikWAM", { + * name: "name" + * }) + */ + public async create( + projectId: string, + request: ElevenLabs.BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost, + requestOptions?: Chapters.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ElevenLabsEnvironment.Production, + `v1/projects/${encodeURIComponent(projectId)}/chapters/add` + ), + method: "POST", + headers: { + "xi-api-key": + (await core.Supplier.get(this._options.apiKey)) != null + ? await core.Supplier.get(this._options.apiKey) + : undefined, + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "elevenlabs", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: request, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return _response.body as ElevenLabs.AddChapterResponseModel; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new ElevenLabs.UnprocessableEntityError( + _response.error.body as ElevenLabs.HttpValidationError + ); + default: + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ElevenLabsTimeoutError( + "Timeout exceeded when calling POST /v1/projects/{project_id}/chapters/add." + ); + case "unknown": + throw new errors.ElevenLabsError({ + message: _response.error.errorMessage, + }); + } + } + /** * Starts conversion of a specific chapter. * @@ -291,8 +371,8 @@ export class Chapters { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -368,8 +448,8 @@ export class Chapters { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -451,8 +531,8 @@ export class Chapters { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/projects/client/requests/BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost.ts b/src/api/resources/chapters/client/requests/BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost.ts similarity index 100% rename from src/api/resources/projects/client/requests/BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost.ts rename to src/api/resources/chapters/client/requests/BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost.ts diff --git a/src/api/resources/chapters/client/requests/index.ts b/src/api/resources/chapters/client/requests/index.ts index b381613..58a53d1 100644 --- a/src/api/resources/chapters/client/requests/index.ts +++ b/src/api/resources/chapters/client/requests/index.ts @@ -1 +1,2 @@ +export { type BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost } from "./BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost"; export { type BodyStreamChapterAudioV1ProjectsProjectIdChaptersChapterIdSnapshotsChapterSnapshotIdStreamPost } from "./BodyStreamChapterAudioV1ProjectsProjectIdChaptersChapterIdSnapshotsChapterSnapshotIdStreamPost"; diff --git a/src/api/resources/conversationalAi/client/Client.ts b/src/api/resources/conversationalAi/client/Client.ts index 303efef..22e359b 100644 --- a/src/api/resources/conversationalAi/client/Client.ts +++ b/src/api/resources/conversationalAi/client/Client.ts @@ -66,8 +66,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -144,8 +144,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -218,8 +218,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -293,8 +293,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -370,8 +370,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -422,17 +422,17 @@ export class ConversationalAi { * Retrieve the widget configuration for an agent * * @param {string} agentId - The id of an agent. This is returned on agent creation. - * @param {ElevenLabs.ConversationalAiGetWidgetRequest} request + * @param {ElevenLabs.ConversationalAiGetAgentWidgetRequest} request * @param {ConversationalAi.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.conversationalAi.getWidget("21m00Tcm4TlvDq8ikWAM") + * await client.conversationalAi.getAgentWidget("21m00Tcm4TlvDq8ikWAM") */ - public async getWidget( + public async getAgentWidget( agentId: string, - request: ElevenLabs.ConversationalAiGetWidgetRequest = {}, + request: ElevenLabs.ConversationalAiGetAgentWidgetRequest = {}, requestOptions?: ConversationalAi.RequestOptions ): Promise { const { conversation_signature: conversationSignature } = request; @@ -454,8 +454,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -511,9 +511,9 @@ export class ConversationalAi { * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.conversationalAi.getLink("21m00Tcm4TlvDq8ikWAM") + * await client.conversationalAi.getAgentLink("21m00Tcm4TlvDq8ikWAM") */ - public async getLink( + public async getAgentLink( agentId: string, requestOptions?: ConversationalAi.RequestOptions ): Promise { @@ -530,8 +530,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -587,11 +587,11 @@ export class ConversationalAi { * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.conversationalAi.postAvatar("21m00Tcm4TlvDq8ikWAM", { + * await client.conversationalAi.postAgentAvatar("21m00Tcm4TlvDq8ikWAM", { * avatar_file: fs.createReadStream("/path/to/your/file") * }) */ - public async postAvatar( + public async postAgentAvatar( agentId: string, request: ElevenLabs.BodyPostAgentAvatarV1ConvaiAgentsAgentIdAvatarPost, requestOptions?: ConversationalAi.RequestOptions @@ -612,8 +612,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, @@ -671,9 +671,9 @@ export class ConversationalAi { * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.conversationalAi.getKnowledgeBaseDocument("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWAM") + * await client.conversationalAi.getAgentKnowledgeBaseDocumentById("21m00Tcm4TlvDq8ikWAM", "21m00Tcm4TlvDq8ikWAM") */ - public async getKnowledgeBaseDocument( + public async getAgentKnowledgeBaseDocumentById( agentId: string, documentationId: string, requestOptions?: ConversationalAi.RequestOptions @@ -691,8 +691,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -771,8 +771,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -829,9 +829,9 @@ export class ConversationalAi { * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.conversationalAi.createKnowledgeBaseDocument("21m00Tcm4TlvDq8ikWAM", {}) + * await client.conversationalAi.addToAgentKnowledgeBase("21m00Tcm4TlvDq8ikWAM", {}) */ - public async createKnowledgeBaseDocument( + public async addToAgentKnowledgeBase( agentId: string, request: ElevenLabs.BodyAddToAgentSKnowledgeBaseV1ConvaiAgentsAgentIdAddToKnowledgeBasePost, requestOptions?: ConversationalAi.RequestOptions @@ -859,8 +859,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, @@ -950,8 +950,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1044,8 +1044,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1118,8 +1118,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1165,6 +1165,81 @@ export class ConversationalAi { } } + /** + * Delete a particular conversation + * + * @param {string} conversationId - The id of the conversation you're taking the action on. + * @param {ConversationalAi.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link ElevenLabs.UnprocessableEntityError} + * + * @example + * await client.conversationalAi.deleteConversation("21m00Tcm4TlvDq8ikWAM") + */ + public async deleteConversation( + conversationId: string, + requestOptions?: ConversationalAi.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ElevenLabsEnvironment.Production, + `v1/convai/conversations/${encodeURIComponent(conversationId)}` + ), + method: "DELETE", + headers: { + "xi-api-key": + (await core.Supplier.get(this._options.apiKey)) != null + ? await core.Supplier.get(this._options.apiKey) + : undefined, + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "elevenlabs", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return _response.body; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new ElevenLabs.UnprocessableEntityError( + _response.error.body as ElevenLabs.HttpValidationError + ); + default: + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ElevenLabsTimeoutError( + "Timeout exceeded when calling DELETE /v1/convai/conversations/{conversation_id}." + ); + case "unknown": + throw new errors.ElevenLabsError({ + message: _response.error.errorMessage, + }); + } + } + /** * Get the audio recording of a particular conversation * @@ -1193,8 +1268,8 @@ export class ConversationalAi { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1239,4 +1314,465 @@ export class ConversationalAi { }); } } + + /** + * Send the feedback for the given conversation + * + * @param {string} conversationId - The id of the conversation you're taking the action on. + * @param {ElevenLabs.BodySendConversationFeedbackV1ConvaiConversationsConversationIdFeedbackPost} request + * @param {ConversationalAi.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link ElevenLabs.UnprocessableEntityError} + * + * @example + * await client.conversationalAi.postConversationFeedback("21m00Tcm4TlvDq8ikWAM", { + * feedback: "like" + * }) + */ + public async postConversationFeedback( + conversationId: string, + request: ElevenLabs.BodySendConversationFeedbackV1ConvaiConversationsConversationIdFeedbackPost, + requestOptions?: ConversationalAi.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ElevenLabsEnvironment.Production, + `v1/convai/conversations/${encodeURIComponent(conversationId)}/feedback` + ), + method: "POST", + headers: { + "xi-api-key": + (await core.Supplier.get(this._options.apiKey)) != null + ? await core.Supplier.get(this._options.apiKey) + : undefined, + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "elevenlabs", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: request, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return _response.body; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new ElevenLabs.UnprocessableEntityError( + _response.error.body as ElevenLabs.HttpValidationError + ); + default: + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ElevenLabsTimeoutError( + "Timeout exceeded when calling POST /v1/convai/conversations/{conversation_id}/feedback." + ); + case "unknown": + throw new errors.ElevenLabsError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Import Phone Number from Twilio configuration + * + * @param {ElevenLabs.CreatePhoneNumberRequest} request + * @param {ConversationalAi.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link ElevenLabs.UnprocessableEntityError} + * + * @example + * await client.conversationalAi.createPhoneNumber({ + * phone_number: "phone_number", + * provider: "twilio", + * label: "label", + * sid: "sid", + * token: "token" + * }) + */ + public async createPhoneNumber( + request: ElevenLabs.CreatePhoneNumberRequest, + requestOptions?: ConversationalAi.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ElevenLabsEnvironment.Production, + "v1/convai/phone-numbers/create" + ), + method: "POST", + headers: { + "xi-api-key": + (await core.Supplier.get(this._options.apiKey)) != null + ? await core.Supplier.get(this._options.apiKey) + : undefined, + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "elevenlabs", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: { ...request, provider: "twilio" }, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return _response.body as ElevenLabs.CreatePhoneNumberResponseModel; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new ElevenLabs.UnprocessableEntityError( + _response.error.body as ElevenLabs.HttpValidationError + ); + default: + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ElevenLabsTimeoutError( + "Timeout exceeded when calling POST /v1/convai/phone-numbers/create." + ); + case "unknown": + throw new errors.ElevenLabsError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Retrieve Phone Number details by ID + * + * @param {string} phoneNumberId - The id of an agent. This is returned on agent creation. + * @param {ConversationalAi.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link ElevenLabs.UnprocessableEntityError} + * + * @example + * await client.conversationalAi.getPhoneNumber("TeaqRRdTcIfIu2i7BYfT") + */ + public async getPhoneNumber( + phoneNumberId: string, + requestOptions?: ConversationalAi.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ElevenLabsEnvironment.Production, + `v1/convai/phone-numbers/${encodeURIComponent(phoneNumberId)}` + ), + method: "GET", + headers: { + "xi-api-key": + (await core.Supplier.get(this._options.apiKey)) != null + ? await core.Supplier.get(this._options.apiKey) + : undefined, + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "elevenlabs", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return _response.body as ElevenLabs.GetPhoneNumberResponseModel; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new ElevenLabs.UnprocessableEntityError( + _response.error.body as ElevenLabs.HttpValidationError + ); + default: + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ElevenLabsTimeoutError( + "Timeout exceeded when calling GET /v1/convai/phone-numbers/{phone_number_id}." + ); + case "unknown": + throw new errors.ElevenLabsError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Delete Phone Number by ID + * + * @param {string} phoneNumberId - The id of an agent. This is returned on agent creation. + * @param {ConversationalAi.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link ElevenLabs.UnprocessableEntityError} + * + * @example + * await client.conversationalAi.deletePhoneNumber("TeaqRRdTcIfIu2i7BYfT") + */ + public async deletePhoneNumber( + phoneNumberId: string, + requestOptions?: ConversationalAi.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ElevenLabsEnvironment.Production, + `v1/convai/phone-numbers/${encodeURIComponent(phoneNumberId)}` + ), + method: "DELETE", + headers: { + "xi-api-key": + (await core.Supplier.get(this._options.apiKey)) != null + ? await core.Supplier.get(this._options.apiKey) + : undefined, + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "elevenlabs", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return _response.body; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new ElevenLabs.UnprocessableEntityError( + _response.error.body as ElevenLabs.HttpValidationError + ); + default: + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ElevenLabsTimeoutError( + "Timeout exceeded when calling DELETE /v1/convai/phone-numbers/{phone_number_id}." + ); + case "unknown": + throw new errors.ElevenLabsError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Update Phone Number details by ID + * + * @param {string} phoneNumberId - The id of an agent. This is returned on agent creation. + * @param {ElevenLabs.UpdatePhoneNumberRequest} request + * @param {ConversationalAi.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link ElevenLabs.UnprocessableEntityError} + * + * @example + * await client.conversationalAi.updatePhoneNumber("TeaqRRdTcIfIu2i7BYfT") + */ + public async updatePhoneNumber( + phoneNumberId: string, + request: ElevenLabs.UpdatePhoneNumberRequest = {}, + requestOptions?: ConversationalAi.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ElevenLabsEnvironment.Production, + `v1/convai/phone-numbers/${encodeURIComponent(phoneNumberId)}` + ), + method: "PATCH", + headers: { + "xi-api-key": + (await core.Supplier.get(this._options.apiKey)) != null + ? await core.Supplier.get(this._options.apiKey) + : undefined, + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "elevenlabs", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: request, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return _response.body as ElevenLabs.GetPhoneNumberResponseModel; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new ElevenLabs.UnprocessableEntityError( + _response.error.body as ElevenLabs.HttpValidationError + ); + default: + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ElevenLabsTimeoutError( + "Timeout exceeded when calling PATCH /v1/convai/phone-numbers/{phone_number_id}." + ); + case "unknown": + throw new errors.ElevenLabsError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Retrieve all Phone Numbers + * + * @param {ConversationalAi.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link ElevenLabs.UnprocessableEntityError} + * + * @example + * await client.conversationalAi.getPhoneNumbers() + */ + public async getPhoneNumbers( + requestOptions?: ConversationalAi.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ElevenLabsEnvironment.Production, + "v1/convai/phone-numbers/" + ), + method: "GET", + headers: { + "xi-api-key": + (await core.Supplier.get(this._options.apiKey)) != null + ? await core.Supplier.get(this._options.apiKey) + : undefined, + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "elevenlabs", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return _response.body as ElevenLabs.GetPhoneNumberResponseModel[]; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new ElevenLabs.UnprocessableEntityError( + _response.error.body as ElevenLabs.HttpValidationError + ); + default: + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ElevenLabsError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/phone-numbers/."); + case "unknown": + throw new errors.ElevenLabsError({ + message: _response.error.errorMessage, + }); + } + } } diff --git a/src/api/resources/conversationalAi/client/requests/BodySendConversationFeedbackV1ConvaiConversationsConversationIdFeedbackPost.ts b/src/api/resources/conversationalAi/client/requests/BodySendConversationFeedbackV1ConvaiConversationsConversationIdFeedbackPost.ts new file mode 100644 index 0000000..a94d2e0 --- /dev/null +++ b/src/api/resources/conversationalAi/client/requests/BodySendConversationFeedbackV1ConvaiConversationsConversationIdFeedbackPost.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as ElevenLabs from "../../../../index"; + +/** + * @example + * { + * feedback: "like" + * } + */ +export interface BodySendConversationFeedbackV1ConvaiConversationsConversationIdFeedbackPost { + /** Either 'like' or 'dislike' to indicate the feedback for the conversation. */ + feedback: ElevenLabs.UserFeedbackScore; +} diff --git a/src/api/resources/conversationalAi/client/requests/ConversationalAiGetWidgetRequest.ts b/src/api/resources/conversationalAi/client/requests/ConversationalAiGetAgentWidgetRequest.ts similarity index 84% rename from src/api/resources/conversationalAi/client/requests/ConversationalAiGetWidgetRequest.ts rename to src/api/resources/conversationalAi/client/requests/ConversationalAiGetAgentWidgetRequest.ts index 992fe31..1afe360 100644 --- a/src/api/resources/conversationalAi/client/requests/ConversationalAiGetWidgetRequest.ts +++ b/src/api/resources/conversationalAi/client/requests/ConversationalAiGetAgentWidgetRequest.ts @@ -6,7 +6,7 @@ * @example * {} */ -export interface ConversationalAiGetWidgetRequest { +export interface ConversationalAiGetAgentWidgetRequest { /** * An expiring token that enables a conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint */ diff --git a/src/api/resources/conversationalAi/client/requests/CreatePhoneNumberRequest.ts b/src/api/resources/conversationalAi/client/requests/CreatePhoneNumberRequest.ts new file mode 100644 index 0000000..1e681d6 --- /dev/null +++ b/src/api/resources/conversationalAi/client/requests/CreatePhoneNumberRequest.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * phone_number: "phone_number", + * provider: "twilio", + * label: "label", + * sid: "sid", + * token: "token" + * } + */ +export interface CreatePhoneNumberRequest { + /** Phone number */ + phone_number: string; + /** Label for the phone number */ + label: string; + /** Twilio Account SID */ + sid: string; + /** Twilio Token */ + token: string; +} diff --git a/src/api/resources/conversationalAi/client/requests/UpdatePhoneNumberRequest.ts b/src/api/resources/conversationalAi/client/requests/UpdatePhoneNumberRequest.ts new file mode 100644 index 0000000..085f485 --- /dev/null +++ b/src/api/resources/conversationalAi/client/requests/UpdatePhoneNumberRequest.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface UpdatePhoneNumberRequest { + agent_id?: string; +} diff --git a/src/api/resources/conversationalAi/client/requests/index.ts b/src/api/resources/conversationalAi/client/requests/index.ts index 9a7dd27..8bb9ab1 100644 --- a/src/api/resources/conversationalAi/client/requests/index.ts +++ b/src/api/resources/conversationalAi/client/requests/index.ts @@ -1,9 +1,12 @@ export { type ConversationalAiGetSignedUrlRequest } from "./ConversationalAiGetSignedUrlRequest"; export { type BodyCreateAgentV1ConvaiAgentsCreatePost } from "./BodyCreateAgentV1ConvaiAgentsCreatePost"; export { type BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatch } from "./BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatch"; -export { type ConversationalAiGetWidgetRequest } from "./ConversationalAiGetWidgetRequest"; +export { type ConversationalAiGetAgentWidgetRequest } from "./ConversationalAiGetAgentWidgetRequest"; export { type BodyPostAgentAvatarV1ConvaiAgentsAgentIdAvatarPost } from "./BodyPostAgentAvatarV1ConvaiAgentsAgentIdAvatarPost"; export { type BodyAddASecretToTheAgentWhichCanBeReferencedInToolCallsV1ConvaiAgentsAgentIdAddSecretPost } from "./BodyAddASecretToTheAgentWhichCanBeReferencedInToolCallsV1ConvaiAgentsAgentIdAddSecretPost"; export { type BodyAddToAgentSKnowledgeBaseV1ConvaiAgentsAgentIdAddToKnowledgeBasePost } from "./BodyAddToAgentSKnowledgeBaseV1ConvaiAgentsAgentIdAddToKnowledgeBasePost"; export { type ConversationalAiGetAgentsRequest } from "./ConversationalAiGetAgentsRequest"; export { type ConversationalAiGetConversationsRequest } from "./ConversationalAiGetConversationsRequest"; +export { type BodySendConversationFeedbackV1ConvaiConversationsConversationIdFeedbackPost } from "./BodySendConversationFeedbackV1ConvaiConversationsConversationIdFeedbackPost"; +export { type CreatePhoneNumberRequest } from "./CreatePhoneNumberRequest"; +export { type UpdatePhoneNumberRequest } from "./UpdatePhoneNumberRequest"; diff --git a/src/api/resources/dubbing/client/Client.ts b/src/api/resources/dubbing/client/Client.ts index 77a908a..35ffce3 100644 --- a/src/api/resources/dubbing/client/Client.ts +++ b/src/api/resources/dubbing/client/Client.ts @@ -110,8 +110,8 @@ export class Dubbing { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, @@ -185,8 +185,8 @@ export class Dubbing { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -255,8 +255,8 @@ export class Dubbing { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -324,8 +324,8 @@ export class Dubbing { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -377,7 +377,7 @@ export class Dubbing { * * @param {string} dubbingId - ID of the dubbing project. * @param {string} languageCode - ID of the language. - * @param {ElevenLabs.GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequest} request + * @param {ElevenLabs.DubbingGetTranscriptForDubRequest} request * @param {Dubbing.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link ElevenLabs.UnprocessableEntityError} @@ -388,7 +388,7 @@ export class Dubbing { public async getTranscriptForDub( dubbingId: string, languageCode: string, - request: ElevenLabs.GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequest = {}, + request: ElevenLabs.DubbingGetTranscriptForDubRequest = {}, requestOptions?: Dubbing.RequestOptions ): Promise { const { format_type: formatType } = request; @@ -410,8 +410,8 @@ export class Dubbing { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/dubbing/client/requests/GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequest.ts b/src/api/resources/dubbing/client/requests/DubbingGetTranscriptForDubRequest.ts similarity index 54% rename from src/api/resources/dubbing/client/requests/GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequest.ts rename to src/api/resources/dubbing/client/requests/DubbingGetTranscriptForDubRequest.ts index db1a153..fa22a77 100644 --- a/src/api/resources/dubbing/client/requests/GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequest.ts +++ b/src/api/resources/dubbing/client/requests/DubbingGetTranscriptForDubRequest.ts @@ -8,9 +8,9 @@ import * as ElevenLabs from "../../../../index"; * @example * {} */ -export interface GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequest { +export interface DubbingGetTranscriptForDubRequest { /** * Format to use for the subtitle file, either 'srt' or 'webvtt' */ - format_type?: ElevenLabs.GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequestFormatType; + format_type?: ElevenLabs.DubbingGetTranscriptForDubRequestFormatType; } diff --git a/src/api/resources/dubbing/client/requests/index.ts b/src/api/resources/dubbing/client/requests/index.ts index fc997df..0033a73 100644 --- a/src/api/resources/dubbing/client/requests/index.ts +++ b/src/api/resources/dubbing/client/requests/index.ts @@ -1,2 +1,2 @@ export { type BodyDubAVideoOrAnAudioFileV1DubbingPost } from "./BodyDubAVideoOrAnAudioFileV1DubbingPost"; -export { type GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequest } from "./GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequest"; +export { type DubbingGetTranscriptForDubRequest } from "./DubbingGetTranscriptForDubRequest"; diff --git a/src/api/resources/dubbing/types/DubbingGetTranscriptForDubRequestFormatType.ts b/src/api/resources/dubbing/types/DubbingGetTranscriptForDubRequestFormatType.ts new file mode 100644 index 0000000..be5a2f2 --- /dev/null +++ b/src/api/resources/dubbing/types/DubbingGetTranscriptForDubRequestFormatType.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Format to use for the subtitle file, either 'srt' or 'webvtt' + */ +export type DubbingGetTranscriptForDubRequestFormatType = "srt" | "webvtt"; +export const DubbingGetTranscriptForDubRequestFormatType = { + Srt: "srt", + Webvtt: "webvtt", +} as const; diff --git a/src/api/resources/dubbing/types/GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequestFormatType.ts b/src/api/resources/dubbing/types/GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequestFormatType.ts deleted file mode 100644 index 845477e..0000000 --- a/src/api/resources/dubbing/types/GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequestFormatType.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * Format to use for the subtitle file, either 'srt' or 'webvtt' - */ -export type GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequestFormatType = "srt" | "webvtt"; -export const GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequestFormatType = { - Srt: "srt", - Webvtt: "webvtt", -} as const; diff --git a/src/api/resources/dubbing/types/index.ts b/src/api/resources/dubbing/types/index.ts index 07e8929..53836ab 100644 --- a/src/api/resources/dubbing/types/index.ts +++ b/src/api/resources/dubbing/types/index.ts @@ -1 +1 @@ -export * from "./GetTranscriptForDubV1DubbingDubbingIdTranscriptLanguageCodeGetRequestFormatType"; +export * from "./DubbingGetTranscriptForDubRequestFormatType"; diff --git a/src/api/resources/history/client/Client.ts b/src/api/resources/history/client/Client.ts index da1f0db..be6dc50 100644 --- a/src/api/resources/history/client/Client.ts +++ b/src/api/resources/history/client/Client.ts @@ -92,8 +92,8 @@ export class History { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -166,8 +166,8 @@ export class History { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -238,8 +238,8 @@ export class History { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -303,8 +303,8 @@ export class History { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -381,8 +381,8 @@ export class History { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/models/client/Client.ts b/src/api/resources/models/client/Client.ts index 949dc9b..3776b72 100644 --- a/src/api/resources/models/client/Client.ts +++ b/src/api/resources/models/client/Client.ts @@ -59,8 +59,8 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/projects/client/Client.ts b/src/api/resources/projects/client/Client.ts index b51e223..98cd84e 100644 --- a/src/api/resources/projects/client/Client.ts +++ b/src/api/resources/projects/client/Client.ts @@ -60,8 +60,8 @@ export class Projects { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -220,8 +220,8 @@ export class Projects { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, @@ -295,8 +295,8 @@ export class Projects { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -374,8 +374,8 @@ export class Projects { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -447,8 +447,8 @@ export class Projects { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -519,8 +519,8 @@ export class Projects { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -594,8 +594,8 @@ export class Projects { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -664,8 +664,8 @@ export class Projects { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -745,8 +745,8 @@ export class Projects { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -792,86 +792,6 @@ export class Projects { } } - /** - * Creates a new chapter either as blank or from a URL. - * - * @param {string} projectId - The project_id of the project, you can query GET https://api.elevenlabs.io/v1/projects to list all available projects. - * @param {ElevenLabs.BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost} request - * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link ElevenLabs.UnprocessableEntityError} - * - * @example - * await client.projects.addChapterToAProject("21m00Tcm4TlvDq8ikWAM", { - * name: "name" - * }) - */ - public async addChapterToAProject( - projectId: string, - request: ElevenLabs.BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost, - requestOptions?: Projects.RequestOptions - ): Promise { - const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.ElevenLabsEnvironment.Production, - `v1/projects/${encodeURIComponent(projectId)}/chapters/add` - ), - method: "POST", - headers: { - "xi-api-key": - (await core.Supplier.get(this._options.apiKey)) != null - ? await core.Supplier.get(this._options.apiKey) - : undefined, - "X-Fern-Language": "JavaScript", - "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", - "X-Fern-Runtime": core.RUNTIME.type, - "X-Fern-Runtime-Version": core.RUNTIME.version, - ...requestOptions?.headers, - }, - contentType: "application/json", - requestType: "json", - body: request, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return _response.body as ElevenLabs.AddChapterResponseModel; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 422: - throw new ElevenLabs.UnprocessableEntityError( - _response.error.body as ElevenLabs.HttpValidationError - ); - default: - throw new errors.ElevenLabsError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - }); - } - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.ElevenLabsError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - }); - case "timeout": - throw new errors.ElevenLabsTimeoutError( - "Timeout exceeded when calling POST /v1/projects/{project_id}/chapters/add." - ); - case "unknown": - throw new errors.ElevenLabsError({ - message: _response.error.errorMessage, - }); - } - } - /** * Updates the set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does. * @@ -907,8 +827,8 @@ export class Projects { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/projects/client/requests/index.ts b/src/api/resources/projects/client/requests/index.ts index 78a1919..1de168e 100644 --- a/src/api/resources/projects/client/requests/index.ts +++ b/src/api/resources/projects/client/requests/index.ts @@ -1,5 +1,4 @@ export { type BodyAddProjectV1ProjectsAddPost } from "./BodyAddProjectV1ProjectsAddPost"; export { type BodyEditBasicProjectInfoV1ProjectsProjectIdPost } from "./BodyEditBasicProjectInfoV1ProjectsProjectIdPost"; export { type BodyStreamProjectAudioV1ProjectsProjectIdSnapshotsProjectSnapshotIdStreamPost } from "./BodyStreamProjectAudioV1ProjectsProjectIdSnapshotsProjectSnapshotIdStreamPost"; -export { type BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost } from "./BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost"; export { type UpdatePronunciationDictionariesRequest } from "./UpdatePronunciationDictionariesRequest"; diff --git a/src/api/resources/pronunciationDictionary/client/Client.ts b/src/api/resources/pronunciationDictionary/client/Client.ts index 63823c9..095bddf 100644 --- a/src/api/resources/pronunciationDictionary/client/Client.ts +++ b/src/api/resources/pronunciationDictionary/client/Client.ts @@ -77,8 +77,8 @@ export class PronunciationDictionary { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, @@ -136,7 +136,7 @@ export class PronunciationDictionary { * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.pronunciationDictionary.addRulesToThePronunciationDictionary("21m00Tcm4TlvDq8ikWAM", { + * await client.pronunciationDictionary.addRules("21m00Tcm4TlvDq8ikWAM", { * rules: [{ * type: "phoneme", * string_to_replace: "rules", @@ -145,7 +145,7 @@ export class PronunciationDictionary { * }] * }) */ - public async addRulesToThePronunciationDictionary( + public async addRules( pronunciationDictionaryId: string, request: ElevenLabs.PronunciationDictionary, requestOptions?: PronunciationDictionary.RequestOptions @@ -163,8 +163,8 @@ export class PronunciationDictionary { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -221,11 +221,11 @@ export class PronunciationDictionary { * @throws {@link ElevenLabs.UnprocessableEntityError} * * @example - * await client.pronunciationDictionary.removeRulesFromThePronunciationDictionary("21m00Tcm4TlvDq8ikWAM", { + * await client.pronunciationDictionary.removeRules("21m00Tcm4TlvDq8ikWAM", { * rule_strings: ["rule_strings"] * }) */ - public async removeRulesFromThePronunciationDictionary( + public async removeRules( pronunciationDictionaryId: string, request: ElevenLabs.BodyRemoveRulesFromThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdRemoveRulesPost, requestOptions?: PronunciationDictionary.RequestOptions @@ -243,8 +243,8 @@ export class PronunciationDictionary { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -323,8 +323,8 @@ export class PronunciationDictionary { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -399,8 +399,8 @@ export class PronunciationDictionary { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -486,8 +486,8 @@ export class PronunciationDictionary { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/samples/client/Client.ts b/src/api/resources/samples/client/Client.ts index f75d7eb..fb7c934 100644 --- a/src/api/resources/samples/client/Client.ts +++ b/src/api/resources/samples/client/Client.ts @@ -62,8 +62,8 @@ export class Samples { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -131,8 +131,8 @@ export class Samples { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/speechToSpeech/client/Client.ts b/src/api/resources/speechToSpeech/client/Client.ts index 8866959..99f7a88 100644 --- a/src/api/resources/speechToSpeech/client/Client.ts +++ b/src/api/resources/speechToSpeech/client/Client.ts @@ -87,8 +87,8 @@ export class SpeechToSpeech { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, @@ -192,8 +192,8 @@ export class SpeechToSpeech { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, diff --git a/src/api/resources/textToSoundEffects/client/Client.ts b/src/api/resources/textToSoundEffects/client/Client.ts index 070c47b..314ff12 100644 --- a/src/api/resources/textToSoundEffects/client/Client.ts +++ b/src/api/resources/textToSoundEffects/client/Client.ts @@ -54,8 +54,8 @@ export class TextToSoundEffects { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/textToSpeech/client/Client.ts b/src/api/resources/textToSpeech/client/Client.ts index 162d365..e1363ea 100644 --- a/src/api/resources/textToSpeech/client/Client.ts +++ b/src/api/resources/textToSpeech/client/Client.ts @@ -74,8 +74,8 @@ export class TextToSpeech { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -175,8 +175,8 @@ export class TextToSpeech { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -265,8 +265,8 @@ export class TextToSpeech { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -355,8 +355,8 @@ export class TextToSpeech { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/textToVoice/client/Client.ts b/src/api/resources/textToVoice/client/Client.ts index 4612107..51d11c7 100644 --- a/src/api/resources/textToVoice/client/Client.ts +++ b/src/api/resources/textToVoice/client/Client.ts @@ -69,8 +69,8 @@ export class TextToVoice { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -150,8 +150,8 @@ export class TextToVoice { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/usage/client/Client.ts b/src/api/resources/usage/client/Client.ts index cb42219..23ecf27 100644 --- a/src/api/resources/usage/client/Client.ts +++ b/src/api/resources/usage/client/Client.ts @@ -80,8 +80,8 @@ export class Usage { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts index 93df3e9..933d92f 100644 --- a/src/api/resources/user/client/Client.ts +++ b/src/api/resources/user/client/Client.ts @@ -56,8 +56,8 @@ export class User { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -125,8 +125,8 @@ export class User { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/voiceGeneration/client/Client.ts b/src/api/resources/voiceGeneration/client/Client.ts index 15a7524..56e3c74 100644 --- a/src/api/resources/voiceGeneration/client/Client.ts +++ b/src/api/resources/voiceGeneration/client/Client.ts @@ -57,8 +57,8 @@ export class VoiceGeneration { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -118,8 +118,8 @@ export class VoiceGeneration { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -199,8 +199,8 @@ export class VoiceGeneration { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/voices/client/Client.ts b/src/api/resources/voices/client/Client.ts index 160e632..7283a61 100644 --- a/src/api/resources/voices/client/Client.ts +++ b/src/api/resources/voices/client/Client.ts @@ -70,8 +70,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -138,8 +138,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -206,8 +206,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -289,8 +289,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -360,8 +360,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -439,8 +439,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -537,8 +537,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, @@ -637,8 +637,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, @@ -720,8 +720,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -881,8 +881,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -969,8 +969,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, @@ -1044,8 +1044,8 @@ export class Voices { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/workspace/client/Client.ts b/src/api/resources/workspace/client/Client.ts index 21eada1..db4e5de 100644 --- a/src/api/resources/workspace/client/Client.ts +++ b/src/api/resources/workspace/client/Client.ts @@ -62,8 +62,8 @@ export class Workspace { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -140,8 +140,8 @@ export class Workspace { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -216,8 +216,8 @@ export class Workspace { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "0.18.2", - "User-Agent": "elevenlabs/0.18.2", + "X-Fern-SDK-Version": "1.50.0", + "User-Agent": "elevenlabs/1.50.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/types/AgentConfigOverrideConfig.ts b/src/api/types/AgentConfigOverrideConfig.ts new file mode 100644 index 0000000..3b53444 --- /dev/null +++ b/src/api/types/AgentConfigOverrideConfig.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as ElevenLabs from "../index"; + +export interface AgentConfigOverrideConfig { + prompt?: ElevenLabs.PromptAgentOverrideConfig; + first_message?: boolean; + language?: boolean; +} diff --git a/src/api/types/AgentPlatformSettings.ts b/src/api/types/AgentPlatformSettings.ts index f63739b..8127514 100644 --- a/src/api/types/AgentPlatformSettings.ts +++ b/src/api/types/AgentPlatformSettings.ts @@ -9,5 +9,8 @@ export interface AgentPlatformSettings { evaluation?: ElevenLabs.EvaluationSettings; widget?: ElevenLabs.EmbedConfig; data_collection?: Record; + overrides?: ElevenLabs.ConversationInitiationClientDataConfig; ban?: ElevenLabs.AgentBan; + safety?: ElevenLabs.Safety; + privacy?: ElevenLabs.PrivacyConfig; } diff --git a/src/api/types/ConversationConfigClientOverrideConfig.ts b/src/api/types/ConversationConfigClientOverrideConfig.ts new file mode 100644 index 0000000..7fff394 --- /dev/null +++ b/src/api/types/ConversationConfigClientOverrideConfig.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as ElevenLabs from "../index"; + +export interface ConversationConfigClientOverrideConfig { + agent?: ElevenLabs.AgentConfigOverrideConfig; + tts?: ElevenLabs.TtsConversationalConfigOverrideConfig; +} diff --git a/src/api/types/ConversationHistoryFeedbackCommonModel.ts b/src/api/types/ConversationHistoryFeedbackCommonModel.ts new file mode 100644 index 0000000..c56bb4b --- /dev/null +++ b/src/api/types/ConversationHistoryFeedbackCommonModel.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as ElevenLabs from "../index"; + +export interface ConversationHistoryFeedbackCommonModel { + overall_score?: ElevenLabs.UserFeedbackScore; + likes?: number; + dislikes?: number; +} diff --git a/src/api/types/ConversationHistoryMetadataCommonModel.ts b/src/api/types/ConversationHistoryMetadataCommonModel.ts index 18913fe..67d4690 100644 --- a/src/api/types/ConversationHistoryMetadataCommonModel.ts +++ b/src/api/types/ConversationHistoryMetadataCommonModel.ts @@ -8,6 +8,7 @@ export interface ConversationHistoryMetadataCommonModel { start_time_unix_secs: number; call_duration_secs: number; cost?: number; + feedback?: ElevenLabs.ConversationHistoryFeedbackCommonModel; authorization_method?: ElevenLabs.AuthorizationMethod; charging?: ElevenLabs.ConversationChargingCommonModel; } diff --git a/src/api/types/ConversationHistoryTranscriptCommonModel.ts b/src/api/types/ConversationHistoryTranscriptCommonModel.ts index 49c59e4..c7fb903 100644 --- a/src/api/types/ConversationHistoryTranscriptCommonModel.ts +++ b/src/api/types/ConversationHistoryTranscriptCommonModel.ts @@ -9,5 +9,7 @@ export interface ConversationHistoryTranscriptCommonModel { message?: string; tool_calls?: ElevenLabs.ConversationHistoryTranscriptToolCallCommonModel[]; tool_results?: ElevenLabs.ConversationHistoryTranscriptToolResultCommonModel[]; + feedback?: ElevenLabs.UserFeedback; time_in_call_secs: number; + conversation_turn_metrics?: Record; } diff --git a/src/api/types/ConversationInitiationClientDataConfig.ts b/src/api/types/ConversationInitiationClientDataConfig.ts new file mode 100644 index 0000000..faf020f --- /dev/null +++ b/src/api/types/ConversationInitiationClientDataConfig.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as ElevenLabs from "../index"; + +export interface ConversationInitiationClientDataConfig { + conversation_config_override?: ElevenLabs.ConversationConfigClientOverrideConfig; + custom_llm_extra_body?: boolean; +} diff --git a/src/api/types/CreatePhoneNumberResponseModel.ts b/src/api/types/CreatePhoneNumberResponseModel.ts new file mode 100644 index 0000000..d65799c --- /dev/null +++ b/src/api/types/CreatePhoneNumberResponseModel.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CreatePhoneNumberResponseModel { + /** Phone entity id */ + phone_number_id: string; +} diff --git a/src/api/types/EmbedConfig.ts b/src/api/types/EmbedConfig.ts index e42c3be..be65d34 100644 --- a/src/api/types/EmbedConfig.ts +++ b/src/api/types/EmbedConfig.ts @@ -7,6 +7,7 @@ import * as ElevenLabs from "../index"; export interface EmbedConfig { variant?: ElevenLabs.EmbedVariant; avatar?: ElevenLabs.EmbedConfigAvatar; + feedback_mode?: ElevenLabs.WidgetFeedbackMode; custom_avatar_path?: string; bg_color?: string; text_color?: string; diff --git a/src/api/types/GetPhoneNumberResponseModel.ts b/src/api/types/GetPhoneNumberResponseModel.ts new file mode 100644 index 0000000..5fc8bb0 --- /dev/null +++ b/src/api/types/GetPhoneNumberResponseModel.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as ElevenLabs from "../index"; + +export interface GetPhoneNumberResponseModel { + /** Phone number */ + phone_number: string; + /** Phone provider */ + provider: ElevenLabs.TelephonyProvider; + /** Label for the phone number */ + label: string; + phone_number_id: string; + assigned_agent?: ElevenLabs.PhoneNumberAgentInfo; +} diff --git a/src/api/types/ModerationStatusResponseModel.ts b/src/api/types/ModerationStatusResponseModel.ts new file mode 100644 index 0000000..7f4414f --- /dev/null +++ b/src/api/types/ModerationStatusResponseModel.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as ElevenLabs from "../index"; + +export interface ModerationStatusResponseModel { + is_in_probation: boolean; + enterprise_check_nogo_voice: boolean; + enterprise_check_block_nogo_voice: boolean; + never_live_moderate: boolean; + nogo_voice_similar_voice_upload_count: number; + enterprise_background_moderation_enabled: boolean; + safety_status: ElevenLabs.ModerationStatusResponseModelSafetyStatus; + warning_status: ElevenLabs.ModerationStatusResponseModelWarningStatus; +} diff --git a/src/api/types/ModerationStatusResponseModelSafetyStatus.ts b/src/api/types/ModerationStatusResponseModelSafetyStatus.ts new file mode 100644 index 0000000..becca6e --- /dev/null +++ b/src/api/types/ModerationStatusResponseModelSafetyStatus.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ModerationStatusResponseModelSafetyStatus = "appeal_approved" | "appeal_denied"; +export const ModerationStatusResponseModelSafetyStatus = { + AppealApproved: "appeal_approved", + AppealDenied: "appeal_denied", +} as const; diff --git a/src/api/types/ModerationStatusResponseModelWarningStatus.ts b/src/api/types/ModerationStatusResponseModelWarningStatus.ts new file mode 100644 index 0000000..0cc53ca --- /dev/null +++ b/src/api/types/ModerationStatusResponseModelWarningStatus.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ModerationStatusResponseModelWarningStatus = "warning" | "warning_cleared"; +export const ModerationStatusResponseModelWarningStatus = { + Warning: "warning", + WarningCleared: "warning_cleared", +} as const; diff --git a/src/api/types/PhoneNumberAgentInfo.ts b/src/api/types/PhoneNumberAgentInfo.ts new file mode 100644 index 0000000..af22ac9 --- /dev/null +++ b/src/api/types/PhoneNumberAgentInfo.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface PhoneNumberAgentInfo { + agent_id: string; + agent_name: string; +} diff --git a/src/api/types/PrivacyConfig.ts b/src/api/types/PrivacyConfig.ts new file mode 100644 index 0000000..64d674d --- /dev/null +++ b/src/api/types/PrivacyConfig.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface PrivacyConfig { + record_voice?: boolean; +} diff --git a/src/api/types/ProjectCreationMetaResponseModel.ts b/src/api/types/ProjectCreationMetaResponseModel.ts new file mode 100644 index 0000000..181ff8d --- /dev/null +++ b/src/api/types/ProjectCreationMetaResponseModel.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as ElevenLabs from "../index"; + +export interface ProjectCreationMetaResponseModel { + creation_progress: number; + status: ElevenLabs.ProjectCreationMetaResponseModelStatus; + type: ElevenLabs.ProjectCreationMetaResponseModelType; +} diff --git a/src/api/types/ProjectCreationMetaResponseModelStatus.ts b/src/api/types/ProjectCreationMetaResponseModelStatus.ts new file mode 100644 index 0000000..79f8b97 --- /dev/null +++ b/src/api/types/ProjectCreationMetaResponseModelStatus.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ProjectCreationMetaResponseModelStatus = "pending" | "creating" | "finished" | "failed"; +export const ProjectCreationMetaResponseModelStatus = { + Pending: "pending", + Creating: "creating", + Finished: "finished", + Failed: "failed", +} as const; diff --git a/src/api/types/ProjectCreationMetaResponseModelType.ts b/src/api/types/ProjectCreationMetaResponseModelType.ts new file mode 100644 index 0000000..afb619f --- /dev/null +++ b/src/api/types/ProjectCreationMetaResponseModelType.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ProjectCreationMetaResponseModelType = "blank" | "generate_podcast"; +export const ProjectCreationMetaResponseModelType = { + Blank: "blank", + GeneratePodcast: "generate_podcast", +} as const; diff --git a/src/api/types/ProjectExtendedResponseModel.ts b/src/api/types/ProjectExtendedResponseModel.ts index 4380595..849a091 100644 --- a/src/api/types/ProjectExtendedResponseModel.ts +++ b/src/api/types/ProjectExtendedResponseModel.ts @@ -30,6 +30,7 @@ export interface ProjectExtendedResponseModel { fiction?: ElevenLabs.ProjectExtendedResponseModelFiction; quality_check_on: boolean; quality_check_on_when_bulk_convert: boolean; + creation_meta?: ElevenLabs.ProjectCreationMetaResponseModel; quality_preset: ElevenLabs.ProjectExtendedResponseModelQualityPreset; chapters: ElevenLabs.ChapterResponse[]; pronunciation_dictionary_versions: ElevenLabs.PronunciationDictionaryVersionResponseModel[]; diff --git a/src/api/types/ProjectResponse.ts b/src/api/types/ProjectResponse.ts index ad29b98..c9f27a8 100644 --- a/src/api/types/ProjectResponse.ts +++ b/src/api/types/ProjectResponse.ts @@ -30,4 +30,5 @@ export interface ProjectResponse { fiction?: ElevenLabs.ProjectResponseModelFiction; quality_check_on: boolean; quality_check_on_when_bulk_convert: boolean; + creation_meta?: ElevenLabs.ProjectCreationMetaResponseModel; } diff --git a/src/api/types/ProjectState.ts b/src/api/types/ProjectState.ts index 27ac3f5..c6eb0de 100644 --- a/src/api/types/ProjectState.ts +++ b/src/api/types/ProjectState.ts @@ -2,8 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -export type ProjectState = "default" | "converting" | "in_queue"; +export type ProjectState = "creating" | "default" | "converting" | "in_queue"; export const ProjectState = { + Creating: "creating", Default: "default", Converting: "converting", InQueue: "in_queue", diff --git a/src/api/types/PromptAgentOverrideConfig.ts b/src/api/types/PromptAgentOverrideConfig.ts new file mode 100644 index 0000000..a77eadb --- /dev/null +++ b/src/api/types/PromptAgentOverrideConfig.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface PromptAgentOverrideConfig { + prompt?: boolean; +} diff --git a/src/api/types/Safety.ts b/src/api/types/Safety.ts new file mode 100644 index 0000000..adc4a02 --- /dev/null +++ b/src/api/types/Safety.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as ElevenLabs from "../index"; + +/** + * Safety object that has the information of safety evaluations based on used voice. + */ +export interface Safety { + ivc?: ElevenLabs.SafetyEvaluation; + non_ivc?: ElevenLabs.SafetyEvaluation; +} diff --git a/src/api/types/SafetyEvaluation.ts b/src/api/types/SafetyEvaluation.ts new file mode 100644 index 0000000..9fd8c49 --- /dev/null +++ b/src/api/types/SafetyEvaluation.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as ElevenLabs from "../index"; + +/** + * Safety evaluation of the agent. Prompt and first message is taken into account. + * The unsafe reason is provided from the evaluation + */ +export interface SafetyEvaluation { + is_unsafe?: boolean; + llm_reason?: string; + safety_prompt_version?: number; + matched_rule_id?: ElevenLabs.SafetyRule[]; +} diff --git a/src/api/types/SafetyRule.ts b/src/api/types/SafetyRule.ts new file mode 100644 index 0000000..00bd537 --- /dev/null +++ b/src/api/types/SafetyRule.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * An enumeration. + */ +export type SafetyRule = + | "sexual_minors" + | "forget_moderation" + | "extremism" + | "scam_fraud" + | "political" + | "self_harm" + | "illegal_distribution_medical" + | "sexual_adults" + | "unknown"; +export const SafetyRule = { + SexualMinors: "sexual_minors", + ForgetModeration: "forget_moderation", + Extremism: "extremism", + ScamFraud: "scam_fraud", + Political: "political", + SelfHarm: "self_harm", + IllegalDistributionMedical: "illegal_distribution_medical", + SexualAdults: "sexual_adults", + Unknown: "unknown", +} as const; diff --git a/src/api/types/TelephonyProvider.ts b/src/api/types/TelephonyProvider.ts new file mode 100644 index 0000000..9c3d3d2 --- /dev/null +++ b/src/api/types/TelephonyProvider.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * An enumeration. + */ +export type TelephonyProvider = "twilio"; diff --git a/src/api/types/TtsConversationalConfigOverrideConfig.ts b/src/api/types/TtsConversationalConfigOverrideConfig.ts new file mode 100644 index 0000000..c6e145e --- /dev/null +++ b/src/api/types/TtsConversationalConfigOverrideConfig.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface TtsConversationalConfigOverrideConfig { + voice_id?: boolean; +} diff --git a/src/api/types/User.ts b/src/api/types/User.ts index 0dbf293..19084a6 100644 --- a/src/api/types/User.ts +++ b/src/api/types/User.ts @@ -6,6 +6,7 @@ import * as ElevenLabs from "../index"; export interface User { subscription: ElevenLabs.SubscriptionResponse; + subscription_extras?: unknown; is_new_user: boolean; xi_api_key: string; can_use_delayed_payment_methods: boolean; diff --git a/src/api/types/UserFeedback.ts b/src/api/types/UserFeedback.ts new file mode 100644 index 0000000..2d52a0a --- /dev/null +++ b/src/api/types/UserFeedback.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as ElevenLabs from "../index"; + +export interface UserFeedback { + score: ElevenLabs.UserFeedbackScore; + time_in_call_secs: number; +} diff --git a/src/api/types/UserFeedbackScore.ts b/src/api/types/UserFeedbackScore.ts new file mode 100644 index 0000000..294bd92 --- /dev/null +++ b/src/api/types/UserFeedbackScore.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * An enumeration. + */ +export type UserFeedbackScore = "like" | "dislike"; +export const UserFeedbackScore = { + Like: "like", + Dislike: "dislike", +} as const; diff --git a/src/api/types/WidgetFeedbackMode.ts b/src/api/types/WidgetFeedbackMode.ts new file mode 100644 index 0000000..bddfa6a --- /dev/null +++ b/src/api/types/WidgetFeedbackMode.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * An enumeration. + */ +export type WidgetFeedbackMode = "none" | "during" | "end"; +export const WidgetFeedbackMode = { + None: "none", + During: "during", + End: "end", +} as const; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 772d8ff..1b054bc 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -13,6 +13,7 @@ export * from "./AddVoiceResponseModel"; export * from "./AgentBan"; export * from "./AgentConfig"; export * from "./AgentConfigOverride"; +export * from "./AgentConfigOverrideConfig"; export * from "./AgentMetadataResponseModel"; export * from "./AgentPlatformSettings"; export * from "./AgentSummaryResponseModel"; @@ -37,14 +38,17 @@ export * from "./ConvAiStoredSecretConfig"; export * from "./ConversationChargingCommonModel"; export * from "./ConversationConfig"; export * from "./ConversationConfigClientOverride"; +export * from "./ConversationConfigClientOverrideConfig"; export * from "./ConversationHistoryAnalysisCommonModel"; export * from "./ConversationHistoryEvaluationCriteriaResultCommonModel"; +export * from "./ConversationHistoryFeedbackCommonModel"; export * from "./ConversationHistoryMetadataCommonModel"; export * from "./ConversationHistoryTranscriptCommonModelRole"; export * from "./ConversationHistoryTranscriptCommonModel"; export * from "./ConversationHistoryTranscriptToolCallCommonModel"; export * from "./ConversationHistoryTranscriptToolResultCommonModel"; export * from "./ConversationInitiationClientData"; +export * from "./ConversationInitiationClientDataConfig"; export * from "./ConversationSignedUrlResponseModel"; export * from "./ConversationSummaryResponseModelStatus"; export * from "./ConversationSummaryResponseModel"; @@ -52,6 +56,7 @@ export * from "./ConversationTokenDbModel"; export * from "./ConversationTokenPurpose"; export * from "./ConversationalConfig"; export * from "./CreateAgentResponseModel"; +export * from "./CreatePhoneNumberResponseModel"; export * from "./CustomLlm"; export * from "./DataCollectionResultCommonModel"; export * from "./DoDubbingResponse"; @@ -81,6 +86,7 @@ export * from "./GetConversationsPageResponseModel"; export * from "./GetKnowledgeBaseReponseModelType"; export * from "./GetKnowledgeBaseReponseModel"; export * from "./GetLibraryVoicesResponse"; +export * from "./GetPhoneNumberResponseModel"; export * from "./GetProjectsResponse"; export * from "./GetPronunciationDictionariesMetadataResponseModel"; export * from "./GetPronunciationDictionaryMetadataResponse"; @@ -104,11 +110,19 @@ export * from "./ManualVerificationResponse"; export * from "./ModelRatesResponseModel"; export * from "./ModelResponseModelConcurrencyGroup"; export * from "./Model"; +export * from "./ModerationStatusResponseModelSafetyStatus"; +export * from "./ModerationStatusResponseModelWarningStatus"; +export * from "./ModerationStatusResponseModel"; export * from "./ObjectJsonSchemaPropertyPropertiesValue"; export * from "./ObjectJsonSchemaProperty"; export * from "./OrbAvatar"; +export * from "./PhoneNumberAgentInfo"; export * from "./PostAgentAvatarResponseModel"; +export * from "./PrivacyConfig"; export * from "./ProfilePageResponseModel"; +export * from "./ProjectCreationMetaResponseModelStatus"; +export * from "./ProjectCreationMetaResponseModelType"; +export * from "./ProjectCreationMetaResponseModel"; export * from "./ProjectExtendedResponseModelTargetAudience"; export * from "./ProjectState"; export * from "./ProjectExtendedResponseModelAccessLevel"; @@ -127,6 +141,7 @@ export * from "./ProjectSnapshotsResponse"; export * from "./PromptAgentToolsItem"; export * from "./PromptAgent"; export * from "./PromptAgentOverride"; +export * from "./PromptAgentOverrideConfig"; export * from "./PromptEvaluationCriteria"; export * from "./PronunciationDictionaryAliasRuleRequestModel"; export * from "./PronunciationDictionaryPhonemeRuleRequestModel"; @@ -138,6 +153,9 @@ export * from "./ReaderResourceResponseModelResourceType"; export * from "./ReaderResourceResponseModel"; export * from "./RecordingResponse"; export * from "./RemovePronunciationDictionaryRulesResponseModel"; +export * from "./Safety"; +export * from "./SafetyEvaluation"; +export * from "./SafetyRule"; export * from "./VoiceSample"; export * from "./SpeechHistoryItemResponseModelVoiceCategory"; export * from "./SpeechHistoryItemResponseModelSource"; @@ -148,13 +166,17 @@ export * from "./SubscriptionResponseModelCharacterRefreshPeriod"; export * from "./SubscriptionResponse"; export * from "./TtsConversationalConfig"; export * from "./TtsConversationalConfigOverride"; +export * from "./TtsConversationalConfigOverrideConfig"; export * from "./TtsConversationalModel"; export * from "./TtsOptimizeStreamingLatency"; export * from "./TtsOutputFormat"; +export * from "./TelephonyProvider"; export * from "./TurnConfig"; export * from "./TurnMode"; export * from "./UrlAvatar"; export * from "./UsageCharactersResponseModel"; +export * from "./UserFeedback"; +export * from "./UserFeedbackScore"; export * from "./User"; export * from "./ValidationErrorLocItem"; export * from "./ValidationError"; @@ -177,6 +199,7 @@ export * from "./WebhookToolApiSchemaConfigMethod"; export * from "./WebhookToolApiSchemaConfigRequestHeadersValue"; export * from "./WebhookToolApiSchemaConfig"; export * from "./WebhookToolConfig"; +export * from "./WidgetFeedbackMode"; export * from "./AudioNativeGetEmbedCodeResponseModel"; export * from "./HistoryItem"; export * from "./History"; diff --git a/src/core/streaming-fetcher/Stream.ts b/src/core/streaming-fetcher/Stream.ts index dc553c7..dccdb79 100644 --- a/src/core/streaming-fetcher/Stream.ts +++ b/src/core/streaming-fetcher/Stream.ts @@ -91,15 +91,8 @@ export class Stream implements AsyncIterable { } // Otherwise, yield message from the prefix to the terminator - - // (Louis custom fix do not override) Trim whitespace and check if line is not empty - // Reason: ElevenLabs occasionally returns empty chunks - const trimmedLine = line.trim(); - if (trimmedLine) { - const message = await this.parse(JSON.parse(trimmedLine)); - yield message; - } - + const message = await this.parse(JSON.parse(line)); + yield message; prefixSeen = false; } } diff --git a/src/version.ts b/src/version.ts index b2e3b4d..cff03e0 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "0.18.2"; +export const SDK_VERSION = "1.50.0"; diff --git a/yarn.lock b/yarn.lock index 73371f4..d46c90f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1752,10 +1752,10 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== -is-core-module@^2.13.0: - version "2.15.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37" - integrity sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ== +is-core-module@^2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.0.tgz#6c01ffdd5e33c49c1d2abfa93334a85cb56bd81c" + integrity sha512-urTSINYfAYgcbLb0yDQ6egFm6h3Mo1DcF9EkyXSRjjzdHbsulg01qhwWuXdOoUBuTkbQ80KDboXa0vFJ+BDH+g== dependencies: hasown "^2.0.2" @@ -2675,11 +2675,11 @@ resolve.exports@^2.0.0: integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== resolve@^1.20.0: - version "1.22.8" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" - integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== + version "1.22.9" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.9.tgz#6da76e4cdc57181fa4471231400e8851d0a924f3" + integrity sha512-QxrmX1DzraFIi9PxdG5VkRfRwIgjwyud+z/iBwfRRrVmHc+P9Q7u2lSSpQ6bjr2gy5lrqIiU9vb6iAeGf2400A== dependencies: - is-core-module "^2.13.0" + is-core-module "^2.16.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0"