@elevenlabs/elevenlabs-js 2.10.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +160 -0
- package/Client.js +687 -2
- package/api/client/index.d.ts +1 -0
- package/api/client/index.js +17 -0
- package/api/client/requests/CreateUnitTestRequest.d.ts +37 -0
- package/api/client/requests/ListChatResponseTestsRouteRequest.d.ts +21 -0
- package/api/client/requests/ListTestsByIdsRequestModel.d.ts +13 -0
- package/api/client/requests/ListTestsByIdsRequestModel.js +5 -0
- package/api/client/requests/ResubmitTestsRequestModel.d.ts +19 -0
- package/api/client/requests/ResubmitTestsRequestModel.js +5 -0
- package/api/client/requests/RunAgentTestsRequestModel.d.ts +18 -0
- package/api/client/requests/RunAgentTestsRequestModel.js +5 -0
- package/api/client/requests/UpdateUnitTestRequest.d.ts +37 -0
- package/api/client/requests/UpdateUnitTestRequest.js +5 -0
- package/api/client/requests/index.d.ts +6 -0
- package/api/client/requests/index.js +2 -0
- package/api/index.d.ts +1 -0
- package/api/index.js +1 -0
- package/api/resources/conversationalAi/resources/tools/client/Client.d.ts +1 -1
- package/api/resources/conversationalAi/resources/tools/client/Client.js +1 -1
- package/api/resources/music/client/Client.d.ts +6 -0
- package/api/resources/music/client/Client.js +67 -0
- package/api/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +5 -1
- package/api/resources/music/client/requests/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js +5 -0
- package/api/resources/music/client/requests/index.d.ts +1 -0
- package/api/resources/music/types/MusicComposeDetailedRequestOutputFormat.d.ts +28 -0
- package/api/resources/music/types/MusicComposeDetailedRequestOutputFormat.js +27 -0
- package/api/resources/music/types/index.d.ts +1 -0
- package/api/resources/music/types/index.js +1 -0
- package/api/resources/pronunciationDictionaries/client/Client.d.ts +20 -6
- package/api/resources/pronunciationDictionaries/client/Client.js +90 -16
- package/api/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.d.ts +13 -0
- package/api/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.js +5 -0
- package/api/resources/pronunciationDictionaries/client/requests/index.d.ts +1 -0
- package/api/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.d.ts +4 -1
- package/api/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.js +3 -0
- package/api/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.d.ts +4 -1
- package/api/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.js +3 -0
- package/api/resources/speechToText/client/requests/BodySpeechToTextV1SpeechToTextPost.d.ts +1 -1
- package/api/resources/textToDialogue/client/Client.d.ts +2 -2
- package/api/resources/textToDialogue/client/Client.js +2 -2
- package/api/resources/textToSoundEffects/client/requests/CreateSoundEffectRequest.d.ts +1 -1
- package/api/types/AdhocAgentConfigOverrideForTestRequestModel.d.ts +8 -0
- package/api/types/AdhocAgentConfigOverrideForTestRequestModel.js +5 -0
- package/api/types/AgentFailureResponseExample.d.ts +7 -0
- package/api/types/AgentFailureResponseExample.js +5 -0
- package/api/types/AgentSuccessfulResponseExample.d.ts +7 -0
- package/api/types/AgentSuccessfulResponseExample.js +5 -0
- package/api/types/AgentTestingSettings.d.ts +2 -1
- package/api/types/AttachedTestModel.d.ts +6 -0
- package/api/types/AttachedTestModel.js +5 -0
- package/api/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.d.ts +4 -1
- package/api/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +4 -0
- package/api/types/CreateUnitTestRequestDynamicVariablesValue.js +5 -0
- package/api/types/CreateUnitTestResponseModel.d.ts +6 -0
- package/api/types/CreateUnitTestResponseModel.js +5 -0
- package/api/types/DetailedMusicResponse.d.ts +13 -0
- package/api/types/DetailedMusicResponse.js +5 -0
- package/api/types/ExactParameterEvaluationStrategy.d.ts +7 -0
- package/api/types/ExactParameterEvaluationStrategy.js +5 -0
- package/api/types/ExtendedSubscriptionResponseModelPendingChange.d.ts +8 -0
- package/api/types/ExtendedSubscriptionResponseModelPendingChange.js +5 -0
- package/api/types/FeaturesUsageCommonModel.d.ts +1 -0
- package/api/types/GetTestSuiteInvocationResponseModel.d.ts +9 -0
- package/api/types/GetTestSuiteInvocationResponseModel.js +5 -0
- package/api/types/GetTestsPageResponseModel.d.ts +9 -0
- package/api/types/GetTestsPageResponseModel.js +5 -0
- package/api/types/GetTestsSummariesByIdsResponseModel.d.ts +8 -0
- package/api/types/GetTestsSummariesByIdsResponseModel.js +5 -0
- package/api/types/GetUnitTestResponseModel.d.ts +19 -0
- package/api/types/GetUnitTestResponseModel.js +5 -0
- package/api/types/GetUnitTestResponseModelDynamicVariablesValue.d.ts +4 -0
- package/api/types/GetUnitTestResponseModelDynamicVariablesValue.js +5 -0
- package/api/types/Llm.d.ts +3 -3
- package/api/types/Llm.js +2 -2
- package/api/types/LlmParameterEvaluationStrategy.d.ts +7 -0
- package/api/types/LlmParameterEvaluationStrategy.js +5 -0
- package/api/types/MultipartMusicResponse.d.ts +13 -0
- package/api/types/MultipartMusicResponse.js +5 -0
- package/api/types/PendingCancellationResponseModel.d.ts +8 -0
- package/api/types/PendingCancellationResponseModel.js +5 -0
- package/api/types/PendingSubscriptionSwitchResponseModel.d.ts +11 -0
- package/api/types/PendingSubscriptionSwitchResponseModel.js +5 -0
- package/api/types/PendingSubscriptionSwitchResponseModelNextTier.d.ts +19 -0
- package/api/types/PendingSubscriptionSwitchResponseModelNextTier.js +18 -0
- package/api/types/ReferencedToolCommonModel.d.ts +13 -0
- package/api/types/ReferencedToolCommonModel.js +5 -0
- package/api/types/RegexParameterEvaluationStrategy.d.ts +7 -0
- package/api/types/RegexParameterEvaluationStrategy.js +5 -0
- package/api/types/SingleTestRunRequestModel.d.ts +7 -0
- package/api/types/SingleTestRunRequestModel.js +5 -0
- package/api/types/SongMetadata.d.ts +15 -0
- package/api/types/SongMetadata.js +5 -0
- package/api/types/Subscription.d.ts +2 -0
- package/api/types/TestConditionRationaleCommonModel.d.ts +12 -0
- package/api/types/TestConditionRationaleCommonModel.js +5 -0
- package/api/types/TestConditionResultCommonModel.d.ts +8 -0
- package/api/types/TestConditionResultCommonModel.js +5 -0
- package/api/types/TestRunStatus.d.ts +9 -0
- package/api/types/TestRunStatus.js +11 -0
- package/api/types/TestToolResultModel.d.ts +7 -0
- package/api/types/TestToolResultModel.js +5 -0
- package/api/types/UnitTestRunResponseModel.d.ts +13 -0
- package/api/types/UnitTestRunResponseModel.js +5 -0
- package/api/types/UnitTestSummaryResponseModel.d.ts +16 -0
- package/api/types/UnitTestSummaryResponseModel.js +5 -0
- package/api/types/UnitTestToolCallEvaluationModelInput.d.ts +10 -0
- package/api/types/UnitTestToolCallEvaluationModelInput.js +5 -0
- package/api/types/UnitTestToolCallEvaluationModelOutput.d.ts +10 -0
- package/api/types/UnitTestToolCallEvaluationModelOutput.js +5 -0
- package/api/types/UnitTestToolCallParameter.d.ts +8 -0
- package/api/types/UnitTestToolCallParameter.js +5 -0
- package/api/types/UnitTestToolCallParameterEval.d.ts +16 -0
- package/api/types/UnitTestToolCallParameterEval.js +5 -0
- package/api/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +4 -0
- package/api/types/UpdateUnitTestRequestDynamicVariablesValue.js +5 -0
- package/api/types/User.d.ts +3 -1
- package/api/types/WebhookAuthMethodType.d.ts +2 -1
- package/api/types/WebhookAuthMethodType.js +1 -0
- package/api/types/WorkflowFeaturesUsageCommonModel.d.ts +8 -0
- package/api/types/WorkflowFeaturesUsageCommonModel.js +5 -0
- package/api/types/WorkspaceApiKeyResponseModelPermissionsItem.d.ts +4 -1
- package/api/types/WorkspaceApiKeyResponseModelPermissionsItem.js +3 -0
- package/api/types/WorkspaceResourceType.d.ts +1 -2
- package/api/types/WorkspaceResourceType.js +0 -1
- package/api/types/index.d.ts +35 -1
- package/api/types/index.js +35 -1
- package/dist/Client.d.ts +160 -0
- package/dist/Client.js +687 -2
- package/dist/api/client/index.d.ts +1 -0
- package/dist/api/client/index.js +17 -0
- package/dist/api/client/requests/CreateUnitTestRequest.d.ts +37 -0
- package/dist/api/client/requests/CreateUnitTestRequest.js +5 -0
- package/dist/api/client/requests/ListChatResponseTestsRouteRequest.d.ts +21 -0
- package/dist/api/client/requests/ListChatResponseTestsRouteRequest.js +5 -0
- package/dist/api/client/requests/ListTestsByIdsRequestModel.d.ts +13 -0
- package/dist/api/client/requests/ListTestsByIdsRequestModel.js +5 -0
- package/dist/api/client/requests/ResubmitTestsRequestModel.d.ts +19 -0
- package/dist/api/client/requests/ResubmitTestsRequestModel.js +5 -0
- package/dist/api/client/requests/RunAgentTestsRequestModel.d.ts +18 -0
- package/dist/api/client/requests/RunAgentTestsRequestModel.js +5 -0
- package/dist/api/client/requests/UpdateUnitTestRequest.d.ts +37 -0
- package/dist/api/client/requests/UpdateUnitTestRequest.js +5 -0
- package/dist/api/client/requests/index.d.ts +6 -0
- package/dist/api/client/requests/index.js +2 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/resources/conversationalAi/resources/tools/client/Client.d.ts +1 -1
- package/dist/api/resources/conversationalAi/resources/tools/client/Client.js +1 -1
- package/dist/api/resources/music/client/Client.d.ts +6 -0
- package/dist/api/resources/music/client/Client.js +67 -0
- package/dist/api/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +5 -1
- package/dist/api/resources/music/client/requests/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js +5 -0
- package/dist/api/resources/music/client/requests/index.d.ts +1 -0
- package/dist/api/resources/music/types/MusicComposeDetailedRequestOutputFormat.d.ts +28 -0
- package/dist/api/resources/music/types/MusicComposeDetailedRequestOutputFormat.js +27 -0
- package/dist/api/resources/music/types/index.d.ts +1 -0
- package/dist/api/resources/music/types/index.js +1 -0
- package/dist/api/resources/pronunciationDictionaries/client/Client.d.ts +20 -6
- package/dist/api/resources/pronunciationDictionaries/client/Client.js +90 -16
- package/dist/api/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.d.ts +13 -0
- package/dist/api/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.js +5 -0
- package/dist/api/resources/pronunciationDictionaries/client/requests/index.d.ts +1 -0
- package/dist/api/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.d.ts +4 -1
- package/dist/api/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.js +3 -0
- package/dist/api/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.d.ts +4 -1
- package/dist/api/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.js +3 -0
- package/dist/api/resources/speechToText/client/requests/BodySpeechToTextV1SpeechToTextPost.d.ts +1 -1
- package/dist/api/resources/textToDialogue/client/Client.d.ts +2 -2
- package/dist/api/resources/textToDialogue/client/Client.js +2 -2
- package/dist/api/resources/textToSoundEffects/client/requests/CreateSoundEffectRequest.d.ts +1 -1
- package/dist/api/types/AdhocAgentConfigOverrideForTestRequestModel.d.ts +8 -0
- package/dist/api/types/AdhocAgentConfigOverrideForTestRequestModel.js +5 -0
- package/dist/api/types/AgentFailureResponseExample.d.ts +7 -0
- package/dist/api/types/AgentFailureResponseExample.js +5 -0
- package/dist/api/types/AgentSuccessfulResponseExample.d.ts +7 -0
- package/dist/api/types/AgentSuccessfulResponseExample.js +5 -0
- package/dist/api/types/AgentTestingSettings.d.ts +2 -1
- package/dist/api/types/AttachedTestModel.d.ts +6 -0
- package/dist/api/types/AttachedTestModel.js +5 -0
- package/dist/api/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.d.ts +4 -1
- package/dist/api/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +4 -0
- package/dist/api/types/CreateUnitTestRequestDynamicVariablesValue.js +5 -0
- package/dist/api/types/CreateUnitTestResponseModel.d.ts +6 -0
- package/dist/api/types/CreateUnitTestResponseModel.js +5 -0
- package/dist/api/types/DetailedMusicResponse.d.ts +13 -0
- package/dist/api/types/DetailedMusicResponse.js +5 -0
- package/dist/api/types/ExactParameterEvaluationStrategy.d.ts +7 -0
- package/dist/api/types/ExactParameterEvaluationStrategy.js +5 -0
- package/dist/api/types/ExtendedSubscriptionResponseModelPendingChange.d.ts +8 -0
- package/dist/api/types/ExtendedSubscriptionResponseModelPendingChange.js +5 -0
- package/dist/api/types/FeaturesUsageCommonModel.d.ts +1 -0
- package/dist/api/types/GetTestSuiteInvocationResponseModel.d.ts +9 -0
- package/dist/api/types/GetTestSuiteInvocationResponseModel.js +5 -0
- package/dist/api/types/GetTestsPageResponseModel.d.ts +9 -0
- package/dist/api/types/GetTestsPageResponseModel.js +5 -0
- package/dist/api/types/GetTestsSummariesByIdsResponseModel.d.ts +8 -0
- package/dist/api/types/GetTestsSummariesByIdsResponseModel.js +5 -0
- package/dist/api/types/GetUnitTestResponseModel.d.ts +19 -0
- package/dist/api/types/GetUnitTestResponseModel.js +5 -0
- package/dist/api/types/GetUnitTestResponseModelDynamicVariablesValue.d.ts +4 -0
- package/dist/api/types/GetUnitTestResponseModelDynamicVariablesValue.js +5 -0
- package/dist/api/types/Llm.d.ts +3 -3
- package/dist/api/types/Llm.js +2 -2
- package/dist/api/types/LlmParameterEvaluationStrategy.d.ts +7 -0
- package/dist/api/types/LlmParameterEvaluationStrategy.js +5 -0
- package/dist/api/types/MultipartMusicResponse.d.ts +13 -0
- package/dist/api/types/MultipartMusicResponse.js +5 -0
- package/dist/api/types/PendingCancellationResponseModel.d.ts +8 -0
- package/dist/api/types/PendingCancellationResponseModel.js +5 -0
- package/dist/api/types/PendingSubscriptionSwitchResponseModel.d.ts +11 -0
- package/dist/api/types/PendingSubscriptionSwitchResponseModel.js +5 -0
- package/dist/api/types/PendingSubscriptionSwitchResponseModelNextTier.d.ts +19 -0
- package/dist/api/types/PendingSubscriptionSwitchResponseModelNextTier.js +18 -0
- package/dist/api/types/ReferencedToolCommonModel.d.ts +13 -0
- package/dist/api/types/ReferencedToolCommonModel.js +5 -0
- package/dist/api/types/RegexParameterEvaluationStrategy.d.ts +7 -0
- package/dist/api/types/RegexParameterEvaluationStrategy.js +5 -0
- package/dist/api/types/SingleTestRunRequestModel.d.ts +7 -0
- package/dist/api/types/SingleTestRunRequestModel.js +5 -0
- package/dist/api/types/SongMetadata.d.ts +15 -0
- package/dist/api/types/SongMetadata.js +5 -0
- package/dist/api/types/Subscription.d.ts +2 -0
- package/dist/api/types/TestConditionRationaleCommonModel.d.ts +12 -0
- package/dist/api/types/TestConditionRationaleCommonModel.js +5 -0
- package/dist/api/types/TestConditionResultCommonModel.d.ts +8 -0
- package/dist/api/types/TestConditionResultCommonModel.js +5 -0
- package/dist/api/types/TestRunStatus.d.ts +9 -0
- package/dist/api/types/TestRunStatus.js +11 -0
- package/dist/api/types/TestToolResultModel.d.ts +7 -0
- package/dist/api/types/TestToolResultModel.js +5 -0
- package/dist/api/types/UnitTestRunResponseModel.d.ts +13 -0
- package/dist/api/types/UnitTestRunResponseModel.js +5 -0
- package/dist/api/types/UnitTestSummaryResponseModel.d.ts +16 -0
- package/dist/api/types/UnitTestSummaryResponseModel.js +5 -0
- package/dist/api/types/UnitTestToolCallEvaluationModelInput.d.ts +10 -0
- package/dist/api/types/UnitTestToolCallEvaluationModelInput.js +5 -0
- package/dist/api/types/UnitTestToolCallEvaluationModelOutput.d.ts +10 -0
- package/dist/api/types/UnitTestToolCallEvaluationModelOutput.js +5 -0
- package/dist/api/types/UnitTestToolCallParameter.d.ts +8 -0
- package/dist/api/types/UnitTestToolCallParameter.js +5 -0
- package/dist/api/types/UnitTestToolCallParameterEval.d.ts +16 -0
- package/dist/api/types/UnitTestToolCallParameterEval.js +5 -0
- package/dist/api/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +4 -0
- package/dist/api/types/UpdateUnitTestRequestDynamicVariablesValue.js +5 -0
- package/dist/api/types/User.d.ts +3 -1
- package/dist/api/types/WebhookAuthMethodType.d.ts +2 -1
- package/dist/api/types/WebhookAuthMethodType.js +1 -0
- package/dist/api/types/WorkflowFeaturesUsageCommonModel.d.ts +8 -0
- package/dist/api/types/WorkflowFeaturesUsageCommonModel.js +5 -0
- package/dist/api/types/WorkspaceApiKeyResponseModelPermissionsItem.d.ts +4 -1
- package/dist/api/types/WorkspaceApiKeyResponseModelPermissionsItem.js +3 -0
- package/dist/api/types/WorkspaceResourceType.d.ts +1 -2
- package/dist/api/types/WorkspaceResourceType.js +0 -1
- package/dist/api/types/index.d.ts +35 -1
- package/dist/api/types/index.js +35 -1
- package/dist/serialization/client/index.d.ts +1 -0
- package/dist/serialization/client/index.js +17 -0
- package/dist/serialization/client/requests/CreateUnitTestRequest.d.ts +23 -0
- package/dist/serialization/client/requests/CreateUnitTestRequest.js +56 -0
- package/dist/serialization/client/requests/ListTestsByIdsRequestModel.d.ts +12 -0
- package/dist/serialization/client/requests/ListTestsByIdsRequestModel.js +43 -0
- package/dist/serialization/client/requests/ResubmitTestsRequestModel.d.ts +15 -0
- package/dist/serialization/client/requests/ResubmitTestsRequestModel.js +46 -0
- package/dist/serialization/client/requests/RunAgentTestsRequestModel.d.ts +15 -0
- package/dist/serialization/client/requests/RunAgentTestsRequestModel.js +46 -0
- package/dist/serialization/client/requests/UpdateUnitTestRequest.d.ts +23 -0
- package/dist/serialization/client/requests/UpdateUnitTestRequest.js +56 -0
- package/dist/serialization/client/requests/index.d.ts +5 -0
- package/dist/serialization/client/requests/index.js +13 -0
- package/dist/serialization/index.d.ts +1 -0
- package/dist/serialization/index.js +1 -0
- package/dist/serialization/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +5 -5
- package/dist/serialization/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js +2 -2
- package/dist/serialization/resources/music/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/music/client/requests/index.js +3 -1
- package/dist/serialization/resources/music/types/MusicComposeDetailedRequestOutputFormat.d.ts +10 -0
- package/dist/serialization/resources/music/types/MusicComposeDetailedRequestOutputFormat.js +61 -0
- package/dist/serialization/resources/music/types/index.d.ts +1 -0
- package/dist/serialization/resources/music/types/index.js +1 -0
- package/dist/serialization/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.d.ts +13 -0
- package/dist/serialization/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.js +44 -0
- package/dist/serialization/resources/pronunciationDictionaries/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/pronunciationDictionaries/client/requests/index.js +3 -1
- package/dist/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.d.ts +1 -1
- package/dist/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.js +3 -0
- package/dist/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.d.ts +1 -1
- package/dist/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.js +3 -0
- package/dist/serialization/types/AdhocAgentConfigOverrideForTestRequestModel.d.ts +15 -0
- package/dist/serialization/types/AdhocAgentConfigOverrideForTestRequestModel.js +46 -0
- package/dist/serialization/types/AgentFailureResponseExample.d.ts +13 -0
- package/dist/serialization/types/AgentFailureResponseExample.js +44 -0
- package/dist/serialization/types/AgentSuccessfulResponseExample.d.ts +13 -0
- package/dist/serialization/types/AgentSuccessfulResponseExample.js +44 -0
- package/dist/serialization/types/AgentTestingSettings.d.ts +2 -1
- package/dist/serialization/types/AgentTestingSettings.js +2 -1
- package/dist/serialization/types/AttachedTestModel.d.ts +12 -0
- package/dist/serialization/types/AttachedTestModel.js +43 -0
- package/dist/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.d.ts +5 -1
- package/dist/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.js +2 -0
- package/dist/serialization/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
- package/dist/serialization/types/CreateUnitTestRequestDynamicVariablesValue.js +46 -0
- package/dist/serialization/types/CreateUnitTestResponseModel.d.ts +12 -0
- package/dist/serialization/types/CreateUnitTestResponseModel.js +43 -0
- package/dist/serialization/types/DetailedMusicResponse.d.ts +15 -0
- package/dist/serialization/types/DetailedMusicResponse.js +46 -0
- package/dist/serialization/types/ExactParameterEvaluationStrategy.d.ts +12 -0
- package/dist/serialization/types/ExactParameterEvaluationStrategy.js +43 -0
- package/dist/serialization/types/ExtendedSubscriptionResponseModelPendingChange.d.ts +12 -0
- package/dist/serialization/types/ExtendedSubscriptionResponseModelPendingChange.js +43 -0
- package/dist/serialization/types/FeaturesUsageCommonModel.d.ts +2 -0
- package/dist/serialization/types/FeaturesUsageCommonModel.js +2 -0
- package/dist/serialization/types/GetTestSuiteInvocationResponseModel.d.ts +15 -0
- package/dist/serialization/types/GetTestSuiteInvocationResponseModel.js +46 -0
- package/dist/serialization/types/GetTestsPageResponseModel.d.ts +15 -0
- package/dist/serialization/types/GetTestsPageResponseModel.js +46 -0
- package/dist/serialization/types/GetTestsSummariesByIdsResponseModel.d.ts +13 -0
- package/dist/serialization/types/GetTestsSummariesByIdsResponseModel.js +44 -0
- package/dist/serialization/types/GetUnitTestResponseModel.d.ts +24 -0
- package/dist/serialization/types/GetUnitTestResponseModel.js +57 -0
- package/dist/serialization/types/GetUnitTestResponseModelDynamicVariablesValue.d.ts +10 -0
- package/dist/serialization/types/GetUnitTestResponseModelDynamicVariablesValue.js +46 -0
- package/dist/serialization/types/Llm.d.ts +1 -1
- package/dist/serialization/types/Llm.js +2 -2
- package/dist/serialization/types/LlmParameterEvaluationStrategy.d.ts +12 -0
- package/dist/serialization/types/LlmParameterEvaluationStrategy.js +43 -0
- package/dist/serialization/types/MultipartMusicResponse.d.ts +14 -0
- package/dist/serialization/types/MultipartMusicResponse.js +45 -0
- package/dist/serialization/types/PendingCancellationResponseModel.d.ts +13 -0
- package/dist/serialization/types/PendingCancellationResponseModel.js +44 -0
- package/dist/serialization/types/PendingSubscriptionSwitchResponseModel.d.ts +15 -0
- package/dist/serialization/types/PendingSubscriptionSwitchResponseModel.js +46 -0
- package/dist/serialization/types/PendingSubscriptionSwitchResponseModelNextTier.d.ts +10 -0
- package/dist/serialization/types/PendingSubscriptionSwitchResponseModelNextTier.js +52 -0
- package/dist/serialization/types/ReferencedToolCommonModel.d.ts +14 -0
- package/dist/serialization/types/ReferencedToolCommonModel.js +45 -0
- package/dist/serialization/types/RegexParameterEvaluationStrategy.d.ts +12 -0
- package/dist/serialization/types/RegexParameterEvaluationStrategy.js +43 -0
- package/dist/serialization/types/SingleTestRunRequestModel.d.ts +12 -0
- package/dist/serialization/types/SingleTestRunRequestModel.js +43 -0
- package/dist/serialization/types/SongMetadata.d.ts +16 -0
- package/dist/serialization/types/SongMetadata.js +47 -0
- package/dist/serialization/types/Subscription.d.ts +2 -0
- package/dist/serialization/types/Subscription.js +2 -0
- package/dist/serialization/types/TestConditionRationaleCommonModel.d.ts +13 -0
- package/dist/serialization/types/TestConditionRationaleCommonModel.js +44 -0
- package/dist/serialization/types/TestConditionResultCommonModel.d.ts +15 -0
- package/dist/serialization/types/TestConditionResultCommonModel.js +46 -0
- package/dist/serialization/types/TestRunStatus.d.ts +10 -0
- package/dist/serialization/types/TestRunStatus.js +41 -0
- package/dist/serialization/types/TestToolResultModel.d.ts +13 -0
- package/dist/serialization/types/TestToolResultModel.js +44 -0
- package/dist/serialization/types/UnitTestRunResponseModel.d.ts +21 -0
- package/dist/serialization/types/UnitTestRunResponseModel.js +52 -0
- package/dist/serialization/types/UnitTestSummaryResponseModel.d.ts +17 -0
- package/dist/serialization/types/UnitTestSummaryResponseModel.js +48 -0
- package/dist/serialization/types/UnitTestToolCallEvaluationModelInput.d.ts +15 -0
- package/dist/serialization/types/UnitTestToolCallEvaluationModelInput.js +46 -0
- package/dist/serialization/types/UnitTestToolCallEvaluationModelOutput.d.ts +15 -0
- package/dist/serialization/types/UnitTestToolCallEvaluationModelOutput.js +46 -0
- package/dist/serialization/types/UnitTestToolCallParameter.d.ts +14 -0
- package/dist/serialization/types/UnitTestToolCallParameter.js +45 -0
- package/dist/serialization/types/UnitTestToolCallParameterEval.d.ts +22 -0
- package/dist/serialization/types/UnitTestToolCallParameterEval.js +53 -0
- package/dist/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
- package/dist/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.js +46 -0
- package/dist/serialization/types/User.d.ts +1 -0
- package/dist/serialization/types/User.js +1 -0
- package/dist/serialization/types/WebhookAuthMethodType.d.ts +1 -1
- package/dist/serialization/types/WebhookAuthMethodType.js +1 -1
- package/dist/serialization/types/WorkflowFeaturesUsageCommonModel.d.ts +14 -0
- package/dist/serialization/types/WorkflowFeaturesUsageCommonModel.js +45 -0
- package/dist/serialization/types/WorkspaceApiKeyResponseModelPermissionsItem.d.ts +1 -1
- package/dist/serialization/types/WorkspaceApiKeyResponseModelPermissionsItem.js +3 -0
- package/dist/serialization/types/WorkspaceResourceType.d.ts +1 -1
- package/dist/serialization/types/WorkspaceResourceType.js +0 -1
- package/dist/serialization/types/index.d.ts +35 -1
- package/dist/serialization/types/index.js +35 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/ElevenLabsClient.d.ts +3 -0
- package/dist/wrapper/ElevenLabsClient.js +8 -0
- package/dist/wrapper/index.d.ts +1 -0
- package/dist/wrapper/index.js +3 -1
- package/dist/wrapper/music.d.ts +43 -0
- package/dist/wrapper/music.js +162 -0
- package/package.json +1 -1
- package/reference.md +74 -3
- package/serialization/client/index.d.ts +1 -0
- package/serialization/client/index.js +17 -0
- package/serialization/client/requests/CreateUnitTestRequest.d.ts +23 -0
- package/serialization/client/requests/CreateUnitTestRequest.js +56 -0
- package/serialization/client/requests/ListTestsByIdsRequestModel.d.ts +12 -0
- package/serialization/client/requests/ListTestsByIdsRequestModel.js +43 -0
- package/serialization/client/requests/ResubmitTestsRequestModel.d.ts +15 -0
- package/serialization/client/requests/ResubmitTestsRequestModel.js +46 -0
- package/serialization/client/requests/RunAgentTestsRequestModel.d.ts +15 -0
- package/serialization/client/requests/RunAgentTestsRequestModel.js +46 -0
- package/serialization/client/requests/UpdateUnitTestRequest.d.ts +23 -0
- package/serialization/client/requests/UpdateUnitTestRequest.js +56 -0
- package/serialization/client/requests/index.d.ts +5 -0
- package/serialization/client/requests/index.js +13 -0
- package/serialization/index.d.ts +1 -0
- package/serialization/index.js +1 -0
- package/serialization/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +5 -5
- package/serialization/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js +2 -2
- package/serialization/resources/music/client/requests/index.d.ts +1 -0
- package/serialization/resources/music/client/requests/index.js +3 -1
- package/serialization/resources/music/types/MusicComposeDetailedRequestOutputFormat.d.ts +10 -0
- package/serialization/resources/music/types/MusicComposeDetailedRequestOutputFormat.js +61 -0
- package/serialization/resources/music/types/index.d.ts +1 -0
- package/serialization/resources/music/types/index.js +1 -0
- package/serialization/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.d.ts +13 -0
- package/serialization/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.js +44 -0
- package/serialization/resources/pronunciationDictionaries/client/requests/index.d.ts +1 -0
- package/serialization/resources/pronunciationDictionaries/client/requests/index.js +3 -1
- package/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.d.ts +1 -1
- package/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.js +3 -0
- package/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.d.ts +1 -1
- package/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.js +3 -0
- package/serialization/types/AdhocAgentConfigOverrideForTestRequestModel.d.ts +15 -0
- package/serialization/types/AdhocAgentConfigOverrideForTestRequestModel.js +46 -0
- package/serialization/types/AgentFailureResponseExample.d.ts +13 -0
- package/serialization/types/AgentFailureResponseExample.js +44 -0
- package/serialization/types/AgentSuccessfulResponseExample.d.ts +13 -0
- package/serialization/types/AgentSuccessfulResponseExample.js +44 -0
- package/serialization/types/AgentTestingSettings.d.ts +2 -1
- package/serialization/types/AgentTestingSettings.js +2 -1
- package/serialization/types/AttachedTestModel.d.ts +12 -0
- package/serialization/types/AttachedTestModel.js +43 -0
- package/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.d.ts +5 -1
- package/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.js +2 -0
- package/serialization/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
- package/serialization/types/CreateUnitTestRequestDynamicVariablesValue.js +46 -0
- package/serialization/types/CreateUnitTestResponseModel.d.ts +12 -0
- package/serialization/types/CreateUnitTestResponseModel.js +43 -0
- package/serialization/types/DetailedMusicResponse.d.ts +15 -0
- package/serialization/types/DetailedMusicResponse.js +46 -0
- package/serialization/types/ExactParameterEvaluationStrategy.d.ts +12 -0
- package/serialization/types/ExactParameterEvaluationStrategy.js +43 -0
- package/serialization/types/ExtendedSubscriptionResponseModelPendingChange.d.ts +12 -0
- package/serialization/types/ExtendedSubscriptionResponseModelPendingChange.js +43 -0
- package/serialization/types/FeaturesUsageCommonModel.d.ts +2 -0
- package/serialization/types/FeaturesUsageCommonModel.js +2 -0
- package/serialization/types/GetTestSuiteInvocationResponseModel.d.ts +15 -0
- package/serialization/types/GetTestSuiteInvocationResponseModel.js +46 -0
- package/serialization/types/GetTestsPageResponseModel.d.ts +15 -0
- package/serialization/types/GetTestsPageResponseModel.js +46 -0
- package/serialization/types/GetTestsSummariesByIdsResponseModel.d.ts +13 -0
- package/serialization/types/GetTestsSummariesByIdsResponseModel.js +44 -0
- package/serialization/types/GetUnitTestResponseModel.d.ts +24 -0
- package/serialization/types/GetUnitTestResponseModel.js +57 -0
- package/serialization/types/GetUnitTestResponseModelDynamicVariablesValue.d.ts +10 -0
- package/serialization/types/GetUnitTestResponseModelDynamicVariablesValue.js +46 -0
- package/serialization/types/Llm.d.ts +1 -1
- package/serialization/types/Llm.js +2 -2
- package/serialization/types/LlmParameterEvaluationStrategy.d.ts +12 -0
- package/serialization/types/LlmParameterEvaluationStrategy.js +43 -0
- package/serialization/types/MultipartMusicResponse.d.ts +14 -0
- package/serialization/types/MultipartMusicResponse.js +45 -0
- package/serialization/types/PendingCancellationResponseModel.d.ts +13 -0
- package/serialization/types/PendingCancellationResponseModel.js +44 -0
- package/serialization/types/PendingSubscriptionSwitchResponseModel.d.ts +15 -0
- package/serialization/types/PendingSubscriptionSwitchResponseModel.js +46 -0
- package/serialization/types/PendingSubscriptionSwitchResponseModelNextTier.d.ts +10 -0
- package/serialization/types/PendingSubscriptionSwitchResponseModelNextTier.js +52 -0
- package/serialization/types/ReferencedToolCommonModel.d.ts +14 -0
- package/serialization/types/ReferencedToolCommonModel.js +45 -0
- package/serialization/types/RegexParameterEvaluationStrategy.d.ts +12 -0
- package/serialization/types/RegexParameterEvaluationStrategy.js +43 -0
- package/serialization/types/SingleTestRunRequestModel.d.ts +12 -0
- package/serialization/types/SingleTestRunRequestModel.js +43 -0
- package/serialization/types/SongMetadata.d.ts +16 -0
- package/serialization/types/SongMetadata.js +47 -0
- package/serialization/types/Subscription.d.ts +2 -0
- package/serialization/types/Subscription.js +2 -0
- package/serialization/types/TestConditionRationaleCommonModel.d.ts +13 -0
- package/serialization/types/TestConditionRationaleCommonModel.js +44 -0
- package/serialization/types/TestConditionResultCommonModel.d.ts +15 -0
- package/serialization/types/TestConditionResultCommonModel.js +46 -0
- package/serialization/types/TestRunStatus.d.ts +10 -0
- package/serialization/types/TestRunStatus.js +41 -0
- package/serialization/types/TestToolResultModel.d.ts +13 -0
- package/serialization/types/TestToolResultModel.js +44 -0
- package/serialization/types/UnitTestRunResponseModel.d.ts +21 -0
- package/serialization/types/UnitTestRunResponseModel.js +52 -0
- package/serialization/types/UnitTestSummaryResponseModel.d.ts +17 -0
- package/serialization/types/UnitTestSummaryResponseModel.js +48 -0
- package/serialization/types/UnitTestToolCallEvaluationModelInput.d.ts +15 -0
- package/serialization/types/UnitTestToolCallEvaluationModelInput.js +46 -0
- package/serialization/types/UnitTestToolCallEvaluationModelOutput.d.ts +15 -0
- package/serialization/types/UnitTestToolCallEvaluationModelOutput.js +46 -0
- package/serialization/types/UnitTestToolCallParameter.d.ts +14 -0
- package/serialization/types/UnitTestToolCallParameter.js +45 -0
- package/serialization/types/UnitTestToolCallParameterEval.d.ts +22 -0
- package/serialization/types/UnitTestToolCallParameterEval.js +53 -0
- package/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
- package/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.js +46 -0
- package/serialization/types/User.d.ts +1 -0
- package/serialization/types/User.js +1 -0
- package/serialization/types/WebhookAuthMethodType.d.ts +1 -1
- package/serialization/types/WebhookAuthMethodType.js +1 -1
- package/serialization/types/WorkflowFeaturesUsageCommonModel.d.ts +14 -0
- package/serialization/types/WorkflowFeaturesUsageCommonModel.js +45 -0
- package/serialization/types/WorkspaceApiKeyResponseModelPermissionsItem.d.ts +1 -1
- package/serialization/types/WorkspaceApiKeyResponseModelPermissionsItem.js +3 -0
- package/serialization/types/WorkspaceResourceType.d.ts +1 -1
- package/serialization/types/WorkspaceResourceType.js +0 -1
- package/serialization/types/index.d.ts +35 -1
- package/serialization/types/index.js +35 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/ElevenLabsClient.d.ts +3 -0
- package/wrapper/ElevenLabsClient.js +8 -0
- package/wrapper/index.d.ts +1 -0
- package/wrapper/index.js +3 -1
- package/wrapper/music.d.ts +43 -0
- package/wrapper/music.js +162 -0
- /package/api/{types/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js → client/requests/CreateUnitTestRequest.js} +0 -0
- /package/{dist/api/types/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js → api/client/requests/ListChatResponseTestsRouteRequest.js} +0 -0
package/Client.js
CHANGED
|
@@ -49,6 +49,8 @@ exports.ElevenLabsClient = void 0;
|
|
|
49
49
|
const environments = __importStar(require("./environments"));
|
|
50
50
|
const core = __importStar(require("./core"));
|
|
51
51
|
const headers_1 = require("./core/headers");
|
|
52
|
+
const ElevenLabs = __importStar(require("./api/index"));
|
|
53
|
+
const serializers = __importStar(require("./serialization/index"));
|
|
52
54
|
const errors = __importStar(require("./errors/index"));
|
|
53
55
|
const Client_1 = require("./api/resources/history/client/Client");
|
|
54
56
|
const Client_2 = require("./api/resources/textToSoundEffects/client/Client");
|
|
@@ -79,8 +81,8 @@ class ElevenLabsClient {
|
|
|
79
81
|
"xi-api-key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
|
|
80
82
|
"X-Fern-Language": "JavaScript",
|
|
81
83
|
"X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
|
|
82
|
-
"X-Fern-SDK-Version": "v2.
|
|
83
|
-
"User-Agent": "@elevenlabs/elevenlabs-js/v2.
|
|
84
|
+
"X-Fern-SDK-Version": "v2.12.0",
|
|
85
|
+
"User-Agent": "@elevenlabs/elevenlabs-js/v2.12.0",
|
|
84
86
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
85
87
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
86
88
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -177,6 +179,689 @@ class ElevenLabsClient {
|
|
|
177
179
|
var _a;
|
|
178
180
|
return ((_a = this._workspace) !== null && _a !== void 0 ? _a : (this._workspace = new Client_23.Workspace(this._options)));
|
|
179
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Creates a new agent response test.
|
|
184
|
+
*
|
|
185
|
+
* @param {ElevenLabs.CreateUnitTestRequest} request
|
|
186
|
+
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
187
|
+
*
|
|
188
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* await client.createAgentResponseTestRoute({
|
|
192
|
+
* chatHistory: [{
|
|
193
|
+
* role: "user",
|
|
194
|
+
* timeInCallSecs: 1
|
|
195
|
+
* }],
|
|
196
|
+
* successCondition: "success_condition",
|
|
197
|
+
* successExamples: [{
|
|
198
|
+
* response: "response",
|
|
199
|
+
* type: "success"
|
|
200
|
+
* }],
|
|
201
|
+
* failureExamples: [{
|
|
202
|
+
* response: "response",
|
|
203
|
+
* type: "failure"
|
|
204
|
+
* }],
|
|
205
|
+
* name: "name"
|
|
206
|
+
* })
|
|
207
|
+
*/
|
|
208
|
+
createAgentResponseTestRoute(request, requestOptions) {
|
|
209
|
+
return core.HttpResponsePromise.fromPromise(this.__createAgentResponseTestRoute(request, requestOptions));
|
|
210
|
+
}
|
|
211
|
+
__createAgentResponseTestRoute(request, requestOptions) {
|
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
var _a, _b, _c;
|
|
214
|
+
const _response = yield core.fetcher({
|
|
215
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, "v1/convai/agent-testing/create"),
|
|
216
|
+
method: "POST",
|
|
217
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
218
|
+
contentType: "application/json",
|
|
219
|
+
requestType: "json",
|
|
220
|
+
body: serializers.CreateUnitTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
221
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
222
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
223
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
224
|
+
});
|
|
225
|
+
if (_response.ok) {
|
|
226
|
+
return {
|
|
227
|
+
data: serializers.CreateUnitTestResponseModel.parseOrThrow(_response.body, {
|
|
228
|
+
unrecognizedObjectKeys: "passthrough",
|
|
229
|
+
allowUnrecognizedUnionMembers: true,
|
|
230
|
+
allowUnrecognizedEnumValues: true,
|
|
231
|
+
breadcrumbsPrefix: ["response"],
|
|
232
|
+
}),
|
|
233
|
+
rawResponse: _response.rawResponse,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
if (_response.error.reason === "status-code") {
|
|
237
|
+
switch (_response.error.statusCode) {
|
|
238
|
+
case 422:
|
|
239
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
240
|
+
unrecognizedObjectKeys: "passthrough",
|
|
241
|
+
allowUnrecognizedUnionMembers: true,
|
|
242
|
+
allowUnrecognizedEnumValues: true,
|
|
243
|
+
breadcrumbsPrefix: ["response"],
|
|
244
|
+
}), _response.rawResponse);
|
|
245
|
+
default:
|
|
246
|
+
throw new errors.ElevenLabsError({
|
|
247
|
+
statusCode: _response.error.statusCode,
|
|
248
|
+
body: _response.error.body,
|
|
249
|
+
rawResponse: _response.rawResponse,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
switch (_response.error.reason) {
|
|
254
|
+
case "non-json":
|
|
255
|
+
throw new errors.ElevenLabsError({
|
|
256
|
+
statusCode: _response.error.statusCode,
|
|
257
|
+
body: _response.error.rawBody,
|
|
258
|
+
rawResponse: _response.rawResponse,
|
|
259
|
+
});
|
|
260
|
+
case "timeout":
|
|
261
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/agent-testing/create.");
|
|
262
|
+
case "unknown":
|
|
263
|
+
throw new errors.ElevenLabsError({
|
|
264
|
+
message: _response.error.errorMessage,
|
|
265
|
+
rawResponse: _response.rawResponse,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Gets an agent response test by ID.
|
|
272
|
+
*
|
|
273
|
+
* @param {string} testId - The id of a chat response test. This is returned on test creation.
|
|
274
|
+
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
275
|
+
*
|
|
276
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
277
|
+
*
|
|
278
|
+
* @example
|
|
279
|
+
* await client.getAgentResponseTestRoute("TeaqRRdTcIfIu2i7BYfT")
|
|
280
|
+
*/
|
|
281
|
+
getAgentResponseTestRoute(testId, requestOptions) {
|
|
282
|
+
return core.HttpResponsePromise.fromPromise(this.__getAgentResponseTestRoute(testId, requestOptions));
|
|
283
|
+
}
|
|
284
|
+
__getAgentResponseTestRoute(testId, requestOptions) {
|
|
285
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
286
|
+
var _a, _b, _c;
|
|
287
|
+
const _response = yield core.fetcher({
|
|
288
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/agent-testing/${encodeURIComponent(testId)}`),
|
|
289
|
+
method: "GET",
|
|
290
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
291
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
292
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
293
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
294
|
+
});
|
|
295
|
+
if (_response.ok) {
|
|
296
|
+
return {
|
|
297
|
+
data: serializers.GetUnitTestResponseModel.parseOrThrow(_response.body, {
|
|
298
|
+
unrecognizedObjectKeys: "passthrough",
|
|
299
|
+
allowUnrecognizedUnionMembers: true,
|
|
300
|
+
allowUnrecognizedEnumValues: true,
|
|
301
|
+
breadcrumbsPrefix: ["response"],
|
|
302
|
+
}),
|
|
303
|
+
rawResponse: _response.rawResponse,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
if (_response.error.reason === "status-code") {
|
|
307
|
+
switch (_response.error.statusCode) {
|
|
308
|
+
case 422:
|
|
309
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
310
|
+
unrecognizedObjectKeys: "passthrough",
|
|
311
|
+
allowUnrecognizedUnionMembers: true,
|
|
312
|
+
allowUnrecognizedEnumValues: true,
|
|
313
|
+
breadcrumbsPrefix: ["response"],
|
|
314
|
+
}), _response.rawResponse);
|
|
315
|
+
default:
|
|
316
|
+
throw new errors.ElevenLabsError({
|
|
317
|
+
statusCode: _response.error.statusCode,
|
|
318
|
+
body: _response.error.body,
|
|
319
|
+
rawResponse: _response.rawResponse,
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
switch (_response.error.reason) {
|
|
324
|
+
case "non-json":
|
|
325
|
+
throw new errors.ElevenLabsError({
|
|
326
|
+
statusCode: _response.error.statusCode,
|
|
327
|
+
body: _response.error.rawBody,
|
|
328
|
+
rawResponse: _response.rawResponse,
|
|
329
|
+
});
|
|
330
|
+
case "timeout":
|
|
331
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/agent-testing/{test_id}.");
|
|
332
|
+
case "unknown":
|
|
333
|
+
throw new errors.ElevenLabsError({
|
|
334
|
+
message: _response.error.errorMessage,
|
|
335
|
+
rawResponse: _response.rawResponse,
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Updates an agent response test by ID.
|
|
342
|
+
*
|
|
343
|
+
* @param {string} testId - The id of a chat response test. This is returned on test creation.
|
|
344
|
+
* @param {ElevenLabs.UpdateUnitTestRequest} request
|
|
345
|
+
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
346
|
+
*
|
|
347
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* await client.updateAgentResponseTestRoute("TeaqRRdTcIfIu2i7BYfT", {
|
|
351
|
+
* chatHistory: [{
|
|
352
|
+
* role: "user",
|
|
353
|
+
* timeInCallSecs: 1
|
|
354
|
+
* }],
|
|
355
|
+
* successCondition: "success_condition",
|
|
356
|
+
* successExamples: [{
|
|
357
|
+
* response: "response",
|
|
358
|
+
* type: "success"
|
|
359
|
+
* }],
|
|
360
|
+
* failureExamples: [{
|
|
361
|
+
* response: "response",
|
|
362
|
+
* type: "failure"
|
|
363
|
+
* }],
|
|
364
|
+
* name: "name"
|
|
365
|
+
* })
|
|
366
|
+
*/
|
|
367
|
+
updateAgentResponseTestRoute(testId, request, requestOptions) {
|
|
368
|
+
return core.HttpResponsePromise.fromPromise(this.__updateAgentResponseTestRoute(testId, request, requestOptions));
|
|
369
|
+
}
|
|
370
|
+
__updateAgentResponseTestRoute(testId, request, requestOptions) {
|
|
371
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
372
|
+
var _a, _b, _c;
|
|
373
|
+
const _response = yield core.fetcher({
|
|
374
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/agent-testing/${encodeURIComponent(testId)}`),
|
|
375
|
+
method: "PUT",
|
|
376
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
377
|
+
contentType: "application/json",
|
|
378
|
+
requestType: "json",
|
|
379
|
+
body: serializers.UpdateUnitTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
380
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
381
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
382
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
383
|
+
});
|
|
384
|
+
if (_response.ok) {
|
|
385
|
+
return {
|
|
386
|
+
data: serializers.GetUnitTestResponseModel.parseOrThrow(_response.body, {
|
|
387
|
+
unrecognizedObjectKeys: "passthrough",
|
|
388
|
+
allowUnrecognizedUnionMembers: true,
|
|
389
|
+
allowUnrecognizedEnumValues: true,
|
|
390
|
+
breadcrumbsPrefix: ["response"],
|
|
391
|
+
}),
|
|
392
|
+
rawResponse: _response.rawResponse,
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
if (_response.error.reason === "status-code") {
|
|
396
|
+
switch (_response.error.statusCode) {
|
|
397
|
+
case 422:
|
|
398
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
399
|
+
unrecognizedObjectKeys: "passthrough",
|
|
400
|
+
allowUnrecognizedUnionMembers: true,
|
|
401
|
+
allowUnrecognizedEnumValues: true,
|
|
402
|
+
breadcrumbsPrefix: ["response"],
|
|
403
|
+
}), _response.rawResponse);
|
|
404
|
+
default:
|
|
405
|
+
throw new errors.ElevenLabsError({
|
|
406
|
+
statusCode: _response.error.statusCode,
|
|
407
|
+
body: _response.error.body,
|
|
408
|
+
rawResponse: _response.rawResponse,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
switch (_response.error.reason) {
|
|
413
|
+
case "non-json":
|
|
414
|
+
throw new errors.ElevenLabsError({
|
|
415
|
+
statusCode: _response.error.statusCode,
|
|
416
|
+
body: _response.error.rawBody,
|
|
417
|
+
rawResponse: _response.rawResponse,
|
|
418
|
+
});
|
|
419
|
+
case "timeout":
|
|
420
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling PUT /v1/convai/agent-testing/{test_id}.");
|
|
421
|
+
case "unknown":
|
|
422
|
+
throw new errors.ElevenLabsError({
|
|
423
|
+
message: _response.error.errorMessage,
|
|
424
|
+
rawResponse: _response.rawResponse,
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Deletes an agent response test by ID.
|
|
431
|
+
*
|
|
432
|
+
* @param {string} testId - The id of a chat response test. This is returned on test creation.
|
|
433
|
+
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
434
|
+
*
|
|
435
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* await client.deleteChatResponseTestRoute("TeaqRRdTcIfIu2i7BYfT")
|
|
439
|
+
*/
|
|
440
|
+
deleteChatResponseTestRoute(testId, requestOptions) {
|
|
441
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteChatResponseTestRoute(testId, requestOptions));
|
|
442
|
+
}
|
|
443
|
+
__deleteChatResponseTestRoute(testId, requestOptions) {
|
|
444
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
445
|
+
var _a, _b, _c;
|
|
446
|
+
const _response = yield core.fetcher({
|
|
447
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/agent-testing/${encodeURIComponent(testId)}`),
|
|
448
|
+
method: "DELETE",
|
|
449
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
450
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
451
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
452
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
453
|
+
});
|
|
454
|
+
if (_response.ok) {
|
|
455
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
456
|
+
}
|
|
457
|
+
if (_response.error.reason === "status-code") {
|
|
458
|
+
switch (_response.error.statusCode) {
|
|
459
|
+
case 422:
|
|
460
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
461
|
+
unrecognizedObjectKeys: "passthrough",
|
|
462
|
+
allowUnrecognizedUnionMembers: true,
|
|
463
|
+
allowUnrecognizedEnumValues: true,
|
|
464
|
+
breadcrumbsPrefix: ["response"],
|
|
465
|
+
}), _response.rawResponse);
|
|
466
|
+
default:
|
|
467
|
+
throw new errors.ElevenLabsError({
|
|
468
|
+
statusCode: _response.error.statusCode,
|
|
469
|
+
body: _response.error.body,
|
|
470
|
+
rawResponse: _response.rawResponse,
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
switch (_response.error.reason) {
|
|
475
|
+
case "non-json":
|
|
476
|
+
throw new errors.ElevenLabsError({
|
|
477
|
+
statusCode: _response.error.statusCode,
|
|
478
|
+
body: _response.error.rawBody,
|
|
479
|
+
rawResponse: _response.rawResponse,
|
|
480
|
+
});
|
|
481
|
+
case "timeout":
|
|
482
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling DELETE /v1/convai/agent-testing/{test_id}.");
|
|
483
|
+
case "unknown":
|
|
484
|
+
throw new errors.ElevenLabsError({
|
|
485
|
+
message: _response.error.errorMessage,
|
|
486
|
+
rawResponse: _response.rawResponse,
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Gets multiple agent response tests by their IDs. Returns a dictionary mapping test IDs to test summaries.
|
|
493
|
+
*
|
|
494
|
+
* @param {ElevenLabs.ListTestsByIdsRequestModel} request
|
|
495
|
+
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
496
|
+
*
|
|
497
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
498
|
+
*
|
|
499
|
+
* @example
|
|
500
|
+
* await client.getAgentResponseTestsSummariesRoute({
|
|
501
|
+
* testIds: ["test_id_1", "test_id_2"]
|
|
502
|
+
* })
|
|
503
|
+
*/
|
|
504
|
+
getAgentResponseTestsSummariesRoute(request, requestOptions) {
|
|
505
|
+
return core.HttpResponsePromise.fromPromise(this.__getAgentResponseTestsSummariesRoute(request, requestOptions));
|
|
506
|
+
}
|
|
507
|
+
__getAgentResponseTestsSummariesRoute(request, requestOptions) {
|
|
508
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
509
|
+
var _a, _b, _c;
|
|
510
|
+
const _response = yield core.fetcher({
|
|
511
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, "v1/convai/agent-testing/summaries"),
|
|
512
|
+
method: "POST",
|
|
513
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
514
|
+
contentType: "application/json",
|
|
515
|
+
requestType: "json",
|
|
516
|
+
body: serializers.ListTestsByIdsRequestModel.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
517
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
518
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
519
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
520
|
+
});
|
|
521
|
+
if (_response.ok) {
|
|
522
|
+
return {
|
|
523
|
+
data: serializers.GetTestsSummariesByIdsResponseModel.parseOrThrow(_response.body, {
|
|
524
|
+
unrecognizedObjectKeys: "passthrough",
|
|
525
|
+
allowUnrecognizedUnionMembers: true,
|
|
526
|
+
allowUnrecognizedEnumValues: true,
|
|
527
|
+
breadcrumbsPrefix: ["response"],
|
|
528
|
+
}),
|
|
529
|
+
rawResponse: _response.rawResponse,
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
if (_response.error.reason === "status-code") {
|
|
533
|
+
switch (_response.error.statusCode) {
|
|
534
|
+
case 422:
|
|
535
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
536
|
+
unrecognizedObjectKeys: "passthrough",
|
|
537
|
+
allowUnrecognizedUnionMembers: true,
|
|
538
|
+
allowUnrecognizedEnumValues: true,
|
|
539
|
+
breadcrumbsPrefix: ["response"],
|
|
540
|
+
}), _response.rawResponse);
|
|
541
|
+
default:
|
|
542
|
+
throw new errors.ElevenLabsError({
|
|
543
|
+
statusCode: _response.error.statusCode,
|
|
544
|
+
body: _response.error.body,
|
|
545
|
+
rawResponse: _response.rawResponse,
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
switch (_response.error.reason) {
|
|
550
|
+
case "non-json":
|
|
551
|
+
throw new errors.ElevenLabsError({
|
|
552
|
+
statusCode: _response.error.statusCode,
|
|
553
|
+
body: _response.error.rawBody,
|
|
554
|
+
rawResponse: _response.rawResponse,
|
|
555
|
+
});
|
|
556
|
+
case "timeout":
|
|
557
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/agent-testing/summaries.");
|
|
558
|
+
case "unknown":
|
|
559
|
+
throw new errors.ElevenLabsError({
|
|
560
|
+
message: _response.error.errorMessage,
|
|
561
|
+
rawResponse: _response.rawResponse,
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Lists all agent response tests with pagination support and optional search filtering.
|
|
568
|
+
*
|
|
569
|
+
* @param {ElevenLabs.ListChatResponseTestsRouteRequest} request
|
|
570
|
+
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
571
|
+
*
|
|
572
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
573
|
+
*
|
|
574
|
+
* @example
|
|
575
|
+
* await client.listChatResponseTestsRoute()
|
|
576
|
+
*/
|
|
577
|
+
listChatResponseTestsRoute(request = {}, requestOptions) {
|
|
578
|
+
return core.HttpResponsePromise.fromPromise(this.__listChatResponseTestsRoute(request, requestOptions));
|
|
579
|
+
}
|
|
580
|
+
__listChatResponseTestsRoute() {
|
|
581
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
582
|
+
var _a, _b, _c;
|
|
583
|
+
const { cursor, pageSize, search } = request;
|
|
584
|
+
const _queryParams = {};
|
|
585
|
+
if (cursor != null) {
|
|
586
|
+
_queryParams["cursor"] = cursor;
|
|
587
|
+
}
|
|
588
|
+
if (pageSize != null) {
|
|
589
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
590
|
+
}
|
|
591
|
+
if (search != null) {
|
|
592
|
+
_queryParams["search"] = search;
|
|
593
|
+
}
|
|
594
|
+
const _response = yield core.fetcher({
|
|
595
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, "v1/convai/agent-testing"),
|
|
596
|
+
method: "GET",
|
|
597
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
598
|
+
queryParameters: _queryParams,
|
|
599
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
600
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
601
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
602
|
+
});
|
|
603
|
+
if (_response.ok) {
|
|
604
|
+
return {
|
|
605
|
+
data: serializers.GetTestsPageResponseModel.parseOrThrow(_response.body, {
|
|
606
|
+
unrecognizedObjectKeys: "passthrough",
|
|
607
|
+
allowUnrecognizedUnionMembers: true,
|
|
608
|
+
allowUnrecognizedEnumValues: true,
|
|
609
|
+
breadcrumbsPrefix: ["response"],
|
|
610
|
+
}),
|
|
611
|
+
rawResponse: _response.rawResponse,
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
if (_response.error.reason === "status-code") {
|
|
615
|
+
switch (_response.error.statusCode) {
|
|
616
|
+
case 422:
|
|
617
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
618
|
+
unrecognizedObjectKeys: "passthrough",
|
|
619
|
+
allowUnrecognizedUnionMembers: true,
|
|
620
|
+
allowUnrecognizedEnumValues: true,
|
|
621
|
+
breadcrumbsPrefix: ["response"],
|
|
622
|
+
}), _response.rawResponse);
|
|
623
|
+
default:
|
|
624
|
+
throw new errors.ElevenLabsError({
|
|
625
|
+
statusCode: _response.error.statusCode,
|
|
626
|
+
body: _response.error.body,
|
|
627
|
+
rawResponse: _response.rawResponse,
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
switch (_response.error.reason) {
|
|
632
|
+
case "non-json":
|
|
633
|
+
throw new errors.ElevenLabsError({
|
|
634
|
+
statusCode: _response.error.statusCode,
|
|
635
|
+
body: _response.error.rawBody,
|
|
636
|
+
rawResponse: _response.rawResponse,
|
|
637
|
+
});
|
|
638
|
+
case "timeout":
|
|
639
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/agent-testing.");
|
|
640
|
+
case "unknown":
|
|
641
|
+
throw new errors.ElevenLabsError({
|
|
642
|
+
message: _response.error.errorMessage,
|
|
643
|
+
rawResponse: _response.rawResponse,
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration.
|
|
650
|
+
*
|
|
651
|
+
* @param {string} agentId - The id of an agent. This is returned on agent creation.
|
|
652
|
+
* @param {ElevenLabs.RunAgentTestsRequestModel} request
|
|
653
|
+
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
654
|
+
*
|
|
655
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
656
|
+
*
|
|
657
|
+
* @example
|
|
658
|
+
* await client.runAgentTestSuiteRoute("21m00Tcm4TlvDq8ikWAM", {
|
|
659
|
+
* tests: [{
|
|
660
|
+
* testId: "test_id"
|
|
661
|
+
* }]
|
|
662
|
+
* })
|
|
663
|
+
*/
|
|
664
|
+
runAgentTestSuiteRoute(agentId, request, requestOptions) {
|
|
665
|
+
return core.HttpResponsePromise.fromPromise(this.__runAgentTestSuiteRoute(agentId, request, requestOptions));
|
|
666
|
+
}
|
|
667
|
+
__runAgentTestSuiteRoute(agentId, request, requestOptions) {
|
|
668
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
669
|
+
var _a, _b, _c;
|
|
670
|
+
const _response = yield core.fetcher({
|
|
671
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/agents/${encodeURIComponent(agentId)}/run-tests`),
|
|
672
|
+
method: "POST",
|
|
673
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
674
|
+
contentType: "application/json",
|
|
675
|
+
requestType: "json",
|
|
676
|
+
body: serializers.RunAgentTestsRequestModel.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
677
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
678
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
679
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
680
|
+
});
|
|
681
|
+
if (_response.ok) {
|
|
682
|
+
return {
|
|
683
|
+
data: serializers.GetTestSuiteInvocationResponseModel.parseOrThrow(_response.body, {
|
|
684
|
+
unrecognizedObjectKeys: "passthrough",
|
|
685
|
+
allowUnrecognizedUnionMembers: true,
|
|
686
|
+
allowUnrecognizedEnumValues: true,
|
|
687
|
+
breadcrumbsPrefix: ["response"],
|
|
688
|
+
}),
|
|
689
|
+
rawResponse: _response.rawResponse,
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
if (_response.error.reason === "status-code") {
|
|
693
|
+
switch (_response.error.statusCode) {
|
|
694
|
+
case 422:
|
|
695
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
696
|
+
unrecognizedObjectKeys: "passthrough",
|
|
697
|
+
allowUnrecognizedUnionMembers: true,
|
|
698
|
+
allowUnrecognizedEnumValues: true,
|
|
699
|
+
breadcrumbsPrefix: ["response"],
|
|
700
|
+
}), _response.rawResponse);
|
|
701
|
+
default:
|
|
702
|
+
throw new errors.ElevenLabsError({
|
|
703
|
+
statusCode: _response.error.statusCode,
|
|
704
|
+
body: _response.error.body,
|
|
705
|
+
rawResponse: _response.rawResponse,
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
switch (_response.error.reason) {
|
|
710
|
+
case "non-json":
|
|
711
|
+
throw new errors.ElevenLabsError({
|
|
712
|
+
statusCode: _response.error.statusCode,
|
|
713
|
+
body: _response.error.rawBody,
|
|
714
|
+
rawResponse: _response.rawResponse,
|
|
715
|
+
});
|
|
716
|
+
case "timeout":
|
|
717
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/agents/{agent_id}/run-tests.");
|
|
718
|
+
case "unknown":
|
|
719
|
+
throw new errors.ElevenLabsError({
|
|
720
|
+
message: _response.error.errorMessage,
|
|
721
|
+
rawResponse: _response.rawResponse,
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Gets a test invocation by ID.
|
|
728
|
+
*
|
|
729
|
+
* @param {string} testInvocationId - The id of a test invocation. This is returned when tests are run.
|
|
730
|
+
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
731
|
+
*
|
|
732
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
733
|
+
*
|
|
734
|
+
* @example
|
|
735
|
+
* await client.getTestInvocationRoute("test_invocation_id")
|
|
736
|
+
*/
|
|
737
|
+
getTestInvocationRoute(testInvocationId, requestOptions) {
|
|
738
|
+
return core.HttpResponsePromise.fromPromise(this.__getTestInvocationRoute(testInvocationId, requestOptions));
|
|
739
|
+
}
|
|
740
|
+
__getTestInvocationRoute(testInvocationId, requestOptions) {
|
|
741
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
742
|
+
var _a, _b, _c;
|
|
743
|
+
const _response = yield core.fetcher({
|
|
744
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/test-invocations/${encodeURIComponent(testInvocationId)}`),
|
|
745
|
+
method: "GET",
|
|
746
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
747
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
748
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
749
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
750
|
+
});
|
|
751
|
+
if (_response.ok) {
|
|
752
|
+
return {
|
|
753
|
+
data: serializers.GetTestSuiteInvocationResponseModel.parseOrThrow(_response.body, {
|
|
754
|
+
unrecognizedObjectKeys: "passthrough",
|
|
755
|
+
allowUnrecognizedUnionMembers: true,
|
|
756
|
+
allowUnrecognizedEnumValues: true,
|
|
757
|
+
breadcrumbsPrefix: ["response"],
|
|
758
|
+
}),
|
|
759
|
+
rawResponse: _response.rawResponse,
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
if (_response.error.reason === "status-code") {
|
|
763
|
+
switch (_response.error.statusCode) {
|
|
764
|
+
case 422:
|
|
765
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
766
|
+
unrecognizedObjectKeys: "passthrough",
|
|
767
|
+
allowUnrecognizedUnionMembers: true,
|
|
768
|
+
allowUnrecognizedEnumValues: true,
|
|
769
|
+
breadcrumbsPrefix: ["response"],
|
|
770
|
+
}), _response.rawResponse);
|
|
771
|
+
default:
|
|
772
|
+
throw new errors.ElevenLabsError({
|
|
773
|
+
statusCode: _response.error.statusCode,
|
|
774
|
+
body: _response.error.body,
|
|
775
|
+
rawResponse: _response.rawResponse,
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
switch (_response.error.reason) {
|
|
780
|
+
case "non-json":
|
|
781
|
+
throw new errors.ElevenLabsError({
|
|
782
|
+
statusCode: _response.error.statusCode,
|
|
783
|
+
body: _response.error.rawBody,
|
|
784
|
+
rawResponse: _response.rawResponse,
|
|
785
|
+
});
|
|
786
|
+
case "timeout":
|
|
787
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/test-invocations/{test_invocation_id}.");
|
|
788
|
+
case "unknown":
|
|
789
|
+
throw new errors.ElevenLabsError({
|
|
790
|
+
message: _response.error.errorMessage,
|
|
791
|
+
rawResponse: _response.rawResponse,
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Resubmits specific test runs from a test invocation.
|
|
798
|
+
*
|
|
799
|
+
* @param {string} testInvocationId - The id of a test invocation. This is returned when tests are run.
|
|
800
|
+
* @param {ElevenLabs.ResubmitTestsRequestModel} request
|
|
801
|
+
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
802
|
+
*
|
|
803
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
804
|
+
*
|
|
805
|
+
* @example
|
|
806
|
+
* await client.resubmitTestsRoute("test_invocation_id", {
|
|
807
|
+
* testRunIds: ["test_run_ids"],
|
|
808
|
+
* agentId: "agent_id"
|
|
809
|
+
* })
|
|
810
|
+
*/
|
|
811
|
+
resubmitTestsRoute(testInvocationId, request, requestOptions) {
|
|
812
|
+
return core.HttpResponsePromise.fromPromise(this.__resubmitTestsRoute(testInvocationId, request, requestOptions));
|
|
813
|
+
}
|
|
814
|
+
__resubmitTestsRoute(testInvocationId, request, requestOptions) {
|
|
815
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
816
|
+
var _a, _b, _c;
|
|
817
|
+
const _response = yield core.fetcher({
|
|
818
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/test-invocations/${encodeURIComponent(testInvocationId)}/resubmit`),
|
|
819
|
+
method: "POST",
|
|
820
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
821
|
+
contentType: "application/json",
|
|
822
|
+
requestType: "json",
|
|
823
|
+
body: serializers.ResubmitTestsRequestModel.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
824
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
825
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
826
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
827
|
+
});
|
|
828
|
+
if (_response.ok) {
|
|
829
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
830
|
+
}
|
|
831
|
+
if (_response.error.reason === "status-code") {
|
|
832
|
+
switch (_response.error.statusCode) {
|
|
833
|
+
case 422:
|
|
834
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
835
|
+
unrecognizedObjectKeys: "passthrough",
|
|
836
|
+
allowUnrecognizedUnionMembers: true,
|
|
837
|
+
allowUnrecognizedEnumValues: true,
|
|
838
|
+
breadcrumbsPrefix: ["response"],
|
|
839
|
+
}), _response.rawResponse);
|
|
840
|
+
default:
|
|
841
|
+
throw new errors.ElevenLabsError({
|
|
842
|
+
statusCode: _response.error.statusCode,
|
|
843
|
+
body: _response.error.body,
|
|
844
|
+
rawResponse: _response.rawResponse,
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
switch (_response.error.reason) {
|
|
849
|
+
case "non-json":
|
|
850
|
+
throw new errors.ElevenLabsError({
|
|
851
|
+
statusCode: _response.error.statusCode,
|
|
852
|
+
body: _response.error.rawBody,
|
|
853
|
+
rawResponse: _response.rawResponse,
|
|
854
|
+
});
|
|
855
|
+
case "timeout":
|
|
856
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/test-invocations/{test_invocation_id}/resubmit.");
|
|
857
|
+
case "unknown":
|
|
858
|
+
throw new errors.ElevenLabsError({
|
|
859
|
+
message: _response.error.errorMessage,
|
|
860
|
+
rawResponse: _response.rawResponse,
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
}
|
|
180
865
|
/**
|
|
181
866
|
* Add a generated voice to the voice library.
|
|
182
867
|
*
|