hume 0.15.9 → 0.15.10
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/dist/cjs/BaseClient.d.ts +13 -4
- package/dist/cjs/BaseClient.js +59 -0
- package/dist/cjs/Client.d.ts +13 -13
- package/dist/cjs/Client.js +6 -47
- package/dist/cjs/api/resources/empathicVoice/client/Client.d.ts +27 -27
- package/dist/cjs/api/resources/empathicVoice/client/Client.js +13 -12
- package/dist/cjs/api/resources/empathicVoice/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/empathicVoice/errors/UnprocessableEntityError.js +5 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chat/client/Client.d.ts +5 -5
- package/dist/cjs/api/resources/empathicVoice/resources/chat/client/Client.js +3 -3
- package/dist/cjs/api/resources/empathicVoice/resources/chat/client/index.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chat/client/index.js +2 -2
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +17 -26
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/Client.js +48 -136
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetAudioRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetChatGroupRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupEventsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupsRequest.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/resources/chats/client/Client.d.ts +13 -20
- package/dist/cjs/api/resources/empathicVoice/resources/chats/client/Client.js +32 -95
- package/dist/cjs/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatEventsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/Client.d.ts +34 -83
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/Client.js +64 -245
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/ConfigsListConfigVersionsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +4 -16
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +3 -14
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersionDescription.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/controlPlane/client/Client.d.ts +7 -7
- package/dist/cjs/api/resources/empathicVoice/resources/controlPlane/client/Client.js +6 -19
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +34 -83
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/Client.js +64 -245
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PostedPrompt.d.ts +2 -8
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersion.d.ts +2 -8
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersionDescription.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PromptsListPromptVersionsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/tools/client/Client.d.ts +34 -83
- package/dist/cjs/api/resources/empathicVoice/resources/tools/client/Client.js +64 -245
- package/dist/cjs/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedTool.d.ts +4 -8
- package/dist/cjs/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersion.d.ts +4 -8
- package/dist/cjs/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersionDescription.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/types/AssistantEnd.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/types/AssistantInput.d.ts +2 -5
- package/dist/cjs/api/resources/empathicVoice/types/AssistantMessage.d.ts +2 -2
- package/dist/cjs/api/resources/empathicVoice/types/AssistantProsody.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/types/AudioInput.d.ts +6 -4
- package/dist/cjs/api/resources/empathicVoice/types/AudioOutput.d.ts +1 -4
- package/dist/cjs/api/resources/empathicVoice/types/ChatMetadata.d.ts +3 -5
- package/dist/cjs/api/resources/empathicVoice/types/ConnectSessionSettings.d.ts +8 -4
- package/dist/cjs/api/resources/empathicVoice/types/ConnectSessionSettingsAudio.d.ts +3 -3
- package/dist/cjs/api/resources/empathicVoice/types/ConnectSessionSettingsContext.d.ts +9 -3
- package/dist/cjs/api/resources/empathicVoice/types/Context.d.ts +9 -3
- package/dist/cjs/api/resources/empathicVoice/types/ControlPlanePublishEvent.d.ts +1 -36
- package/dist/cjs/api/resources/empathicVoice/types/JsonMessage.d.ts +1 -50
- package/dist/cjs/api/resources/empathicVoice/types/PauseAssistantMessage.d.ts +2 -4
- package/dist/cjs/api/resources/empathicVoice/types/PostedBuiltinTool.d.ts +1 -9
- package/dist/cjs/api/resources/empathicVoice/types/PostedBuiltinToolName.d.ts +0 -8
- package/dist/cjs/api/resources/empathicVoice/types/PostedBuiltinToolName.js +0 -8
- package/dist/cjs/api/resources/empathicVoice/types/PostedEllmModel.d.ts +1 -5
- package/dist/cjs/api/resources/empathicVoice/types/PostedEventMessageSpec.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/PostedEventMessageSpecs.d.ts +1 -14
- package/dist/cjs/api/resources/empathicVoice/types/PostedLanguageModel.d.ts +1 -7
- package/dist/cjs/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +2 -2
- package/dist/cjs/api/resources/empathicVoice/types/PostedTimeoutSpecs.d.ts +1 -13
- package/dist/cjs/api/resources/empathicVoice/types/PostedTimeoutSpecsInactivity.d.ts +0 -11
- package/dist/cjs/api/resources/empathicVoice/types/PostedTimeoutSpecsMaxDuration.d.ts +0 -11
- package/dist/cjs/api/resources/empathicVoice/types/PostedUserDefinedToolSpec.d.ts +1 -7
- package/dist/cjs/api/resources/empathicVoice/types/PostedWebhookSpec.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ResumeAssistantMessage.d.ts +1 -3
- package/dist/cjs/api/resources/empathicVoice/types/ReturnBuiltinTool.d.ts +1 -2
- package/dist/cjs/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.d.ts +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.js +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChat.d.ts +4 -19
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatAudioReconstruction.d.ts +0 -13
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.d.ts +0 -13
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.js +0 -13
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEvent.d.ts +5 -30
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventRole.d.ts +0 -7
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventRole.js +0 -7
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventType.d.ts +0 -14
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventType.js +0 -14
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroup.d.ts +5 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructions.d.ts +1 -10
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedChats.d.ts +6 -16
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedEvents.d.ts +3 -12
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEvents.d.ts +6 -30
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.d.ts +0 -15
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.js +0 -15
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatStatus.d.ts +0 -15
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatStatus.js +0 -15
- package/dist/cjs/api/resources/empathicVoice/types/ReturnConfigSpec.d.ts +2 -8
- package/dist/cjs/api/resources/empathicVoice/types/ReturnEllmModel.d.ts +1 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnEventMessageSpec.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnEventMessageSpecs.d.ts +1 -14
- package/dist/cjs/api/resources/empathicVoice/types/ReturnLanguageModel.d.ts +1 -7
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatGroups.d.ts +2 -11
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChats.d.ts +2 -11
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedConfigs.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedPrompts.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedUserDefinedTools.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPromptVersionType.d.ts +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPromptVersionType.js +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnTimeoutSpec.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnTimeoutSpecs.d.ts +1 -13
- package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedTool.d.ts +7 -19
- package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.d.ts +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.js +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.d.ts +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.js +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnVoice.d.ts +5 -3
- package/dist/cjs/api/resources/empathicVoice/types/ReturnWebhookSpec.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/SessionSettings.d.ts +10 -19
- package/dist/cjs/api/resources/empathicVoice/types/SubscribeEvent.d.ts +1 -55
- package/dist/cjs/api/resources/empathicVoice/types/ToolCallMessage.d.ts +3 -9
- package/dist/cjs/api/resources/empathicVoice/types/ToolErrorMessage.d.ts +3 -5
- package/dist/cjs/api/resources/empathicVoice/types/ToolResponseMessage.d.ts +3 -11
- package/dist/cjs/api/resources/empathicVoice/types/UserInput.d.ts +6 -2
- package/dist/cjs/api/resources/empathicVoice/types/UserInterruption.d.ts +1 -3
- package/dist/cjs/api/resources/empathicVoice/types/UserMessage.d.ts +3 -17
- package/dist/cjs/api/resources/empathicVoice/types/VoiceId.d.ts +11 -2
- package/dist/cjs/api/resources/empathicVoice/types/VoiceName.d.ts +11 -2
- package/dist/cjs/api/resources/empathicVoice/types/WebSocketError.d.ts +1 -3
- package/dist/cjs/api/resources/expressionMeasurement/client/Client.d.ts +9 -9
- package/dist/cjs/api/resources/expressionMeasurement/client/Client.js +7 -6
- package/dist/cjs/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +17 -18
- package/dist/cjs/api/resources/expressionMeasurement/resources/batch/client/Client.js +63 -151
- package/dist/cjs/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.d.ts +7 -8
- package/dist/cjs/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.js +7 -12
- package/dist/cjs/api/resources/tts/client/Client.d.ts +19 -20
- package/dist/cjs/api/resources/tts/client/Client.js +56 -138
- package/dist/cjs/api/resources/tts/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/tts/errors/UnprocessableEntityError.js +5 -1
- package/dist/cjs/api/resources/tts/resources/streamInput/client/Client.d.ts +15 -14
- package/dist/cjs/api/resources/tts/resources/streamInput/client/Client.js +10 -6
- package/dist/cjs/api/resources/tts/resources/voices/client/Client.d.ts +13 -14
- package/dist/cjs/api/resources/tts/resources/voices/client/Client.js +33 -87
- package/dist/cjs/api/resources/tts/resources/voices/client/requests/PostedVoice.d.ts +1 -1
- package/dist/cjs/api/resources/tts/resources/voices/client/requests/VoicesListRequest.d.ts +1 -1
- package/dist/cjs/api/resources/tts/types/OctaveVersion.d.ts +7 -3
- package/dist/cjs/api/resources/tts/types/OctaveVersion.js +7 -3
- package/dist/cjs/api/resources/tts/types/PostedTts.d.ts +0 -6
- package/dist/cjs/api/resources/tts/types/PostedUtteranceVoiceWithId.d.ts +1 -1
- package/dist/cjs/api/resources/tts/types/PostedUtteranceVoiceWithName.d.ts +1 -1
- package/dist/cjs/api/resources/tts/types/PublishTts.d.ts +14 -4
- package/dist/cjs/api/resources/tts/types/ReturnPagedVoices.d.ts +5 -9
- package/dist/cjs/api/resources/tts/types/ReturnVoice.d.ts +3 -3
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +26 -0
- package/dist/cjs/auth/HeaderAuthProvider.js +91 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
- package/dist/cjs/core/auth/AuthProvider.js +2 -0
- package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
- package/dist/cjs/core/auth/AuthRequest.js +2 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
- package/dist/cjs/core/auth/BasicAuth.js +27 -0
- package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
- package/dist/cjs/core/auth/BearerToken.js +16 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +5 -0
- package/dist/cjs/core/auth/index.js +9 -0
- package/dist/cjs/core/base64.d.ts +2 -0
- package/dist/cjs/core/base64.js +26 -0
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.d.ts +6 -3
- package/dist/cjs/core/fetcher/Fetcher.js +42 -24
- package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/cjs/core/fetcher/makeRequest.js +0 -2
- package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
- package/dist/cjs/core/fetcher/signals.d.ts +1 -7
- package/dist/cjs/core/fetcher/signals.js +0 -12
- package/dist/cjs/core/headers.d.ts +2 -2
- package/dist/cjs/core/index.d.ts +2 -0
- package/dist/cjs/core/index.js +2 -0
- package/dist/cjs/core/logging/logger.js +1 -1
- package/dist/cjs/core/pagination/CustomPager.d.ts +67 -0
- package/dist/cjs/core/pagination/CustomPager.js +194 -0
- package/dist/cjs/core/pagination/index.d.ts +1 -0
- package/dist/cjs/core/pagination/index.js +4 -1
- package/dist/cjs/core/runtime/runtime.js +11 -10
- package/dist/cjs/core/schemas/Schema.d.ts +1 -0
- package/dist/cjs/core/schemas/Schema.js +1 -0
- package/dist/cjs/core/schemas/builders/object/object.js +14 -1
- package/dist/cjs/core/schemas/builders/primitives/index.d.ts +1 -0
- package/dist/cjs/core/schemas/builders/primitives/index.js +3 -1
- package/dist/cjs/core/schemas/builders/primitives/never.d.ts +2 -0
- package/dist/cjs/core/schemas/builders/primitives/never.js +14 -0
- package/dist/cjs/core/url/join.js +0 -1
- package/dist/cjs/errors/HumeError.js +5 -1
- package/dist/cjs/errors/HumeTimeoutError.js +5 -1
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
- package/dist/cjs/serialization/resources/empathicVoice/types/ReturnVoice.d.ts +3 -3
- package/dist/cjs/serialization/resources/empathicVoice/types/ReturnVoice.js +3 -3
- package/dist/cjs/serialization/resources/tts/types/ReturnPagedVoices.d.ts +4 -4
- package/dist/cjs/serialization/resources/tts/types/ReturnPagedVoices.js +4 -4
- package/dist/cjs/serialization/resources/tts/types/ReturnVoice.d.ts +3 -3
- package/dist/cjs/serialization/resources/tts/types/ReturnVoice.js +3 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrapper/expressionMeasurement/ExpressionMeasurementClient.d.ts +1 -1
- package/dist/cjs/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +1 -1
- package/dist/cjs/wrapper/expressionMeasurement/batch/BatchClient.d.ts +1 -1
- package/dist/cjs/wrapper/expressionMeasurement/batch/BatchClient.js +1 -1
- package/dist/cjs/wrapper/fetchAccessToken.js +3 -0
- package/dist/esm/BaseClient.d.mts +13 -4
- package/dist/esm/BaseClient.mjs +24 -1
- package/dist/esm/Client.d.mts +13 -13
- package/dist/esm/Client.mjs +9 -17
- package/dist/esm/api/resources/empathicVoice/client/Client.d.mts +27 -27
- package/dist/esm/api/resources/empathicVoice/client/Client.mjs +18 -17
- package/dist/esm/api/resources/empathicVoice/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/empathicVoice/errors/UnprocessableEntityError.mjs +5 -1
- package/dist/esm/api/resources/empathicVoice/resources/chat/client/Client.d.mts +5 -5
- package/dist/esm/api/resources/empathicVoice/resources/chat/client/Client.mjs +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chat/client/index.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chat/client/index.mjs +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/Client.d.mts +17 -26
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/Client.mjs +47 -135
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetAudioRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetChatGroupRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupEventsRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupsRequest.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/resources/chats/client/Client.d.mts +13 -20
- package/dist/esm/api/resources/empathicVoice/resources/chats/client/Client.mjs +31 -94
- package/dist/esm/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatEventsRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatsRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/Client.d.mts +34 -83
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/Client.mjs +63 -244
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/ConfigsListConfigVersionsRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.mts +4 -16
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.mts +3 -14
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersionDescription.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/controlPlane/client/Client.d.mts +7 -7
- package/dist/esm/api/resources/empathicVoice/resources/controlPlane/client/Client.mjs +4 -17
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/Client.d.mts +34 -83
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/Client.mjs +63 -244
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PostedPrompt.d.mts +2 -8
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersion.d.mts +2 -8
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersionDescription.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PromptsListPromptVersionsRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/tools/client/Client.d.mts +34 -83
- package/dist/esm/api/resources/empathicVoice/resources/tools/client/Client.mjs +63 -244
- package/dist/esm/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedTool.d.mts +4 -8
- package/dist/esm/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersion.d.mts +4 -8
- package/dist/esm/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersionDescription.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/types/AssistantEnd.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/types/AssistantInput.d.mts +2 -5
- package/dist/esm/api/resources/empathicVoice/types/AssistantMessage.d.mts +2 -2
- package/dist/esm/api/resources/empathicVoice/types/AssistantProsody.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/types/AudioInput.d.mts +6 -4
- package/dist/esm/api/resources/empathicVoice/types/AudioOutput.d.mts +1 -4
- package/dist/esm/api/resources/empathicVoice/types/ChatMetadata.d.mts +3 -5
- package/dist/esm/api/resources/empathicVoice/types/ConnectSessionSettings.d.mts +8 -4
- package/dist/esm/api/resources/empathicVoice/types/ConnectSessionSettingsAudio.d.mts +3 -3
- package/dist/esm/api/resources/empathicVoice/types/ConnectSessionSettingsContext.d.mts +9 -3
- package/dist/esm/api/resources/empathicVoice/types/Context.d.mts +9 -3
- package/dist/esm/api/resources/empathicVoice/types/ControlPlanePublishEvent.d.mts +1 -36
- package/dist/esm/api/resources/empathicVoice/types/JsonMessage.d.mts +1 -50
- package/dist/esm/api/resources/empathicVoice/types/PauseAssistantMessage.d.mts +2 -4
- package/dist/esm/api/resources/empathicVoice/types/PostedBuiltinTool.d.mts +1 -9
- package/dist/esm/api/resources/empathicVoice/types/PostedBuiltinToolName.d.mts +0 -8
- package/dist/esm/api/resources/empathicVoice/types/PostedBuiltinToolName.mjs +0 -8
- package/dist/esm/api/resources/empathicVoice/types/PostedEllmModel.d.mts +1 -5
- package/dist/esm/api/resources/empathicVoice/types/PostedEventMessageSpec.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/PostedEventMessageSpecs.d.mts +1 -14
- package/dist/esm/api/resources/empathicVoice/types/PostedLanguageModel.d.mts +1 -7
- package/dist/esm/api/resources/empathicVoice/types/PostedNudgeSpec.d.mts +2 -2
- package/dist/esm/api/resources/empathicVoice/types/PostedTimeoutSpecs.d.mts +1 -13
- package/dist/esm/api/resources/empathicVoice/types/PostedTimeoutSpecsInactivity.d.mts +0 -11
- package/dist/esm/api/resources/empathicVoice/types/PostedTimeoutSpecsMaxDuration.d.mts +0 -11
- package/dist/esm/api/resources/empathicVoice/types/PostedUserDefinedToolSpec.d.mts +1 -7
- package/dist/esm/api/resources/empathicVoice/types/PostedWebhookSpec.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ResumeAssistantMessage.d.mts +1 -3
- package/dist/esm/api/resources/empathicVoice/types/ReturnBuiltinTool.d.mts +1 -2
- package/dist/esm/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.d.mts +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.mjs +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnChat.d.mts +4 -19
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatAudioReconstruction.d.mts +0 -13
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.d.mts +0 -13
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.mjs +0 -13
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatEvent.d.mts +5 -30
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventRole.d.mts +0 -7
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventRole.mjs +0 -7
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventType.d.mts +0 -14
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventType.mjs +0 -14
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroup.d.mts +5 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructions.d.mts +1 -10
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedChats.d.mts +6 -16
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedEvents.d.mts +3 -12
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEvents.d.mts +6 -30
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.d.mts +0 -15
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.mjs +0 -15
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatStatus.d.mts +0 -15
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatStatus.mjs +0 -15
- package/dist/esm/api/resources/empathicVoice/types/ReturnConfigSpec.d.mts +2 -8
- package/dist/esm/api/resources/empathicVoice/types/ReturnEllmModel.d.mts +1 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnEventMessageSpec.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnEventMessageSpecs.d.mts +1 -14
- package/dist/esm/api/resources/empathicVoice/types/ReturnLanguageModel.d.mts +1 -7
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatGroups.d.mts +2 -11
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChats.d.mts +2 -11
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedConfigs.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedPrompts.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedUserDefinedTools.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnPromptVersionType.d.mts +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnPromptVersionType.mjs +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnTimeoutSpec.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnTimeoutSpecs.d.mts +1 -13
- package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedTool.d.mts +7 -19
- package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.d.mts +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.mjs +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.d.mts +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.mjs +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnVoice.d.mts +5 -3
- package/dist/esm/api/resources/empathicVoice/types/ReturnWebhookSpec.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/SessionSettings.d.mts +10 -19
- package/dist/esm/api/resources/empathicVoice/types/SubscribeEvent.d.mts +1 -55
- package/dist/esm/api/resources/empathicVoice/types/ToolCallMessage.d.mts +3 -9
- package/dist/esm/api/resources/empathicVoice/types/ToolErrorMessage.d.mts +3 -5
- package/dist/esm/api/resources/empathicVoice/types/ToolResponseMessage.d.mts +3 -11
- package/dist/esm/api/resources/empathicVoice/types/UserInput.d.mts +6 -2
- package/dist/esm/api/resources/empathicVoice/types/UserInterruption.d.mts +1 -3
- package/dist/esm/api/resources/empathicVoice/types/UserMessage.d.mts +3 -17
- package/dist/esm/api/resources/empathicVoice/types/VoiceId.d.mts +11 -2
- package/dist/esm/api/resources/empathicVoice/types/VoiceName.d.mts +11 -2
- package/dist/esm/api/resources/empathicVoice/types/WebSocketError.d.mts +1 -3
- package/dist/esm/api/resources/expressionMeasurement/client/Client.d.mts +9 -9
- package/dist/esm/api/resources/expressionMeasurement/client/Client.mjs +6 -5
- package/dist/esm/api/resources/expressionMeasurement/resources/batch/client/Client.d.mts +17 -18
- package/dist/esm/api/resources/expressionMeasurement/resources/batch/client/Client.mjs +61 -149
- package/dist/esm/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.d.mts +7 -8
- package/dist/esm/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.mjs +5 -10
- package/dist/esm/api/resources/tts/client/Client.d.mts +19 -20
- package/dist/esm/api/resources/tts/client/Client.mjs +56 -138
- package/dist/esm/api/resources/tts/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/tts/errors/UnprocessableEntityError.mjs +5 -1
- package/dist/esm/api/resources/tts/resources/streamInput/client/Client.d.mts +15 -14
- package/dist/esm/api/resources/tts/resources/streamInput/client/Client.mjs +8 -4
- package/dist/esm/api/resources/tts/resources/voices/client/Client.d.mts +13 -14
- package/dist/esm/api/resources/tts/resources/voices/client/Client.mjs +32 -86
- package/dist/esm/api/resources/tts/resources/voices/client/requests/PostedVoice.d.mts +1 -1
- package/dist/esm/api/resources/tts/resources/voices/client/requests/VoicesListRequest.d.mts +1 -1
- package/dist/esm/api/resources/tts/types/OctaveVersion.d.mts +7 -3
- package/dist/esm/api/resources/tts/types/OctaveVersion.mjs +7 -3
- package/dist/esm/api/resources/tts/types/PostedTts.d.mts +0 -6
- package/dist/esm/api/resources/tts/types/PostedUtteranceVoiceWithId.d.mts +1 -1
- package/dist/esm/api/resources/tts/types/PostedUtteranceVoiceWithName.d.mts +1 -1
- package/dist/esm/api/resources/tts/types/PublishTts.d.mts +14 -4
- package/dist/esm/api/resources/tts/types/ReturnPagedVoices.d.mts +5 -9
- package/dist/esm/api/resources/tts/types/ReturnVoice.d.mts +3 -3
- package/dist/esm/auth/HeaderAuthProvider.d.mts +26 -0
- package/dist/esm/auth/HeaderAuthProvider.mjs +54 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
- package/dist/esm/core/auth/AuthProvider.mjs +1 -0
- package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
- package/dist/esm/core/auth/AuthRequest.mjs +1 -0
- package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
- package/dist/esm/core/auth/BasicAuth.mjs +24 -0
- package/dist/esm/core/auth/BearerToken.d.mts +7 -0
- package/dist/esm/core/auth/BearerToken.mjs +13 -0
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +5 -0
- package/dist/esm/core/auth/index.mjs +3 -0
- package/dist/esm/core/base64.d.mts +2 -0
- package/dist/esm/core/base64.mjs +22 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.d.mts +6 -3
- package/dist/esm/core/fetcher/Fetcher.mjs +42 -24
- package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
- package/dist/esm/core/fetcher/signals.d.mts +1 -7
- package/dist/esm/core/fetcher/signals.mjs +0 -12
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/core/index.d.mts +2 -0
- package/dist/esm/core/index.mjs +2 -0
- package/dist/esm/core/logging/logger.mjs +1 -1
- package/dist/esm/core/pagination/CustomPager.d.mts +67 -0
- package/dist/esm/core/pagination/CustomPager.mjs +189 -0
- package/dist/esm/core/pagination/index.d.mts +1 -0
- package/dist/esm/core/pagination/index.mjs +1 -0
- package/dist/esm/core/runtime/runtime.mjs +11 -10
- package/dist/esm/core/schemas/Schema.d.mts +1 -0
- package/dist/esm/core/schemas/Schema.mjs +1 -0
- package/dist/esm/core/schemas/builders/object/object.mjs +14 -1
- package/dist/esm/core/schemas/builders/primitives/index.d.mts +1 -0
- package/dist/esm/core/schemas/builders/primitives/index.mjs +1 -0
- package/dist/esm/core/schemas/builders/primitives/never.d.mts +2 -0
- package/dist/esm/core/schemas/builders/primitives/never.mjs +11 -0
- package/dist/esm/core/url/join.mjs +0 -1
- package/dist/esm/errors/HumeError.mjs +5 -1
- package/dist/esm/errors/HumeTimeoutError.mjs +5 -1
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
- package/dist/esm/serialization/resources/empathicVoice/types/ReturnVoice.d.mts +3 -3
- package/dist/esm/serialization/resources/empathicVoice/types/ReturnVoice.mjs +3 -3
- package/dist/esm/serialization/resources/tts/types/ReturnPagedVoices.d.mts +4 -4
- package/dist/esm/serialization/resources/tts/types/ReturnPagedVoices.mjs +4 -4
- package/dist/esm/serialization/resources/tts/types/ReturnVoice.d.mts +3 -3
- package/dist/esm/serialization/resources/tts/types/ReturnVoice.mjs +3 -3
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/esm/wrapper/expressionMeasurement/ExpressionMeasurementClient.d.mts +1 -1
- package/dist/esm/wrapper/expressionMeasurement/ExpressionMeasurementClient.mjs +1 -1
- package/dist/esm/wrapper/expressionMeasurement/batch/BatchClient.d.mts +1 -1
- package/dist/esm/wrapper/expressionMeasurement/batch/BatchClient.mjs +1 -1
- package/dist/esm/wrapper/fetchAccessToken.mjs +3 -0
- package/package.json +5 -2
- package/reference.md +85 -669
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
- package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
2
3
|
import * as core from "../../../../core/index.mjs";
|
|
3
4
|
import * as Hume from "../../../index.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export declare namespace
|
|
7
|
-
|
|
8
|
-
}
|
|
5
|
+
import { StreamInputClient } from "../resources/streamInput/client/Client.mjs";
|
|
6
|
+
import { VoicesClient } from "../resources/voices/client/Client.mjs";
|
|
7
|
+
export declare namespace TtsClient {
|
|
8
|
+
type Options = BaseClientOptions;
|
|
9
9
|
interface RequestOptions extends BaseRequestOptions {
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
export declare class
|
|
13
|
-
protected readonly _options:
|
|
14
|
-
protected _voices:
|
|
15
|
-
protected _streamInput:
|
|
16
|
-
constructor(
|
|
17
|
-
get voices():
|
|
18
|
-
get streamInput():
|
|
12
|
+
export declare class TtsClient {
|
|
13
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<TtsClient.Options>;
|
|
14
|
+
protected _voices: VoicesClient | undefined;
|
|
15
|
+
protected _streamInput: StreamInputClient | undefined;
|
|
16
|
+
constructor(options?: TtsClient.Options);
|
|
17
|
+
get voices(): VoicesClient;
|
|
18
|
+
get streamInput(): StreamInputClient;
|
|
19
19
|
/**
|
|
20
20
|
* Synthesizes one or more input texts into speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
|
|
21
21
|
*
|
|
22
22
|
* The response includes the base64-encoded audio and metadata in JSON format.
|
|
23
23
|
*
|
|
24
24
|
* @param {Hume.tts.PostedTts} request
|
|
25
|
-
* @param {
|
|
25
|
+
* @param {TtsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
26
|
*
|
|
27
27
|
* @throws {@link Hume.tts.UnprocessableEntityError}
|
|
28
28
|
*
|
|
@@ -44,7 +44,7 @@ export declare class Tts {
|
|
|
44
44
|
* }]
|
|
45
45
|
* })
|
|
46
46
|
*/
|
|
47
|
-
synthesizeJson(request: Hume.tts.PostedTts, requestOptions?:
|
|
47
|
+
synthesizeJson(request: Hume.tts.PostedTts, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<Hume.tts.ReturnTts>;
|
|
48
48
|
private __synthesizeJson;
|
|
49
49
|
/**
|
|
50
50
|
* Synthesizes one or more input texts into speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
|
|
@@ -52,27 +52,26 @@ export declare class Tts {
|
|
|
52
52
|
* The response contains the generated audio file in the requested format.
|
|
53
53
|
* @throws {@link Hume.tts.UnprocessableEntityError}
|
|
54
54
|
*/
|
|
55
|
-
synthesizeFile(request: Hume.tts.PostedTts, requestOptions?:
|
|
55
|
+
synthesizeFile(request: Hume.tts.PostedTts, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
56
56
|
private __synthesizeFile;
|
|
57
57
|
/**
|
|
58
58
|
* Streams synthesized speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
|
|
59
59
|
* @throws {@link Hume.tts.UnprocessableEntityError}
|
|
60
60
|
*/
|
|
61
|
-
synthesizeFileStreaming(request: Hume.tts.PostedTts, requestOptions?:
|
|
61
|
+
synthesizeFileStreaming(request: Hume.tts.PostedTts, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
62
62
|
private __synthesizeFileStreaming;
|
|
63
63
|
/**
|
|
64
64
|
* Streams synthesized speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
|
|
65
65
|
*
|
|
66
66
|
* The response is a stream of JSON objects including audio encoded in base64.
|
|
67
67
|
*/
|
|
68
|
-
synthesizeJsonStreaming(request: Hume.tts.PostedTts, requestOptions?:
|
|
68
|
+
synthesizeJsonStreaming(request: Hume.tts.PostedTts, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<core.Stream<Hume.tts.TtsOutput>>;
|
|
69
69
|
private __synthesizeJsonStreaming;
|
|
70
70
|
/**
|
|
71
71
|
* @throws {@link Hume.tts.UnprocessableEntityError}
|
|
72
72
|
*/
|
|
73
|
-
convertVoiceFile(request: Hume.tts.ConvertVoiceFileRequest, requestOptions?:
|
|
73
|
+
convertVoiceFile(request: Hume.tts.ConvertVoiceFileRequest, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
74
74
|
private __convertVoiceFile;
|
|
75
|
-
convertVoiceJson(request: Hume.tts.ConvertVoiceJsonRequest, requestOptions?:
|
|
75
|
+
convertVoiceJson(request: Hume.tts.ConvertVoiceJsonRequest, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<core.Stream<Hume.tts.TtsOutput>>;
|
|
76
76
|
private __convertVoiceJson;
|
|
77
|
-
protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
|
|
78
77
|
}
|
|
@@ -8,26 +8,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
11
12
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
12
13
|
import * as core from "../../../../core/index.mjs";
|
|
13
14
|
import { toJson } from "../../../../core/json.mjs";
|
|
14
15
|
import * as environments from "../../../../environments.mjs";
|
|
16
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
15
17
|
import * as errors from "../../../../errors/index.mjs";
|
|
16
18
|
import * as serializers from "../../../../serialization/index.mjs";
|
|
17
19
|
import * as Hume from "../../../index.mjs";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
export class
|
|
21
|
-
constructor(
|
|
22
|
-
this._options =
|
|
20
|
+
import { StreamInputClient } from "../resources/streamInput/client/Client.mjs";
|
|
21
|
+
import { VoicesClient } from "../resources/voices/client/Client.mjs";
|
|
22
|
+
export class TtsClient {
|
|
23
|
+
constructor(options = {}) {
|
|
24
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
23
25
|
}
|
|
24
26
|
get voices() {
|
|
25
27
|
var _a;
|
|
26
|
-
return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new
|
|
28
|
+
return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new VoicesClient(this._options)));
|
|
27
29
|
}
|
|
28
30
|
get streamInput() {
|
|
29
31
|
var _a;
|
|
30
|
-
return ((_a = this._streamInput) !== null && _a !== void 0 ? _a : (this._streamInput = new
|
|
32
|
+
return ((_a = this._streamInput) !== null && _a !== void 0 ? _a : (this._streamInput = new StreamInputClient(this._options)));
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* Synthesizes one or more input texts into speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
|
|
@@ -35,7 +37,7 @@ export class Tts {
|
|
|
35
37
|
* The response includes the base64-encoded audio and metadata in JSON format.
|
|
36
38
|
*
|
|
37
39
|
* @param {Hume.tts.PostedTts} request
|
|
38
|
-
* @param {
|
|
40
|
+
* @param {TtsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
41
|
*
|
|
40
42
|
* @throws {@link Hume.tts.UnprocessableEntityError}
|
|
41
43
|
*
|
|
@@ -63,7 +65,8 @@ export class Tts {
|
|
|
63
65
|
__synthesizeJson(request, requestOptions) {
|
|
64
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
67
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
66
|
-
const
|
|
68
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
69
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
67
70
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
68
71
|
url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts"),
|
|
69
72
|
method: "POST",
|
|
@@ -111,21 +114,7 @@ export class Tts {
|
|
|
111
114
|
});
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
|
-
|
|
115
|
-
case "non-json":
|
|
116
|
-
throw new errors.HumeError({
|
|
117
|
-
statusCode: _response.error.statusCode,
|
|
118
|
-
body: _response.error.rawBody,
|
|
119
|
-
rawResponse: _response.rawResponse,
|
|
120
|
-
});
|
|
121
|
-
case "timeout":
|
|
122
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts.");
|
|
123
|
-
case "unknown":
|
|
124
|
-
throw new errors.HumeError({
|
|
125
|
-
message: _response.error.errorMessage,
|
|
126
|
-
rawResponse: _response.rawResponse,
|
|
127
|
-
});
|
|
128
|
-
}
|
|
117
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts");
|
|
129
118
|
});
|
|
130
119
|
}
|
|
131
120
|
/**
|
|
@@ -140,7 +129,8 @@ export class Tts {
|
|
|
140
129
|
__synthesizeFile(request, requestOptions) {
|
|
141
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
142
131
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
143
|
-
const
|
|
132
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
133
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
144
134
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
145
135
|
url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/file"),
|
|
146
136
|
method: "POST",
|
|
@@ -180,21 +170,7 @@ export class Tts {
|
|
|
180
170
|
});
|
|
181
171
|
}
|
|
182
172
|
}
|
|
183
|
-
|
|
184
|
-
case "non-json":
|
|
185
|
-
throw new errors.HumeError({
|
|
186
|
-
statusCode: _response.error.statusCode,
|
|
187
|
-
body: _response.error.rawBody,
|
|
188
|
-
rawResponse: _response.rawResponse,
|
|
189
|
-
});
|
|
190
|
-
case "timeout":
|
|
191
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts/file.");
|
|
192
|
-
case "unknown":
|
|
193
|
-
throw new errors.HumeError({
|
|
194
|
-
message: _response.error.errorMessage,
|
|
195
|
-
rawResponse: _response.rawResponse,
|
|
196
|
-
});
|
|
197
|
-
}
|
|
173
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts/file");
|
|
198
174
|
});
|
|
199
175
|
}
|
|
200
176
|
/**
|
|
@@ -207,7 +183,8 @@ export class Tts {
|
|
|
207
183
|
__synthesizeFileStreaming(request, requestOptions) {
|
|
208
184
|
return __awaiter(this, void 0, void 0, function* () {
|
|
209
185
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
210
|
-
const
|
|
186
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
187
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
211
188
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
212
189
|
url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/stream/file"),
|
|
213
190
|
method: "POST",
|
|
@@ -247,21 +224,7 @@ export class Tts {
|
|
|
247
224
|
});
|
|
248
225
|
}
|
|
249
226
|
}
|
|
250
|
-
|
|
251
|
-
case "non-json":
|
|
252
|
-
throw new errors.HumeError({
|
|
253
|
-
statusCode: _response.error.statusCode,
|
|
254
|
-
body: _response.error.rawBody,
|
|
255
|
-
rawResponse: _response.rawResponse,
|
|
256
|
-
});
|
|
257
|
-
case "timeout":
|
|
258
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts/stream/file.");
|
|
259
|
-
case "unknown":
|
|
260
|
-
throw new errors.HumeError({
|
|
261
|
-
message: _response.error.errorMessage,
|
|
262
|
-
rawResponse: _response.rawResponse,
|
|
263
|
-
});
|
|
264
|
-
}
|
|
227
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts/stream/file");
|
|
265
228
|
});
|
|
266
229
|
}
|
|
267
230
|
/**
|
|
@@ -275,7 +238,8 @@ export class Tts {
|
|
|
275
238
|
__synthesizeJsonStreaming(request, requestOptions) {
|
|
276
239
|
return __awaiter(this, void 0, void 0, function* () {
|
|
277
240
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
278
|
-
const
|
|
241
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
242
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
279
243
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
280
244
|
url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/stream/json"),
|
|
281
245
|
method: "POST",
|
|
@@ -334,21 +298,7 @@ export class Tts {
|
|
|
334
298
|
});
|
|
335
299
|
}
|
|
336
300
|
}
|
|
337
|
-
|
|
338
|
-
case "non-json":
|
|
339
|
-
throw new errors.HumeError({
|
|
340
|
-
statusCode: _response.error.statusCode,
|
|
341
|
-
body: _response.error.rawBody,
|
|
342
|
-
rawResponse: _response.rawResponse,
|
|
343
|
-
});
|
|
344
|
-
case "timeout":
|
|
345
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts/stream/json.");
|
|
346
|
-
case "unknown":
|
|
347
|
-
throw new errors.HumeError({
|
|
348
|
-
message: _response.error.errorMessage,
|
|
349
|
-
rawResponse: _response.rawResponse,
|
|
350
|
-
});
|
|
351
|
-
}
|
|
301
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts/stream/json");
|
|
352
302
|
});
|
|
353
303
|
}
|
|
354
304
|
/**
|
|
@@ -359,14 +309,14 @@ export class Tts {
|
|
|
359
309
|
}
|
|
360
310
|
__convertVoiceFile(request, requestOptions) {
|
|
361
311
|
return __awaiter(this, void 0, void 0, function* () {
|
|
362
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
363
|
-
const
|
|
312
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
313
|
+
const _body = yield core.newFormData();
|
|
364
314
|
if (request.stripHeaders != null) {
|
|
365
|
-
|
|
315
|
+
_body.append("strip_headers", (_a = request.stripHeaders) === null || _a === void 0 ? void 0 : _a.toString());
|
|
366
316
|
}
|
|
367
|
-
yield
|
|
317
|
+
yield _body.appendFile("audio", request.audio);
|
|
368
318
|
if (request.context != null) {
|
|
369
|
-
|
|
319
|
+
_body.append("context", (() => {
|
|
370
320
|
const mapped = serializers.tts.PostedContext.jsonOrThrow(request.context, {
|
|
371
321
|
unrecognizedObjectKeys: "strip",
|
|
372
322
|
omitUndefined: true,
|
|
@@ -375,7 +325,7 @@ export class Tts {
|
|
|
375
325
|
})());
|
|
376
326
|
}
|
|
377
327
|
if (request.voice != null) {
|
|
378
|
-
|
|
328
|
+
_body.append("voice", (() => {
|
|
379
329
|
const mapped = serializers.tts.PostedUtteranceVoice.jsonOrThrow(request.voice, {
|
|
380
330
|
unrecognizedObjectKeys: "strip",
|
|
381
331
|
omitUndefined: true,
|
|
@@ -384,7 +334,7 @@ export class Tts {
|
|
|
384
334
|
})());
|
|
385
335
|
}
|
|
386
336
|
if (request.format != null) {
|
|
387
|
-
|
|
337
|
+
_body.append("format", (() => {
|
|
388
338
|
const mapped = serializers.tts.Format.jsonOrThrow(request.format, {
|
|
389
339
|
unrecognizedObjectKeys: "strip",
|
|
390
340
|
omitUndefined: true,
|
|
@@ -394,16 +344,17 @@ export class Tts {
|
|
|
394
344
|
}
|
|
395
345
|
if (request.includeTimestampTypes != null) {
|
|
396
346
|
for (const _item of request.includeTimestampTypes) {
|
|
397
|
-
|
|
347
|
+
_body.append("include_timestamp_types", serializers.tts.TimestampType.jsonOrThrow(_item, {
|
|
398
348
|
unrecognizedObjectKeys: "strip",
|
|
399
349
|
omitUndefined: true,
|
|
400
350
|
}));
|
|
401
351
|
}
|
|
402
352
|
}
|
|
403
|
-
const _maybeEncodedRequest = yield
|
|
404
|
-
const
|
|
405
|
-
const
|
|
406
|
-
|
|
353
|
+
const _maybeEncodedRequest = yield _body.getRequest();
|
|
354
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
355
|
+
const _headers = mergeHeaders(_authRequest.headers, (_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, mergeOnlyDefinedHeaders(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
356
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
357
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.HumeEnvironment.Prod).base, "v0/tts/voice_conversion/file"),
|
|
407
358
|
method: "POST",
|
|
408
359
|
headers: _headers,
|
|
409
360
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -411,10 +362,10 @@ export class Tts {
|
|
|
411
362
|
duplex: _maybeEncodedRequest.duplex,
|
|
412
363
|
body: _maybeEncodedRequest.body,
|
|
413
364
|
responseType: "binary-response",
|
|
414
|
-
timeoutMs: ((
|
|
415
|
-
maxRetries: (
|
|
365
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
366
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
416
367
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
417
|
-
fetchFn: (
|
|
368
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
418
369
|
logging: this._options.logging,
|
|
419
370
|
});
|
|
420
371
|
if (_response.ok) {
|
|
@@ -438,21 +389,7 @@ export class Tts {
|
|
|
438
389
|
});
|
|
439
390
|
}
|
|
440
391
|
}
|
|
441
|
-
|
|
442
|
-
case "non-json":
|
|
443
|
-
throw new errors.HumeError({
|
|
444
|
-
statusCode: _response.error.statusCode,
|
|
445
|
-
body: _response.error.rawBody,
|
|
446
|
-
rawResponse: _response.rawResponse,
|
|
447
|
-
});
|
|
448
|
-
case "timeout":
|
|
449
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts/voice_conversion/file.");
|
|
450
|
-
case "unknown":
|
|
451
|
-
throw new errors.HumeError({
|
|
452
|
-
message: _response.error.errorMessage,
|
|
453
|
-
rawResponse: _response.rawResponse,
|
|
454
|
-
});
|
|
455
|
-
}
|
|
392
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts/voice_conversion/file");
|
|
456
393
|
});
|
|
457
394
|
}
|
|
458
395
|
convertVoiceJson(request, requestOptions) {
|
|
@@ -460,16 +397,16 @@ export class Tts {
|
|
|
460
397
|
}
|
|
461
398
|
__convertVoiceJson(request, requestOptions) {
|
|
462
399
|
return __awaiter(this, void 0, void 0, function* () {
|
|
463
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
464
|
-
const
|
|
400
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
401
|
+
const _body = yield core.newFormData();
|
|
465
402
|
if (request.stripHeaders != null) {
|
|
466
|
-
|
|
403
|
+
_body.append("strip_headers", (_a = request.stripHeaders) === null || _a === void 0 ? void 0 : _a.toString());
|
|
467
404
|
}
|
|
468
405
|
if (request.audio != null) {
|
|
469
|
-
yield
|
|
406
|
+
yield _body.appendFile("audio", request.audio);
|
|
470
407
|
}
|
|
471
408
|
if (request.context != null) {
|
|
472
|
-
|
|
409
|
+
_body.append("context", (() => {
|
|
473
410
|
const mapped = serializers.tts.PostedContext.jsonOrThrow(request.context, {
|
|
474
411
|
unrecognizedObjectKeys: "strip",
|
|
475
412
|
omitUndefined: true,
|
|
@@ -478,7 +415,7 @@ export class Tts {
|
|
|
478
415
|
})());
|
|
479
416
|
}
|
|
480
417
|
if (request.voice != null) {
|
|
481
|
-
|
|
418
|
+
_body.append("voice", (() => {
|
|
482
419
|
const mapped = serializers.tts.PostedUtteranceVoice.jsonOrThrow(request.voice, {
|
|
483
420
|
unrecognizedObjectKeys: "strip",
|
|
484
421
|
omitUndefined: true,
|
|
@@ -487,7 +424,7 @@ export class Tts {
|
|
|
487
424
|
})());
|
|
488
425
|
}
|
|
489
426
|
if (request.format != null) {
|
|
490
|
-
|
|
427
|
+
_body.append("format", (() => {
|
|
491
428
|
const mapped = serializers.tts.Format.jsonOrThrow(request.format, {
|
|
492
429
|
unrecognizedObjectKeys: "strip",
|
|
493
430
|
omitUndefined: true,
|
|
@@ -497,16 +434,17 @@ export class Tts {
|
|
|
497
434
|
}
|
|
498
435
|
if (request.includeTimestampTypes != null) {
|
|
499
436
|
for (const _item of request.includeTimestampTypes) {
|
|
500
|
-
|
|
437
|
+
_body.append("include_timestamp_types", serializers.tts.TimestampType.jsonOrThrow(_item, {
|
|
501
438
|
unrecognizedObjectKeys: "strip",
|
|
502
439
|
omitUndefined: true,
|
|
503
440
|
}));
|
|
504
441
|
}
|
|
505
442
|
}
|
|
506
|
-
const _maybeEncodedRequest = yield
|
|
507
|
-
const
|
|
508
|
-
const
|
|
509
|
-
|
|
443
|
+
const _maybeEncodedRequest = yield _body.getRequest();
|
|
444
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
445
|
+
const _headers = mergeHeaders(_authRequest.headers, (_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, mergeOnlyDefinedHeaders(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
446
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
447
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.HumeEnvironment.Prod).base, "v0/tts/voice_conversion/json"),
|
|
510
448
|
method: "POST",
|
|
511
449
|
headers: _headers,
|
|
512
450
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -514,10 +452,10 @@ export class Tts {
|
|
|
514
452
|
duplex: _maybeEncodedRequest.duplex,
|
|
515
453
|
body: _maybeEncodedRequest.body,
|
|
516
454
|
responseType: "sse",
|
|
517
|
-
timeoutMs: ((
|
|
518
|
-
maxRetries: (
|
|
455
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
456
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
519
457
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
520
|
-
fetchFn: (
|
|
458
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
521
459
|
logging: this._options.logging,
|
|
522
460
|
});
|
|
523
461
|
if (_response.ok) {
|
|
@@ -560,27 +498,7 @@ export class Tts {
|
|
|
560
498
|
});
|
|
561
499
|
}
|
|
562
500
|
}
|
|
563
|
-
|
|
564
|
-
case "non-json":
|
|
565
|
-
throw new errors.HumeError({
|
|
566
|
-
statusCode: _response.error.statusCode,
|
|
567
|
-
body: _response.error.rawBody,
|
|
568
|
-
rawResponse: _response.rawResponse,
|
|
569
|
-
});
|
|
570
|
-
case "timeout":
|
|
571
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts/voice_conversion/json.");
|
|
572
|
-
case "unknown":
|
|
573
|
-
throw new errors.HumeError({
|
|
574
|
-
message: _response.error.errorMessage,
|
|
575
|
-
rawResponse: _response.rawResponse,
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
});
|
|
579
|
-
}
|
|
580
|
-
_getCustomAuthorizationHeaders() {
|
|
581
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
582
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
583
|
-
return { "X-Hume-Api-Key": apiKeyValue };
|
|
501
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts/voice_conversion/json");
|
|
584
502
|
});
|
|
585
503
|
}
|
|
586
504
|
}
|
|
@@ -8,6 +8,10 @@ export class BadRequestError extends errors.HumeError {
|
|
|
8
8
|
body: body,
|
|
9
9
|
rawResponse: rawResponse,
|
|
10
10
|
});
|
|
11
|
-
Object.setPrototypeOf(this,
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
12
16
|
}
|
|
13
17
|
}
|
|
@@ -8,6 +8,10 @@ export class UnprocessableEntityError extends errors.HumeError {
|
|
|
8
8
|
body: body,
|
|
9
9
|
rawResponse: rawResponse,
|
|
10
10
|
});
|
|
11
|
-
Object.setPrototypeOf(this,
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
12
16
|
}
|
|
13
17
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import type { BaseClientOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptions } from "../../../../../../BaseClient.mjs";
|
|
2
3
|
import type * as Hume from "../../../../../index.mjs";
|
|
3
4
|
import { StreamInputSocket } from "./Socket.mjs";
|
|
4
|
-
export declare namespace
|
|
5
|
+
export declare namespace StreamInputClient {
|
|
5
6
|
interface Options extends BaseClientOptions {
|
|
6
7
|
}
|
|
7
8
|
interface ConnectArgs {
|
|
8
|
-
accessToken?: string
|
|
9
|
-
contextGenerationId?: string
|
|
10
|
-
formatType?: Hume.tts.AudioFormatType
|
|
11
|
-
includeTimestampTypes?: Hume.tts.TimestampType |
|
|
12
|
-
instantMode?: boolean
|
|
13
|
-
noBinary?: boolean
|
|
14
|
-
stripHeaders?: boolean
|
|
15
|
-
version?: Hume.tts.OctaveVersion
|
|
16
|
-
apiKey?: string
|
|
9
|
+
accessToken?: string;
|
|
10
|
+
contextGenerationId?: string;
|
|
11
|
+
formatType?: Hume.tts.AudioFormatType;
|
|
12
|
+
includeTimestampTypes?: Hume.tts.TimestampType | Hume.tts.TimestampType[];
|
|
13
|
+
instantMode?: boolean;
|
|
14
|
+
noBinary?: boolean;
|
|
15
|
+
stripHeaders?: boolean;
|
|
16
|
+
version?: Hume.tts.OctaveVersion;
|
|
17
|
+
apiKey?: string;
|
|
17
18
|
/** Arbitrary headers to send with the websocket connect request. */
|
|
18
19
|
headers?: Record<string, string>;
|
|
19
20
|
/** Enable debug mode on the websocket. Defaults to false. */
|
|
@@ -22,9 +23,9 @@ export declare namespace StreamInput {
|
|
|
22
23
|
reconnectAttempts?: number;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
export declare class
|
|
26
|
-
protected readonly _options:
|
|
27
|
-
constructor(
|
|
28
|
-
connect(args?:
|
|
26
|
+
export declare class StreamInputClient {
|
|
27
|
+
protected readonly _options: NormalizedClientOptions<StreamInputClient.Options>;
|
|
28
|
+
constructor(options?: StreamInputClient.Options);
|
|
29
|
+
connect(args?: StreamInputClient.ConnectArgs): Promise<StreamInputSocket>;
|
|
29
30
|
protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | null | undefined>>;
|
|
30
31
|
}
|
|
@@ -8,14 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
import { normalizeClientOptions } from "../../../../../../BaseClient.mjs";
|
|
11
12
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
12
13
|
import * as core from "../../../../../../core/index.mjs";
|
|
13
14
|
import * as environments from "../../../../../../environments.mjs";
|
|
14
15
|
import * as serializers from "../../../../../../serialization/index.mjs";
|
|
15
16
|
import { StreamInputSocket } from "./Socket.mjs";
|
|
16
|
-
export class
|
|
17
|
-
constructor(
|
|
18
|
-
this._options =
|
|
17
|
+
export class StreamInputClient {
|
|
18
|
+
constructor(options = {}) {
|
|
19
|
+
this._options = normalizeClientOptions(options);
|
|
19
20
|
}
|
|
20
21
|
connect() {
|
|
21
22
|
return __awaiter(this, arguments, void 0, function* (args = {}) {
|
|
@@ -42,7 +43,10 @@ export class StreamInput {
|
|
|
42
43
|
}));
|
|
43
44
|
}
|
|
44
45
|
else {
|
|
45
|
-
_queryParams.include_timestamp_types = serializers.tts.TimestampType.jsonOrThrow(includeTimestampTypes, {
|
|
46
|
+
_queryParams.include_timestamp_types = serializers.tts.TimestampType.jsonOrThrow(includeTimestampTypes, {
|
|
47
|
+
unrecognizedObjectKeys: "strip",
|
|
48
|
+
omitUndefined: true,
|
|
49
|
+
});
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
if (instantMode != null) {
|