@elevenlabs/elevenlabs-js 2.4.0 → 2.5.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 +3 -3
- package/Client.js +15 -15
- package/api/errors/BadRequestError.d.ts +2 -1
- package/api/resources/audioIsolation/client/requests/BodyAudioIsolationStreamV1AudioIsolationStreamPost.d.ts +2 -2
- package/api/resources/audioIsolation/client/requests/BodyAudioIsolationV1AudioIsolationPost.d.ts +2 -2
- package/api/resources/audioNative/client/requests/BodyCreatesAudioNativeEnabledProjectV1AudioNativePost.d.ts +2 -2
- package/api/resources/audioNative/client/requests/BodyUpdateAudioNativeProjectContentV1AudioNativeProjectIdContentPost.d.ts +2 -2
- package/api/resources/conversationalAi/client/Client.js +5 -0
- package/api/resources/conversationalAi/client/requests/BodyAddToKnowledgeBaseV1ConvaiKnowledgeBasePost.d.ts +3 -2
- package/api/resources/conversationalAi/resources/agents/resources/widget/resources/avatar/client/requests/BodyPostAgentAvatarV1ConvaiAgentsAgentIdAvatarPost.d.ts +2 -2
- package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.d.ts +2 -1
- package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.js +11 -4
- package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/BodyCreateFileDocumentV1ConvaiKnowledgeBaseFilePost.d.ts +2 -2
- package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/DocumentsGetRequest.d.ts +10 -0
- package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/index.d.ts +1 -0
- package/api/resources/conversationalAi/resources/phoneNumbers/client/Client.js +2 -2
- package/api/resources/dubbing/client/requests/BodyDubAVideoOrAnAudioFileV1DubbingPost.d.ts +5 -5
- package/api/resources/forcedAlignment/client/requests/BodyCreateForcedAlignmentV1ForcedAlignmentPost.d.ts +2 -2
- package/api/resources/history/client/Client.js +6 -1
- package/api/resources/index.d.ts +0 -1
- package/api/resources/index.js +0 -1
- package/api/resources/pronunciationDictionaries/client/Client.js +4 -4
- package/api/resources/pronunciationDictionaries/client/requests/BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromFilePost.d.ts +2 -2
- package/api/resources/speechToSpeech/client/requests/BodySpeechToSpeechStreamingV1SpeechToSpeechVoiceIdStreamPost.d.ts +2 -2
- package/api/resources/speechToSpeech/client/requests/BodySpeechToSpeechV1SpeechToSpeechVoiceIdPost.d.ts +2 -2
- package/api/resources/speechToText/client/Client.d.ts +3 -1
- package/api/resources/speechToText/client/Client.js +10 -7
- package/api/resources/speechToText/client/requests/BodySpeechToTextV1SpeechToTextPost.d.ts +4 -2
- package/api/resources/studio/resources/projects/client/requests/BodyCreateStudioProjectV1StudioProjectsPost.d.ts +9 -3
- package/api/resources/studio/resources/projects/resources/content/client/Client.js +3 -0
- package/api/resources/studio/resources/projects/resources/content/client/requests/BodyUpdateStudioProjectContentV1StudioProjectsProjectIdContentPost.d.ts +10 -2
- package/api/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.d.ts +2 -1
- package/api/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.js +1 -0
- package/api/resources/voices/client/requests/BodyEditVoiceV1VoicesVoiceIdEditPost.d.ts +2 -2
- package/api/resources/voices/client/requests/BodyGetSimilarLibraryVoicesV1SimilarVoicesPost.d.ts +2 -2
- package/api/resources/voices/resources/ivc/client/requests/BodyAddVoiceV1VoicesAddPost.d.ts +2 -2
- package/api/resources/voices/resources/pvc/resources/samples/client/requests/BodyAddSamplesToPvcVoiceV1VoicesPvcVoiceIdSamplesPost.d.ts +2 -2
- package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/Client.d.ts +5 -2
- package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/Client.js +14 -5
- package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/index.d.ts +1 -0
- package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/index.js +15 -0
- package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/requests/AudioGetRequest.d.ts +15 -0
- package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/requests/index.d.ts +1 -0
- package/api/resources/voices/resources/pvc/resources/samples/resources/index.d.ts +1 -0
- package/api/resources/voices/resources/pvc/resources/samples/resources/index.js +4 -0
- package/api/resources/voices/resources/pvc/resources/verification/client/requests/BodyRequestManualVerificationV1VoicesPvcVoiceIdVerificationPost.d.ts +2 -2
- package/api/resources/voices/resources/pvc/resources/verification/resources/captcha/client/requests/BodyVerifyPvcVoiceCaptchaV1VoicesPvcVoiceIdCaptchaPost.d.ts +2 -2
- package/api/resources/workspace/client/Client.d.ts +0 -67
- package/api/resources/workspace/client/Client.js +0 -326
- package/api/resources/workspace/client/index.d.ts +0 -1
- package/api/resources/workspace/client/index.js +0 -15
- package/api/types/AddProjectRequest.d.ts +7 -1
- package/api/types/AuthConnectionLocator.d.ts +9 -0
- package/api/types/BadRequestErrorBody.d.ts +7 -0
- package/api/types/BodyAddProjectV1ProjectsAddPostSourceType.d.ts +2 -1
- package/api/types/BodyAddProjectV1ProjectsAddPostSourceType.js +1 -0
- package/api/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.d.ts +8 -0
- package/api/types/BreakdownTypes.d.ts +3 -1
- package/api/types/BreakdownTypes.js +2 -0
- package/api/types/BuiltInToolsInput.d.ts +2 -0
- package/api/types/BuiltInToolsOutput.d.ts +2 -0
- package/api/types/ChapterResponse.d.ts +2 -0
- package/api/types/ChapterWithContentResponseModel.d.ts +2 -0
- package/api/types/ForcedAlignmentResponseModel.d.ts +2 -0
- package/api/types/ForcedAlignmentWordResponseModel.d.ts +2 -0
- package/api/types/MetricType.d.ts +2 -1
- package/api/types/MetricType.js +1 -0
- package/api/types/PlayDtmfToolConfig.d.ts +11 -0
- package/api/types/ProjectExtendedResponse.d.ts +2 -2
- package/api/types/ProjectExtendedResponseModelSourceType.d.ts +2 -1
- package/api/types/ProjectExtendedResponseModelSourceType.js +1 -0
- package/api/types/ProjectResponseModelSourceType.d.ts +2 -1
- package/api/types/ProjectResponseModelSourceType.js +1 -0
- package/api/types/SystemToolConfigInputParams.d.ts +4 -1
- package/api/types/SystemToolConfigOutputParams.d.ts +4 -1
- package/api/types/WebhookToolApiSchemaConfigInput.d.ts +2 -0
- package/api/types/WebhookToolApiSchemaConfigOutput.d.ts +2 -0
- package/api/types/WorkspaceResourceType.d.ts +2 -1
- package/api/types/WorkspaceResourceType.js +1 -0
- package/api/types/index.d.ts +3 -4
- package/api/types/index.js +3 -4
- package/core/fetcher/BinaryResponse.d.ts +17 -0
- package/core/fetcher/BinaryResponse.js +14 -0
- package/core/fetcher/Fetcher.d.ts +1 -1
- package/core/fetcher/ResponseWithBody.d.ts +4 -0
- package/core/fetcher/ResponseWithBody.js +6 -0
- package/core/fetcher/getFetchFn.js +3 -3
- package/core/fetcher/getResponseBody.js +33 -32
- package/core/fetcher/index.d.ts +1 -0
- package/core/file.d.ts +1 -0
- package/core/form-data-utils/FormDataWrapper.d.ts +5 -52
- package/core/form-data-utils/FormDataWrapper.js +104 -124
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/dist/Client.d.ts +3 -3
- package/dist/Client.js +15 -15
- package/dist/api/errors/BadRequestError.d.ts +2 -1
- package/dist/api/resources/audioIsolation/client/requests/BodyAudioIsolationStreamV1AudioIsolationStreamPost.d.ts +2 -2
- package/dist/api/resources/audioIsolation/client/requests/BodyAudioIsolationV1AudioIsolationPost.d.ts +2 -2
- package/dist/api/resources/audioNative/client/requests/BodyCreatesAudioNativeEnabledProjectV1AudioNativePost.d.ts +2 -2
- package/dist/api/resources/audioNative/client/requests/BodyUpdateAudioNativeProjectContentV1AudioNativeProjectIdContentPost.d.ts +2 -2
- package/dist/api/resources/conversationalAi/client/Client.js +5 -0
- package/dist/api/resources/conversationalAi/client/requests/BodyAddToKnowledgeBaseV1ConvaiKnowledgeBasePost.d.ts +3 -2
- package/dist/api/resources/conversationalAi/resources/agents/resources/widget/resources/avatar/client/requests/BodyPostAgentAvatarV1ConvaiAgentsAgentIdAvatarPost.d.ts +2 -2
- package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.d.ts +2 -1
- package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.js +11 -4
- package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/BodyCreateFileDocumentV1ConvaiKnowledgeBaseFilePost.d.ts +2 -2
- package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/DocumentsGetRequest.d.ts +10 -0
- package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/index.d.ts +1 -0
- package/dist/api/resources/conversationalAi/resources/phoneNumbers/client/Client.js +2 -2
- package/dist/api/resources/dubbing/client/requests/BodyDubAVideoOrAnAudioFileV1DubbingPost.d.ts +5 -5
- package/dist/api/resources/forcedAlignment/client/requests/BodyCreateForcedAlignmentV1ForcedAlignmentPost.d.ts +2 -2
- package/dist/api/resources/history/client/Client.js +6 -1
- package/dist/api/resources/index.d.ts +0 -1
- package/dist/api/resources/index.js +0 -1
- package/dist/api/resources/pronunciationDictionaries/client/Client.js +4 -4
- package/dist/api/resources/pronunciationDictionaries/client/requests/BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromFilePost.d.ts +2 -2
- package/dist/api/resources/speechToSpeech/client/requests/BodySpeechToSpeechStreamingV1SpeechToSpeechVoiceIdStreamPost.d.ts +2 -2
- package/dist/api/resources/speechToSpeech/client/requests/BodySpeechToSpeechV1SpeechToSpeechVoiceIdPost.d.ts +2 -2
- package/dist/api/resources/speechToText/client/Client.d.ts +3 -1
- package/dist/api/resources/speechToText/client/Client.js +10 -7
- package/dist/api/resources/speechToText/client/requests/BodySpeechToTextV1SpeechToTextPost.d.ts +4 -2
- package/dist/api/resources/studio/resources/projects/client/requests/BodyCreateStudioProjectV1StudioProjectsPost.d.ts +9 -3
- package/dist/api/resources/studio/resources/projects/resources/content/client/Client.js +3 -0
- package/dist/api/resources/studio/resources/projects/resources/content/client/requests/BodyUpdateStudioProjectContentV1StudioProjectsProjectIdContentPost.d.ts +10 -2
- package/dist/api/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.d.ts +2 -1
- package/dist/api/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.js +1 -0
- package/dist/api/resources/voices/client/requests/BodyEditVoiceV1VoicesVoiceIdEditPost.d.ts +2 -2
- package/dist/api/resources/voices/client/requests/BodyGetSimilarLibraryVoicesV1SimilarVoicesPost.d.ts +2 -2
- package/dist/api/resources/voices/resources/ivc/client/requests/BodyAddVoiceV1VoicesAddPost.d.ts +2 -2
- package/dist/api/resources/voices/resources/pvc/resources/samples/client/requests/BodyAddSamplesToPvcVoiceV1VoicesPvcVoiceIdSamplesPost.d.ts +2 -2
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/Client.d.ts +5 -2
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/Client.js +14 -5
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/index.d.ts +1 -0
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/index.js +15 -0
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/requests/AudioGetRequest.d.ts +15 -0
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/requests/index.d.ts +1 -0
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/requests/index.js +2 -0
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/index.d.ts +1 -0
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/index.js +4 -0
- package/dist/api/resources/voices/resources/pvc/resources/verification/client/requests/BodyRequestManualVerificationV1VoicesPvcVoiceIdVerificationPost.d.ts +2 -2
- package/dist/api/resources/voices/resources/pvc/resources/verification/resources/captcha/client/requests/BodyVerifyPvcVoiceCaptchaV1VoicesPvcVoiceIdCaptchaPost.d.ts +2 -2
- package/dist/api/resources/workspace/client/Client.d.ts +0 -67
- package/dist/api/resources/workspace/client/Client.js +0 -326
- package/dist/api/resources/workspace/client/index.d.ts +0 -1
- package/dist/api/resources/workspace/client/index.js +0 -15
- package/dist/api/types/AddProjectRequest.d.ts +7 -1
- package/dist/api/types/AuthConnectionLocator.d.ts +9 -0
- package/dist/api/types/BadRequestErrorBody.d.ts +7 -0
- package/dist/api/types/BodyAddProjectV1ProjectsAddPostSourceType.d.ts +2 -1
- package/dist/api/types/BodyAddProjectV1ProjectsAddPostSourceType.js +1 -0
- package/dist/api/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.d.ts +8 -0
- package/dist/api/types/BreakdownTypes.d.ts +3 -1
- package/dist/api/types/BreakdownTypes.js +2 -0
- package/dist/api/types/BuiltInToolsInput.d.ts +2 -0
- package/dist/api/types/BuiltInToolsOutput.d.ts +2 -0
- package/dist/api/types/ChapterResponse.d.ts +2 -0
- package/dist/api/types/ChapterWithContentResponseModel.d.ts +2 -0
- package/dist/api/types/ForcedAlignmentResponseModel.d.ts +2 -0
- package/dist/api/types/ForcedAlignmentWordResponseModel.d.ts +2 -0
- package/dist/api/types/MetricType.d.ts +2 -1
- package/dist/api/types/MetricType.js +1 -0
- package/dist/api/types/PlayDtmfToolConfig.d.ts +11 -0
- package/dist/api/types/ProjectExtendedResponse.d.ts +2 -2
- package/dist/api/types/ProjectExtendedResponseModelSourceType.d.ts +2 -1
- package/dist/api/types/ProjectExtendedResponseModelSourceType.js +1 -0
- package/dist/api/types/ProjectResponseModelSourceType.d.ts +2 -1
- package/dist/api/types/ProjectResponseModelSourceType.js +1 -0
- package/dist/api/types/SystemToolConfigInputParams.d.ts +4 -1
- package/dist/api/types/SystemToolConfigOutputParams.d.ts +4 -1
- package/dist/api/types/WebhookToolApiSchemaConfigInput.d.ts +2 -0
- package/dist/api/types/WebhookToolApiSchemaConfigOutput.d.ts +2 -0
- package/dist/api/types/WorkspaceResourceType.d.ts +2 -1
- package/dist/api/types/WorkspaceResourceType.js +1 -0
- package/dist/api/types/index.d.ts +3 -4
- package/dist/api/types/index.js +3 -4
- package/dist/core/fetcher/BinaryResponse.d.ts +17 -0
- package/dist/core/fetcher/BinaryResponse.js +14 -0
- package/dist/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/core/fetcher/ResponseWithBody.d.ts +4 -0
- package/dist/core/fetcher/ResponseWithBody.js +6 -0
- package/dist/core/fetcher/getFetchFn.js +3 -3
- package/dist/core/fetcher/getResponseBody.js +33 -32
- package/dist/core/fetcher/index.d.ts +1 -0
- package/dist/core/file.d.ts +1 -0
- package/dist/core/file.js +2 -0
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +5 -52
- package/dist/core/form-data-utils/FormDataWrapper.js +104 -124
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/environments.d.ts +5 -1
- package/dist/environments.js +4 -0
- package/dist/serialization/resources/index.d.ts +0 -1
- package/dist/serialization/resources/index.js +0 -1
- package/dist/serialization/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.d.ts +1 -1
- package/dist/serialization/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.js +1 -1
- package/dist/serialization/resources/workspace/index.d.ts +0 -1
- package/dist/serialization/resources/workspace/index.js +0 -1
- package/dist/serialization/types/AuthConnectionLocator.d.ts +12 -0
- package/dist/serialization/{resources/workspace/client/getShareOptions.js → types/AuthConnectionLocator.js} +5 -4
- package/dist/serialization/types/BadRequestErrorBody.d.ts +13 -0
- package/{serialization/resources/workspace/client/getShareOptions.js → dist/serialization/types/BadRequestErrorBody.js} +6 -4
- package/dist/serialization/types/BodyAddProjectV1ProjectsAddPostSourceType.d.ts +1 -1
- package/dist/serialization/types/BodyAddProjectV1ProjectsAddPostSourceType.js +1 -1
- package/dist/serialization/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.d.ts +1 -0
- package/dist/serialization/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.js +1 -0
- package/dist/serialization/types/BreakdownTypes.d.ts +1 -1
- package/dist/serialization/types/BreakdownTypes.js +2 -0
- package/dist/serialization/types/BuiltInToolsInput.d.ts +1 -0
- package/dist/serialization/types/BuiltInToolsInput.js +1 -0
- package/dist/serialization/types/BuiltInToolsOutput.d.ts +1 -0
- package/dist/serialization/types/BuiltInToolsOutput.js +1 -0
- package/dist/serialization/types/ChapterResponse.d.ts +1 -0
- package/dist/serialization/types/ChapterResponse.js +1 -0
- package/dist/serialization/types/ChapterWithContentResponseModel.d.ts +1 -0
- package/dist/serialization/types/ChapterWithContentResponseModel.js +1 -0
- package/dist/serialization/types/ForcedAlignmentResponseModel.d.ts +1 -0
- package/dist/serialization/types/ForcedAlignmentResponseModel.js +1 -0
- package/dist/serialization/types/ForcedAlignmentWordResponseModel.d.ts +1 -0
- package/dist/serialization/types/ForcedAlignmentWordResponseModel.js +1 -0
- package/dist/serialization/types/MetricType.d.ts +1 -1
- package/dist/serialization/types/MetricType.js +9 -1
- package/dist/serialization/types/PlayDtmfToolConfig.d.ts +11 -0
- package/dist/serialization/types/PlayDtmfToolConfig.js +41 -0
- package/dist/serialization/types/ProjectExtendedResponse.d.ts +1 -1
- package/dist/serialization/types/ProjectExtendedResponse.js +1 -1
- package/dist/serialization/types/ProjectExtendedResponseModelSourceType.d.ts +1 -1
- package/dist/serialization/types/ProjectExtendedResponseModelSourceType.js +1 -1
- package/dist/serialization/types/ProjectResponseModelSourceType.d.ts +1 -1
- package/dist/serialization/types/ProjectResponseModelSourceType.js +1 -1
- package/dist/serialization/types/SystemToolConfigInputParams.d.ts +5 -1
- package/dist/serialization/types/SystemToolConfigInputParams.js +2 -0
- package/dist/serialization/types/SystemToolConfigOutputParams.d.ts +5 -1
- package/dist/serialization/types/SystemToolConfigOutputParams.js +2 -0
- package/dist/serialization/types/WebhookToolApiSchemaConfigInput.d.ts +2 -0
- package/dist/serialization/types/WebhookToolApiSchemaConfigInput.js +2 -0
- package/dist/serialization/types/WebhookToolApiSchemaConfigOutput.d.ts +2 -0
- package/dist/serialization/types/WebhookToolApiSchemaConfigOutput.js +2 -0
- package/dist/serialization/types/WorkspaceResourceType.d.ts +1 -1
- package/dist/serialization/types/WorkspaceResourceType.js +1 -0
- package/dist/serialization/types/index.d.ts +3 -4
- package/dist/serialization/types/index.js +3 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/play.d.ts +1 -2
- package/dist/wrapper/play.js +69 -36
- package/dist/wrapper/stream.d.ts +1 -2
- package/dist/wrapper/stream.js +64 -37
- package/dist/wrapper/utils.d.ts +2 -0
- package/dist/wrapper/utils.js +41 -0
- package/environments.d.ts +5 -1
- package/environments.js +4 -0
- package/jest.browser.config.mjs +10 -0
- package/jest.config.mjs +4 -1
- package/package.json +7 -10
- package/reference.md +23 -247
- package/serialization/resources/index.d.ts +0 -1
- package/serialization/resources/index.js +0 -1
- package/serialization/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.d.ts +1 -1
- package/serialization/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.js +1 -1
- package/serialization/resources/workspace/index.d.ts +0 -1
- package/serialization/resources/workspace/index.js +0 -1
- package/serialization/types/AuthConnectionLocator.d.ts +12 -0
- package/serialization/{resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.js → types/AuthConnectionLocator.js} +4 -4
- package/serialization/types/BadRequestErrorBody.d.ts +13 -0
- package/{dist/serialization/resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.js → serialization/types/BadRequestErrorBody.js} +5 -4
- package/serialization/types/BodyAddProjectV1ProjectsAddPostSourceType.d.ts +1 -1
- package/serialization/types/BodyAddProjectV1ProjectsAddPostSourceType.js +1 -1
- package/serialization/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.d.ts +1 -0
- package/serialization/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.js +1 -0
- package/serialization/types/BreakdownTypes.d.ts +1 -1
- package/serialization/types/BreakdownTypes.js +2 -0
- package/serialization/types/BuiltInToolsInput.d.ts +1 -0
- package/serialization/types/BuiltInToolsInput.js +1 -0
- package/serialization/types/BuiltInToolsOutput.d.ts +1 -0
- package/serialization/types/BuiltInToolsOutput.js +1 -0
- package/serialization/types/ChapterResponse.d.ts +1 -0
- package/serialization/types/ChapterResponse.js +1 -0
- package/serialization/types/ChapterWithContentResponseModel.d.ts +1 -0
- package/serialization/types/ChapterWithContentResponseModel.js +1 -0
- package/serialization/types/ForcedAlignmentResponseModel.d.ts +1 -0
- package/serialization/types/ForcedAlignmentResponseModel.js +1 -0
- package/serialization/types/ForcedAlignmentWordResponseModel.d.ts +1 -0
- package/serialization/types/ForcedAlignmentWordResponseModel.js +1 -0
- package/serialization/types/MetricType.d.ts +1 -1
- package/serialization/types/MetricType.js +9 -1
- package/serialization/types/PlayDtmfToolConfig.d.ts +11 -0
- package/serialization/types/PlayDtmfToolConfig.js +41 -0
- package/serialization/types/ProjectExtendedResponse.d.ts +1 -1
- package/serialization/types/ProjectExtendedResponse.js +1 -1
- package/serialization/types/ProjectExtendedResponseModelSourceType.d.ts +1 -1
- package/serialization/types/ProjectExtendedResponseModelSourceType.js +1 -1
- package/serialization/types/ProjectResponseModelSourceType.d.ts +1 -1
- package/serialization/types/ProjectResponseModelSourceType.js +1 -1
- package/serialization/types/SystemToolConfigInputParams.d.ts +5 -1
- package/serialization/types/SystemToolConfigInputParams.js +2 -0
- package/serialization/types/SystemToolConfigOutputParams.d.ts +5 -1
- package/serialization/types/SystemToolConfigOutputParams.js +2 -0
- package/serialization/types/WebhookToolApiSchemaConfigInput.d.ts +2 -0
- package/serialization/types/WebhookToolApiSchemaConfigInput.js +2 -0
- package/serialization/types/WebhookToolApiSchemaConfigOutput.d.ts +2 -0
- package/serialization/types/WebhookToolApiSchemaConfigOutput.js +2 -0
- package/serialization/types/WorkspaceResourceType.d.ts +1 -1
- package/serialization/types/WorkspaceResourceType.js +1 -0
- package/serialization/types/index.d.ts +3 -4
- package/serialization/types/index.js +3 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/play.d.ts +1 -2
- package/wrapper/play.js +69 -36
- package/wrapper/stream.d.ts +1 -2
- package/wrapper/stream.js +64 -37
- package/wrapper/utils.d.ts +2 -0
- package/wrapper/utils.js +41 -0
- package/api/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.d.ts +0 -13
- package/api/resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.d.ts +0 -12
- package/api/resources/workspace/client/requests/index.d.ts +0 -2
- package/api/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.d.ts +0 -7
- package/api/types/DefaultSharingPreferencesResponseModel.d.ts +0 -8
- package/api/types/WorkspaceGroupPermission.d.ts +0 -22
- package/api/types/WorkspaceGroupPermission.js +0 -24
- package/api/types/WorkspaceGroupResponseModel.d.ts +0 -10
- package/core/form-data-utils/toReadableStream.d.ts +0 -1
- package/core/form-data-utils/toReadableStream.js +0 -28
- package/dist/api/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.d.ts +0 -13
- package/dist/api/resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.d.ts +0 -12
- package/dist/api/resources/workspace/client/requests/index.d.ts +0 -2
- package/dist/api/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.d.ts +0 -7
- package/dist/api/types/DefaultSharingPreferencesResponseModel.d.ts +0 -8
- package/dist/api/types/WorkspaceGroupPermission.d.ts +0 -22
- package/dist/api/types/WorkspaceGroupPermission.js +0 -24
- package/dist/api/types/WorkspaceGroupResponseModel.d.ts +0 -10
- package/dist/core/form-data-utils/toReadableStream.d.ts +0 -1
- package/dist/core/form-data-utils/toReadableStream.js +0 -28
- package/dist/serialization/resources/workspace/client/getShareOptions.d.ts +0 -11
- package/dist/serialization/resources/workspace/client/index.d.ts +0 -2
- package/dist/serialization/resources/workspace/client/index.js +0 -41
- package/dist/serialization/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.d.ts +0 -12
- package/dist/serialization/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.js +0 -43
- package/dist/serialization/resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.d.ts +0 -12
- package/dist/serialization/resources/workspace/client/requests/index.d.ts +0 -2
- package/dist/serialization/resources/workspace/client/requests/index.js +0 -7
- package/dist/serialization/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.d.ts +0 -12
- package/dist/serialization/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.js +0 -43
- package/dist/serialization/types/DefaultSharingPreferencesResponseModel.d.ts +0 -13
- package/dist/serialization/types/DefaultSharingPreferencesResponseModel.js +0 -44
- package/dist/serialization/types/WorkspaceGroupPermission.d.ts +0 -10
- package/dist/serialization/types/WorkspaceGroupPermission.js +0 -58
- package/dist/serialization/types/WorkspaceGroupResponseModel.d.ts +0 -16
- package/dist/serialization/types/WorkspaceGroupResponseModel.js +0 -47
- package/serialization/resources/workspace/client/getShareOptions.d.ts +0 -11
- package/serialization/resources/workspace/client/index.d.ts +0 -2
- package/serialization/resources/workspace/client/index.js +0 -41
- package/serialization/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.d.ts +0 -12
- package/serialization/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.js +0 -43
- package/serialization/resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.d.ts +0 -12
- package/serialization/resources/workspace/client/requests/index.d.ts +0 -2
- package/serialization/resources/workspace/client/requests/index.js +0 -7
- package/serialization/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.d.ts +0 -12
- package/serialization/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.js +0 -43
- package/serialization/types/DefaultSharingPreferencesResponseModel.d.ts +0 -13
- package/serialization/types/DefaultSharingPreferencesResponseModel.js +0 -44
- package/serialization/types/WorkspaceGroupPermission.d.ts +0 -10
- package/serialization/types/WorkspaceGroupPermission.js +0 -58
- package/serialization/types/WorkspaceGroupResponseModel.d.ts +0 -16
- package/serialization/types/WorkspaceGroupResponseModel.js +0 -47
- /package/api/resources/{workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.js → conversationalAi/resources/knowledgeBase/resources/documents/client/requests/DocumentsGetRequest.js} +0 -0
- /package/api/resources/{workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.js → voices/resources/pvc/resources/samples/resources/audio/client/requests/AudioGetRequest.js} +0 -0
- /package/api/resources/{workspace → voices/resources/pvc/resources/samples/resources/audio}/client/requests/index.js +0 -0
- /package/api/types/{BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.js → AuthConnectionLocator.js} +0 -0
- /package/api/types/{DefaultSharingPreferencesResponseModel.js → BadRequestErrorBody.js} +0 -0
- /package/api/types/{WorkspaceGroupResponseModel.js → PlayDtmfToolConfig.js} +0 -0
- /package/{dist/api/resources/workspace/client/requests/index.js → core/file.js} +0 -0
- /package/dist/api/resources/{workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.js → conversationalAi/resources/knowledgeBase/resources/documents/client/requests/DocumentsGetRequest.js} +0 -0
- /package/dist/api/resources/{workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.js → voices/resources/pvc/resources/samples/resources/audio/client/requests/AudioGetRequest.js} +0 -0
- /package/dist/api/types/{BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.js → AuthConnectionLocator.js} +0 -0
- /package/dist/api/types/{DefaultSharingPreferencesResponseModel.js → BadRequestErrorBody.js} +0 -0
- /package/dist/api/types/{WorkspaceGroupResponseModel.js → PlayDtmfToolConfig.js} +0 -0
package/Client.d.ts
CHANGED
|
@@ -19,11 +19,11 @@ import { Models } from "./api/resources/models/client/Client";
|
|
|
19
19
|
import { AudioNative } from "./api/resources/audioNative/client/Client";
|
|
20
20
|
import { Usage } from "./api/resources/usage/client/Client";
|
|
21
21
|
import { PronunciationDictionaries } from "./api/resources/pronunciationDictionaries/client/Client";
|
|
22
|
-
import { Workspace } from "./api/resources/workspace/client/Client";
|
|
23
22
|
import { Webhooks } from "./api/resources/webhooks/client/Client";
|
|
24
23
|
import { SpeechToText } from "./api/resources/speechToText/client/Client";
|
|
25
24
|
import { ForcedAlignment } from "./api/resources/forcedAlignment/client/Client";
|
|
26
25
|
import { ConversationalAi } from "./api/resources/conversationalAi/client/Client";
|
|
26
|
+
import { Workspace } from "./api/resources/workspace/client/Client";
|
|
27
27
|
export declare namespace ElevenLabsClient {
|
|
28
28
|
interface Options {
|
|
29
29
|
environment?: core.Supplier<environments.ElevenLabsEnvironment | environments.ElevenLabsEnvironmentUrls>;
|
|
@@ -65,11 +65,11 @@ export declare class ElevenLabsClient {
|
|
|
65
65
|
protected _audioNative: AudioNative | undefined;
|
|
66
66
|
protected _usage: Usage | undefined;
|
|
67
67
|
protected _pronunciationDictionaries: PronunciationDictionaries | undefined;
|
|
68
|
-
protected _workspace: Workspace | undefined;
|
|
69
68
|
protected _webhooks: Webhooks | undefined;
|
|
70
69
|
protected _speechToText: SpeechToText | undefined;
|
|
71
70
|
protected _forcedAlignment: ForcedAlignment | undefined;
|
|
72
71
|
protected _conversationalAi: ConversationalAi | undefined;
|
|
72
|
+
protected _workspace: Workspace | undefined;
|
|
73
73
|
constructor(_options?: ElevenLabsClient.Options);
|
|
74
74
|
get history(): History;
|
|
75
75
|
get textToSoundEffects(): TextToSoundEffects;
|
|
@@ -87,9 +87,9 @@ export declare class ElevenLabsClient {
|
|
|
87
87
|
get audioNative(): AudioNative;
|
|
88
88
|
get usage(): Usage;
|
|
89
89
|
get pronunciationDictionaries(): PronunciationDictionaries;
|
|
90
|
-
get workspace(): Workspace;
|
|
91
90
|
get webhooks(): Webhooks;
|
|
92
91
|
get speechToText(): SpeechToText;
|
|
93
92
|
get forcedAlignment(): ForcedAlignment;
|
|
94
93
|
get conversationalAi(): ConversationalAi;
|
|
94
|
+
get workspace(): Workspace;
|
|
95
95
|
}
|
package/Client.js
CHANGED
|
@@ -55,19 +55,19 @@ const Client_13 = require("./api/resources/models/client/Client");
|
|
|
55
55
|
const Client_14 = require("./api/resources/audioNative/client/Client");
|
|
56
56
|
const Client_15 = require("./api/resources/usage/client/Client");
|
|
57
57
|
const Client_16 = require("./api/resources/pronunciationDictionaries/client/Client");
|
|
58
|
-
const Client_17 = require("./api/resources/
|
|
59
|
-
const Client_18 = require("./api/resources/
|
|
60
|
-
const Client_19 = require("./api/resources/
|
|
61
|
-
const Client_20 = require("./api/resources/
|
|
62
|
-
const Client_21 = require("./api/resources/
|
|
58
|
+
const Client_17 = require("./api/resources/webhooks/client/Client");
|
|
59
|
+
const Client_18 = require("./api/resources/speechToText/client/Client");
|
|
60
|
+
const Client_19 = require("./api/resources/forcedAlignment/client/Client");
|
|
61
|
+
const Client_20 = require("./api/resources/conversationalAi/client/Client");
|
|
62
|
+
const Client_21 = require("./api/resources/workspace/client/Client");
|
|
63
63
|
class ElevenLabsClient {
|
|
64
64
|
constructor(_options = {}) {
|
|
65
65
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
66
66
|
"xi-api-key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
|
|
67
67
|
"X-Fern-Language": "JavaScript",
|
|
68
68
|
"X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
|
|
69
|
-
"X-Fern-SDK-Version": "v2.
|
|
70
|
-
"User-Agent": "@elevenlabs/elevenlabs-js/v2.
|
|
69
|
+
"X-Fern-SDK-Version": "v2.5.0",
|
|
70
|
+
"User-Agent": "@elevenlabs/elevenlabs-js/v2.5.0",
|
|
71
71
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
72
72
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
73
73
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -136,25 +136,25 @@ class ElevenLabsClient {
|
|
|
136
136
|
var _a;
|
|
137
137
|
return ((_a = this._pronunciationDictionaries) !== null && _a !== void 0 ? _a : (this._pronunciationDictionaries = new Client_16.PronunciationDictionaries(this._options)));
|
|
138
138
|
}
|
|
139
|
-
get workspace() {
|
|
140
|
-
var _a;
|
|
141
|
-
return ((_a = this._workspace) !== null && _a !== void 0 ? _a : (this._workspace = new Client_17.Workspace(this._options)));
|
|
142
|
-
}
|
|
143
139
|
get webhooks() {
|
|
144
140
|
var _a;
|
|
145
|
-
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new
|
|
141
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_17.Webhooks(this._options)));
|
|
146
142
|
}
|
|
147
143
|
get speechToText() {
|
|
148
144
|
var _a;
|
|
149
|
-
return ((_a = this._speechToText) !== null && _a !== void 0 ? _a : (this._speechToText = new
|
|
145
|
+
return ((_a = this._speechToText) !== null && _a !== void 0 ? _a : (this._speechToText = new Client_18.SpeechToText(this._options)));
|
|
150
146
|
}
|
|
151
147
|
get forcedAlignment() {
|
|
152
148
|
var _a;
|
|
153
|
-
return ((_a = this._forcedAlignment) !== null && _a !== void 0 ? _a : (this._forcedAlignment = new
|
|
149
|
+
return ((_a = this._forcedAlignment) !== null && _a !== void 0 ? _a : (this._forcedAlignment = new Client_19.ForcedAlignment(this._options)));
|
|
154
150
|
}
|
|
155
151
|
get conversationalAi() {
|
|
156
152
|
var _a;
|
|
157
|
-
return ((_a = this._conversationalAi) !== null && _a !== void 0 ? _a : (this._conversationalAi = new
|
|
153
|
+
return ((_a = this._conversationalAi) !== null && _a !== void 0 ? _a : (this._conversationalAi = new Client_20.ConversationalAi(this._options)));
|
|
154
|
+
}
|
|
155
|
+
get workspace() {
|
|
156
|
+
var _a;
|
|
157
|
+
return ((_a = this._workspace) !== null && _a !== void 0 ? _a : (this._workspace = new Client_21.Workspace(this._options)));
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
exports.ElevenLabsClient = ElevenLabsClient;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../errors/index";
|
|
5
|
+
import * as ElevenLabs from "../index";
|
|
5
6
|
import * as core from "../../core";
|
|
6
7
|
export declare class BadRequestError extends errors.ElevenLabsError {
|
|
7
|
-
constructor(body
|
|
8
|
+
constructor(body: ElevenLabs.BadRequestErrorBody, rawResponse?: core.RawResponse);
|
|
8
9
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as core from "../../../../../core";
|
|
5
5
|
import * as ElevenLabs from "../../../../index";
|
|
6
6
|
export interface BodyAudioIsolationStreamV1AudioIsolationStreamPost {
|
|
7
|
-
audio:
|
|
7
|
+
audio: core.FileLike;
|
|
8
8
|
/** The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. */
|
|
9
9
|
fileFormat?: ElevenLabs.AudioIsolationStreamRequestFileFormat;
|
|
10
10
|
}
|
package/api/resources/audioIsolation/client/requests/BodyAudioIsolationV1AudioIsolationPost.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as core from "../../../../../core";
|
|
5
5
|
import * as ElevenLabs from "../../../../index";
|
|
6
6
|
export interface BodyAudioIsolationV1AudioIsolationPost {
|
|
7
|
-
audio:
|
|
7
|
+
audio: core.FileLike;
|
|
8
8
|
/** The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. */
|
|
9
9
|
fileFormat?: ElevenLabs.AudioIsolationConvertRequestFileFormat;
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as core from "../../../../../core";
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
@@ -29,7 +29,7 @@ export interface BodyCreatesAudioNativeEnabledProjectV1AudioNativePost {
|
|
|
29
29
|
voiceId?: string;
|
|
30
30
|
/** TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used. */
|
|
31
31
|
modelId?: string;
|
|
32
|
-
file?:
|
|
32
|
+
file?: core.FileLike | undefined;
|
|
33
33
|
/** Whether to auto convert the project to audio or not. */
|
|
34
34
|
autoConvert?: boolean;
|
|
35
35
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as core from "../../../../../core";
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {}
|
|
8
8
|
*/
|
|
9
9
|
export interface BodyUpdateAudioNativeProjectContentV1AudioNativeProjectIdContentPost {
|
|
10
|
-
file?:
|
|
10
|
+
file?: core.FileLike | undefined;
|
|
11
11
|
/** Whether to auto convert the project to audio or not. */
|
|
12
12
|
autoConvert?: boolean;
|
|
13
13
|
/** Whether to auto publish the new project snapshot after it's converted. */
|
|
@@ -142,6 +142,10 @@ class ConversationalAi {
|
|
|
142
142
|
__addToKnowledgeBase(request, requestOptions) {
|
|
143
143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
144
144
|
var _a, _b, _c;
|
|
145
|
+
const _queryParams = {};
|
|
146
|
+
if (request.agentId != null) {
|
|
147
|
+
_queryParams["agent_id"] = request.agentId;
|
|
148
|
+
}
|
|
145
149
|
const _request = yield core.newFormData();
|
|
146
150
|
if (request.name != null) {
|
|
147
151
|
_request.append("name", request.name);
|
|
@@ -157,6 +161,7 @@ class ConversationalAi {
|
|
|
157
161
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, "v1/convai/knowledge-base"),
|
|
158
162
|
method: "POST",
|
|
159
163
|
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
164
|
+
queryParameters: _queryParams,
|
|
160
165
|
requestType: "file",
|
|
161
166
|
duplex: _maybeEncodedRequest.duplex,
|
|
162
167
|
body: _maybeEncodedRequest.body,
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as core from "../../../../../core";
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {}
|
|
8
8
|
*/
|
|
9
9
|
export interface BodyAddToKnowledgeBaseV1ConvaiKnowledgeBasePost {
|
|
10
|
+
agentId?: string;
|
|
10
11
|
/** A custom, human-readable name for the document. */
|
|
11
12
|
name?: string;
|
|
12
13
|
/** URL to a page of documentation that the agent will have access to in order to interact with users. */
|
|
13
14
|
url?: string;
|
|
14
|
-
file?:
|
|
15
|
+
file?: core.FileLike | undefined;
|
|
15
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as core from "../../../../../../../../../../../core";
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
@@ -9,5 +9,5 @@ import * as fs from "fs";
|
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface BodyPostAgentAvatarV1ConvaiAgentsAgentIdAvatarPost {
|
|
12
|
-
avatarFile:
|
|
12
|
+
avatarFile: core.FileLike;
|
|
13
13
|
}
|
|
@@ -82,6 +82,7 @@ export declare class Documents {
|
|
|
82
82
|
* Get details about a specific documentation making up the agent's knowledge base
|
|
83
83
|
*
|
|
84
84
|
* @param {string} documentationId - The id of a document from the knowledge base. This is returned on document addition.
|
|
85
|
+
* @param {ElevenLabs.conversationalAi.knowledgeBase.DocumentsGetRequest} request
|
|
85
86
|
* @param {Documents.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
87
|
*
|
|
87
88
|
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
@@ -89,7 +90,7 @@ export declare class Documents {
|
|
|
89
90
|
* @example
|
|
90
91
|
* await client.conversationalAi.knowledgeBase.documents.get("21m00Tcm4TlvDq8ikWAM")
|
|
91
92
|
*/
|
|
92
|
-
get(documentationId: string, requestOptions?: Documents.RequestOptions): core.HttpResponsePromise<ElevenLabs.conversationalAi.knowledgeBase.DocumentsGetResponse>;
|
|
93
|
+
get(documentationId: string, request?: ElevenLabs.conversationalAi.knowledgeBase.DocumentsGetRequest, requestOptions?: Documents.RequestOptions): core.HttpResponsePromise<ElevenLabs.conversationalAi.knowledgeBase.DocumentsGetResponse>;
|
|
93
94
|
private __get;
|
|
94
95
|
/**
|
|
95
96
|
* Delete a document from the knowledge base
|
package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.js
CHANGED
|
@@ -300,6 +300,7 @@ class Documents {
|
|
|
300
300
|
* Get details about a specific documentation making up the agent's knowledge base
|
|
301
301
|
*
|
|
302
302
|
* @param {string} documentationId - The id of a document from the knowledge base. This is returned on document addition.
|
|
303
|
+
* @param {ElevenLabs.conversationalAi.knowledgeBase.DocumentsGetRequest} request
|
|
303
304
|
* @param {Documents.RequestOptions} requestOptions - Request-specific configuration.
|
|
304
305
|
*
|
|
305
306
|
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
@@ -307,16 +308,22 @@ class Documents {
|
|
|
307
308
|
* @example
|
|
308
309
|
* await client.conversationalAi.knowledgeBase.documents.get("21m00Tcm4TlvDq8ikWAM")
|
|
309
310
|
*/
|
|
310
|
-
get(documentationId, requestOptions) {
|
|
311
|
-
return core.HttpResponsePromise.fromPromise(this.__get(documentationId, requestOptions));
|
|
311
|
+
get(documentationId, request = {}, requestOptions) {
|
|
312
|
+
return core.HttpResponsePromise.fromPromise(this.__get(documentationId, request, requestOptions));
|
|
312
313
|
}
|
|
313
|
-
__get(
|
|
314
|
-
return __awaiter(this,
|
|
314
|
+
__get(documentationId_1) {
|
|
315
|
+
return __awaiter(this, arguments, void 0, function* (documentationId, request = {}, requestOptions) {
|
|
315
316
|
var _a, _b, _c;
|
|
317
|
+
const { agentId } = request;
|
|
318
|
+
const _queryParams = {};
|
|
319
|
+
if (agentId != null) {
|
|
320
|
+
_queryParams["agent_id"] = agentId;
|
|
321
|
+
}
|
|
316
322
|
const _response = yield core.fetcher({
|
|
317
323
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, `v1/convai/knowledge-base/${encodeURIComponent(documentationId)}`),
|
|
318
324
|
method: "GET",
|
|
319
325
|
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
326
|
+
queryParameters: _queryParams,
|
|
320
327
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
321
328
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
322
329
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as core from "../../../../../../../../../core";
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
@@ -9,7 +9,7 @@ import * as fs from "fs";
|
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface BodyCreateFileDocumentV1ConvaiKnowledgeBaseFilePost {
|
|
12
|
-
file:
|
|
12
|
+
file: core.FileLike;
|
|
13
13
|
/** A custom, human-readable name for the document. */
|
|
14
14
|
name?: string;
|
|
15
15
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { type BodyCreateUrlDocumentV1ConvaiKnowledgeBaseUrlPost } from "./BodyCreateUrlDocumentV1ConvaiKnowledgeBaseUrlPost";
|
|
2
2
|
export { type BodyCreateFileDocumentV1ConvaiKnowledgeBaseFilePost } from "./BodyCreateFileDocumentV1ConvaiKnowledgeBaseFilePost";
|
|
3
3
|
export { type BodyCreateTextDocumentV1ConvaiKnowledgeBaseTextPost } from "./BodyCreateTextDocumentV1ConvaiKnowledgeBaseTextPost";
|
|
4
|
+
export { type DocumentsGetRequest } from "./DocumentsGetRequest";
|
|
4
5
|
export { type DocumentsDeleteRequest } from "./DocumentsDeleteRequest";
|
|
5
6
|
export { type BodyUpdateDocumentV1ConvaiKnowledgeBaseDocumentationIdPatch } from "./BodyUpdateDocumentV1ConvaiKnowledgeBaseDocumentationIdPatch";
|
|
6
7
|
export { type DocumentsGetAgentsRequest } from "./DocumentsGetAgentsRequest";
|
|
@@ -366,7 +366,7 @@ class PhoneNumbers {
|
|
|
366
366
|
return __awaiter(this, void 0, void 0, function* () {
|
|
367
367
|
var _a, _b, _c;
|
|
368
368
|
const _response = yield core.fetcher({
|
|
369
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, "v1/convai/phone-numbers
|
|
369
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, "v1/convai/phone-numbers"),
|
|
370
370
|
method: "GET",
|
|
371
371
|
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
372
372
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
@@ -409,7 +409,7 @@ class PhoneNumbers {
|
|
|
409
409
|
rawResponse: _response.rawResponse,
|
|
410
410
|
});
|
|
411
411
|
case "timeout":
|
|
412
|
-
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/phone-numbers
|
|
412
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/phone-numbers.");
|
|
413
413
|
case "unknown":
|
|
414
414
|
throw new errors.ElevenLabsError({
|
|
415
415
|
message: _response.error.errorMessage,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as core from "../../../../../core";
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {}
|
|
8
8
|
*/
|
|
9
9
|
export interface BodyDubAVideoOrAnAudioFileV1DubbingPost {
|
|
10
|
-
file?:
|
|
11
|
-
csvFile?:
|
|
12
|
-
foregroundAudioFile?:
|
|
13
|
-
backgroundAudioFile?:
|
|
10
|
+
file?: core.FileLike | undefined;
|
|
11
|
+
csvFile?: core.FileLike | undefined;
|
|
12
|
+
foregroundAudioFile?: core.FileLike | undefined;
|
|
13
|
+
backgroundAudioFile?: core.FileLike | undefined;
|
|
14
14
|
/** Name of the dubbing project. */
|
|
15
15
|
name?: string;
|
|
16
16
|
/** URL of the source video/audio file. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as core from "../../../../../core";
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
@@ -10,7 +10,7 @@ import * as fs from "fs";
|
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export interface BodyCreateForcedAlignmentV1ForcedAlignmentPost {
|
|
13
|
-
file:
|
|
13
|
+
file: core.FileLike;
|
|
14
14
|
/** The text to align with the audio. The input text can be in any format, however diarization is not supported at this time. */
|
|
15
15
|
text: string;
|
|
16
16
|
/** If true, the file will be streamed to the server and processed in chunks. This is useful for large files that cannot be loaded into memory. The default is false. */
|
|
@@ -375,7 +375,12 @@ class History {
|
|
|
375
375
|
if (_response.error.reason === "status-code") {
|
|
376
376
|
switch (_response.error.statusCode) {
|
|
377
377
|
case 400:
|
|
378
|
-
throw new ElevenLabs.BadRequestError(_response.error.body,
|
|
378
|
+
throw new ElevenLabs.BadRequestError(serializers.BadRequestErrorBody.parseOrThrow(_response.error.body, {
|
|
379
|
+
unrecognizedObjectKeys: "passthrough",
|
|
380
|
+
allowUnrecognizedUnionMembers: true,
|
|
381
|
+
allowUnrecognizedEnumValues: true,
|
|
382
|
+
breadcrumbsPrefix: ["response"],
|
|
383
|
+
}), _response.rawResponse);
|
|
379
384
|
case 422:
|
|
380
385
|
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
381
386
|
unrecognizedObjectKeys: "passthrough",
|
package/api/resources/index.d.ts
CHANGED
|
@@ -47,7 +47,6 @@ export * from "./dubbing/client/requests";
|
|
|
47
47
|
export * from "./audioNative/client/requests";
|
|
48
48
|
export * from "./usage/client/requests";
|
|
49
49
|
export * from "./pronunciationDictionaries/client/requests";
|
|
50
|
-
export * from "./workspace/client/requests";
|
|
51
50
|
export * from "./webhooks/client/requests";
|
|
52
51
|
export * from "./speechToText/client/requests";
|
|
53
52
|
export * from "./forcedAlignment/client/requests";
|
package/api/resources/index.js
CHANGED
|
@@ -86,7 +86,6 @@ __exportStar(require("./dubbing/client/requests"), exports);
|
|
|
86
86
|
__exportStar(require("./audioNative/client/requests"), exports);
|
|
87
87
|
__exportStar(require("./usage/client/requests"), exports);
|
|
88
88
|
__exportStar(require("./pronunciationDictionaries/client/requests"), exports);
|
|
89
|
-
__exportStar(require("./workspace/client/requests"), exports);
|
|
90
89
|
__exportStar(require("./webhooks/client/requests"), exports);
|
|
91
90
|
__exportStar(require("./speechToText/client/requests"), exports);
|
|
92
91
|
__exportStar(require("./forcedAlignment/client/requests"), exports);
|
|
@@ -306,7 +306,7 @@ class PronunciationDictionaries {
|
|
|
306
306
|
return __awaiter(this, void 0, void 0, function* () {
|
|
307
307
|
var _a, _b, _c;
|
|
308
308
|
const _response = yield core.fetcher({
|
|
309
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, `v1/pronunciation-dictionaries/${encodeURIComponent(pronunciationDictionaryId)}
|
|
309
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, `v1/pronunciation-dictionaries/${encodeURIComponent(pronunciationDictionaryId)}`),
|
|
310
310
|
method: "GET",
|
|
311
311
|
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
312
312
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
@@ -349,7 +349,7 @@ class PronunciationDictionaries {
|
|
|
349
349
|
rawResponse: _response.rawResponse,
|
|
350
350
|
});
|
|
351
351
|
case "timeout":
|
|
352
|
-
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/pronunciation-dictionaries/{pronunciation_dictionary_id}
|
|
352
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/pronunciation-dictionaries/{pronunciation_dictionary_id}.");
|
|
353
353
|
case "unknown":
|
|
354
354
|
throw new errors.ElevenLabsError({
|
|
355
355
|
message: _response.error.errorMessage,
|
|
@@ -392,7 +392,7 @@ class PronunciationDictionaries {
|
|
|
392
392
|
_queryParams["sort_direction"] = sortDirection;
|
|
393
393
|
}
|
|
394
394
|
const _response = yield core.fetcher({
|
|
395
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, "v1/pronunciation-dictionaries
|
|
395
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, "v1/pronunciation-dictionaries"),
|
|
396
396
|
method: "GET",
|
|
397
397
|
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
398
398
|
queryParameters: _queryParams,
|
|
@@ -436,7 +436,7 @@ class PronunciationDictionaries {
|
|
|
436
436
|
rawResponse: _response.rawResponse,
|
|
437
437
|
});
|
|
438
438
|
case "timeout":
|
|
439
|
-
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/pronunciation-dictionaries
|
|
439
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/pronunciation-dictionaries.");
|
|
440
440
|
case "unknown":
|
|
441
441
|
throw new errors.ElevenLabsError({
|
|
442
442
|
message: _response.error.errorMessage,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as core from "../../../../../core";
|
|
5
5
|
import * as ElevenLabs from "../../../../index";
|
|
6
6
|
/**
|
|
7
7
|
* @example
|
|
@@ -12,7 +12,7 @@ import * as ElevenLabs from "../../../../index";
|
|
|
12
12
|
export interface BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromFilePost {
|
|
13
13
|
/** The name of the pronunciation dictionary, used for identification only. */
|
|
14
14
|
name: string;
|
|
15
|
-
file?:
|
|
15
|
+
file?: core.FileLike | undefined;
|
|
16
16
|
/** A description of the pronunciation dictionary, used for identification only. */
|
|
17
17
|
description?: string;
|
|
18
18
|
/** Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as fs from "fs";
|
|
5
4
|
import * as ElevenLabs from "../../../../index";
|
|
5
|
+
import * as core from "../../../../../core";
|
|
6
6
|
/**
|
|
7
7
|
* @example
|
|
8
8
|
* {
|
|
@@ -31,7 +31,7 @@ export interface BodySpeechToSpeechStreamingV1SpeechToSpeechVoiceIdStreamPost {
|
|
|
31
31
|
* Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
|
|
32
32
|
*/
|
|
33
33
|
outputFormat?: ElevenLabs.SpeechToSpeechStreamRequestOutputFormat;
|
|
34
|
-
audio:
|
|
34
|
+
audio: core.FileLike;
|
|
35
35
|
/** Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. */
|
|
36
36
|
modelId?: string;
|
|
37
37
|
/** Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as fs from "fs";
|
|
5
4
|
import * as ElevenLabs from "../../../../index";
|
|
5
|
+
import * as core from "../../../../../core";
|
|
6
6
|
/**
|
|
7
7
|
* @example
|
|
8
8
|
* {
|
|
@@ -31,7 +31,7 @@ export interface BodySpeechToSpeechV1SpeechToSpeechVoiceIdPost {
|
|
|
31
31
|
* Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
|
|
32
32
|
*/
|
|
33
33
|
outputFormat?: ElevenLabs.SpeechToSpeechConvertRequestOutputFormat;
|
|
34
|
-
audio:
|
|
34
|
+
audio: core.FileLike;
|
|
35
35
|
/** Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. */
|
|
36
36
|
modelId?: string;
|
|
37
37
|
/** Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. */
|
|
@@ -11,6 +11,8 @@ export declare namespace SpeechToText {
|
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
12
|
/** Override the xi-api-key header */
|
|
13
13
|
apiKey?: core.Supplier<string | undefined>;
|
|
14
|
+
/** Additional headers to include in requests. */
|
|
15
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
14
16
|
}
|
|
15
17
|
interface RequestOptions {
|
|
16
18
|
/** The maximum time to wait for a response in seconds. */
|
|
@@ -22,7 +24,7 @@ export declare namespace SpeechToText {
|
|
|
22
24
|
/** Override the xi-api-key header */
|
|
23
25
|
apiKey?: string | undefined;
|
|
24
26
|
/** Additional headers to include in the request. */
|
|
25
|
-
headers?: Record<string, string>;
|
|
27
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
export declare class SpeechToText {
|
|
@@ -54,6 +54,7 @@ const core = __importStar(require("../../../../core"));
|
|
|
54
54
|
const ElevenLabs = __importStar(require("../../../index"));
|
|
55
55
|
const serializers = __importStar(require("../../../../serialization/index"));
|
|
56
56
|
const json_1 = require("../../../../core/json");
|
|
57
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
57
58
|
const url_join_1 = __importDefault(require("url-join"));
|
|
58
59
|
const errors = __importStar(require("../../../../errors/index"));
|
|
59
60
|
class SpeechToText {
|
|
@@ -78,7 +79,7 @@ class SpeechToText {
|
|
|
78
79
|
}
|
|
79
80
|
__convert(request, requestOptions) {
|
|
80
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
var _a, _b;
|
|
82
|
+
var _a, _b, _c;
|
|
82
83
|
const _queryParams = {};
|
|
83
84
|
if (request.enableLogging != null) {
|
|
84
85
|
_queryParams["enable_logging"] = request.enableLogging.toString();
|
|
@@ -105,11 +106,12 @@ class SpeechToText {
|
|
|
105
106
|
if (request.diarize != null) {
|
|
106
107
|
_request.append("diarize", request.diarize.toString());
|
|
107
108
|
}
|
|
108
|
-
|
|
109
|
+
if (request.diarizationThreshold != null) {
|
|
110
|
+
_request.append("diarization_threshold", request.diarizationThreshold.toString());
|
|
111
|
+
}
|
|
109
112
|
if (request.additionalFormats != null) {
|
|
110
|
-
_request.append("additional_formats", (0, json_1.toJson)(
|
|
113
|
+
_request.append("additional_formats", (0, json_1.toJson)(request.additionalFormats));
|
|
111
114
|
}
|
|
112
|
-
// end of customization
|
|
113
115
|
if (request.fileFormat != null) {
|
|
114
116
|
_request.append("file_format", serializers.SpeechToTextConvertRequestFileFormat.jsonOrThrow(request.fileFormat, {
|
|
115
117
|
unrecognizedObjectKeys: "strip",
|
|
@@ -121,13 +123,14 @@ class SpeechToText {
|
|
|
121
123
|
if (request.webhook != null) {
|
|
122
124
|
_request.append("webhook", request.webhook.toString());
|
|
123
125
|
}
|
|
126
|
+
if (request.temperature != null) {
|
|
127
|
+
_request.append("temperature", request.temperature.toString());
|
|
128
|
+
}
|
|
124
129
|
const _maybeEncodedRequest = yield _request.getRequest();
|
|
125
130
|
const _response = yield core.fetcher({
|
|
126
131
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, "v1/speech-to-text"),
|
|
127
132
|
method: "POST",
|
|
128
|
-
headers:
|
|
129
|
-
? yield core.Supplier.get(this._options.apiKey)
|
|
130
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "2.2.1", "User-Agent": "@elevenlabs/elevenlabs-js/2.2.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
133
|
+
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
131
134
|
queryParameters: _queryParams,
|
|
132
135
|
requestType: "file",
|
|
133
136
|
duplex: _maybeEncodedRequest.duplex,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as core from "../../../../../core";
|
|
5
5
|
import * as ElevenLabs from "../../../../index";
|
|
6
6
|
/**
|
|
7
7
|
* @example
|
|
@@ -16,7 +16,7 @@ export interface BodySpeechToTextV1SpeechToTextPost {
|
|
|
16
16
|
enableLogging?: boolean;
|
|
17
17
|
/** The ID of the model to use for transcription, currently only 'scribe_v1' and 'scribe_v1_experimental' are available. */
|
|
18
18
|
modelId: string;
|
|
19
|
-
file?:
|
|
19
|
+
file?: core.FileLike | undefined;
|
|
20
20
|
/** An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. */
|
|
21
21
|
languageCode?: string;
|
|
22
22
|
/** Whether to tag audio events like (laughter), (footsteps), etc. in the transcription. */
|
|
@@ -27,6 +27,8 @@ export interface BodySpeechToTextV1SpeechToTextPost {
|
|
|
27
27
|
timestampsGranularity?: ElevenLabs.SpeechToTextConvertRequestTimestampsGranularity;
|
|
28
28
|
/** Whether to annotate which speaker is currently talking in the uploaded file. */
|
|
29
29
|
diarize?: boolean;
|
|
30
|
+
/** Diarization threshold to apply during speaker diarization. A higher value means there will be a lower chance of one speaker being diarized as two different speakers but also a higher chance of two different speakers being diarized as one speaker (less total speakers predicted). A low value means there will be a higher chance of one speaker being diarized as two different speakers but also a lower chance of two different speakers being diarized as one speaker (more total speakers predicted). Can only be set when diarize=True and num_speakers=None. Defaults to None, in which case we will choose a threshold based on the model_id (0.22 usually). */
|
|
31
|
+
diarizationThreshold?: number;
|
|
30
32
|
/** A list of additional formats to export the transcript to. */
|
|
31
33
|
additionalFormats?: ElevenLabs.AdditionalFormats;
|
|
32
34
|
/** The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. */
|