hume 0.15.8 → 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 +8 -49
- 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/SilenceFiller.d.ts +64 -10
- package/dist/cjs/wrapper/SilenceFiller.js +109 -26
- 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/cjs/wrapper/index.d.ts +5 -0
- package/dist/cjs/wrapper/index.js +6 -6
- 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 +11 -19
- 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/SilenceFiller.d.mts +64 -10
- package/dist/esm/wrapper/SilenceFiller.mjs +109 -26
- 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/dist/esm/wrapper/index.d.mts +5 -0
- package/dist/esm/wrapper/index.mjs +4 -5
- package/package.json +5 -2
- package/reference.md +621 -1205
- 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,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UnclockedSilenceFiller = exports.SilenceFiller = void 0;
|
|
4
|
-
const stream_1 = require("stream");
|
|
5
4
|
/**
|
|
6
|
-
* SilenceFiller is a
|
|
5
|
+
* SilenceFiller is a pipeable stream that intersperses incoming audio data
|
|
7
6
|
* with bytes of silence. This is important in some cases to keep an audio
|
|
8
7
|
* stream "alive". Audio players, such as ffmpeg, can interpret inactivity as
|
|
9
8
|
* meaning the stream is ended, or disconnected.
|
|
10
9
|
*
|
|
10
|
+
* This implementation does not depend on Node.js built-ins and can work in
|
|
11
|
+
* any JavaScript environment, while still being pipeable to Node.js streams.
|
|
12
|
+
*
|
|
11
13
|
* @example
|
|
12
14
|
* ```typescript
|
|
13
15
|
* import { SilenceFiller } from 'hume';
|
|
@@ -32,7 +34,7 @@ const stream_1 = require("stream");
|
|
|
32
34
|
* await silenceFiller.endStream();
|
|
33
35
|
* ```
|
|
34
36
|
*/
|
|
35
|
-
class SilenceFiller
|
|
37
|
+
class SilenceFiller {
|
|
36
38
|
/**
|
|
37
39
|
* Creates a new SilenceFiller instance.
|
|
38
40
|
*
|
|
@@ -44,17 +46,90 @@ class SilenceFiller extends stream_1.Readable {
|
|
|
44
46
|
* playback will take longer to start.
|
|
45
47
|
*/
|
|
46
48
|
constructor(pushIntervalMs = 5, sampleRate = 48000, bytesPerSample = 2, bufferSize = 9600) {
|
|
47
|
-
super({ objectMode: false });
|
|
48
49
|
this.isStarted = false;
|
|
49
|
-
this.
|
|
50
|
+
this.pushIntervalId = null;
|
|
51
|
+
this.destination = null;
|
|
52
|
+
this.eventListeners = new Map();
|
|
53
|
+
this.ended = false;
|
|
50
54
|
this.unclockedSilenceFiller = new UnclockedSilenceFiller(bufferSize, sampleRate, bytesPerSample);
|
|
51
55
|
this.bytesPerSample = bytesPerSample;
|
|
52
56
|
this.pushIntervalMs = pushIntervalMs;
|
|
53
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Pipes the output of this SilenceFiller to a writable destination.
|
|
60
|
+
*
|
|
61
|
+
* @param destination - The destination to pipe to (e.g., a Node.js Writable stream).
|
|
62
|
+
* @returns The destination, for chaining.
|
|
63
|
+
*/
|
|
64
|
+
pipe(destination) {
|
|
65
|
+
this.destination = destination;
|
|
66
|
+
return destination;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Registers an event listener.
|
|
70
|
+
*
|
|
71
|
+
* @param event - The event name ('error', 'end').
|
|
72
|
+
* @param listener - The listener function.
|
|
73
|
+
* @returns This instance, for chaining.
|
|
74
|
+
*/
|
|
75
|
+
on(event, listener) {
|
|
76
|
+
if (!this.eventListeners.has(event)) {
|
|
77
|
+
this.eventListeners.set(event, new Set());
|
|
78
|
+
}
|
|
79
|
+
this.eventListeners.get(event).add(listener);
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Registers a one-time event listener.
|
|
84
|
+
*
|
|
85
|
+
* @param event - The event name ('error', 'end').
|
|
86
|
+
* @param listener - The listener function.
|
|
87
|
+
* @returns This instance, for chaining.
|
|
88
|
+
*/
|
|
89
|
+
once(event, listener) {
|
|
90
|
+
const onceWrapper = (...args) => {
|
|
91
|
+
this.off(event, onceWrapper);
|
|
92
|
+
listener(...args);
|
|
93
|
+
};
|
|
94
|
+
return this.on(event, onceWrapper);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Removes an event listener.
|
|
98
|
+
*
|
|
99
|
+
* @param event - The event name.
|
|
100
|
+
* @param listener - The listener function to remove.
|
|
101
|
+
* @returns This instance, for chaining.
|
|
102
|
+
*/
|
|
103
|
+
off(event, listener) {
|
|
104
|
+
const listeners = this.eventListeners.get(event);
|
|
105
|
+
if (listeners) {
|
|
106
|
+
listeners.delete(listener);
|
|
107
|
+
}
|
|
108
|
+
return this;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Emits an event to all registered listeners.
|
|
112
|
+
*
|
|
113
|
+
* @param event - The event name.
|
|
114
|
+
* @param args - Arguments to pass to listeners.
|
|
115
|
+
*/
|
|
116
|
+
emit(event, ...args) {
|
|
117
|
+
const listeners = this.eventListeners.get(event);
|
|
118
|
+
if (listeners) {
|
|
119
|
+
for (const listener of listeners) {
|
|
120
|
+
try {
|
|
121
|
+
listener(...args);
|
|
122
|
+
}
|
|
123
|
+
catch (_a) {
|
|
124
|
+
// Ignore errors in listeners
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
54
129
|
/**
|
|
55
130
|
* Writes audio data to the silence filler.
|
|
56
131
|
*
|
|
57
|
-
* @param audioBuffer - The audio buffer to write.
|
|
132
|
+
* @param audioBuffer - The audio buffer to write (Uint8Array or Buffer).
|
|
58
133
|
*/
|
|
59
134
|
writeAudio(audioBuffer) {
|
|
60
135
|
const now = Date.now();
|
|
@@ -71,12 +146,12 @@ class SilenceFiller extends stream_1.Readable {
|
|
|
71
146
|
}
|
|
72
147
|
}
|
|
73
148
|
startPushInterval() {
|
|
74
|
-
this.
|
|
149
|
+
this.pushIntervalId = setInterval(() => {
|
|
75
150
|
this.pushData();
|
|
76
151
|
}, this.pushIntervalMs);
|
|
77
152
|
}
|
|
78
153
|
pushData() {
|
|
79
|
-
if (!this.isStarted)
|
|
154
|
+
if (!this.isStarted || !this.destination)
|
|
80
155
|
return;
|
|
81
156
|
try {
|
|
82
157
|
const now = Date.now();
|
|
@@ -86,7 +161,7 @@ class SilenceFiller extends stream_1.Readable {
|
|
|
86
161
|
const alignedChunkSize = Math.floor(audioChunk.length / this.bytesPerSample) * this.bytesPerSample;
|
|
87
162
|
if (alignedChunkSize > 0) {
|
|
88
163
|
const chunk = audioChunk.subarray(0, alignedChunkSize);
|
|
89
|
-
this.
|
|
164
|
+
this.destination.write(chunk);
|
|
90
165
|
}
|
|
91
166
|
}
|
|
92
167
|
}
|
|
@@ -95,10 +170,6 @@ class SilenceFiller extends stream_1.Readable {
|
|
|
95
170
|
this.emit("error", error);
|
|
96
171
|
}
|
|
97
172
|
}
|
|
98
|
-
_read() { }
|
|
99
|
-
_destroy(error, callback) {
|
|
100
|
-
super._destroy(error, callback);
|
|
101
|
-
}
|
|
102
173
|
/**
|
|
103
174
|
* Ends the stream and drains all remaining audio data.
|
|
104
175
|
*
|
|
@@ -106,15 +177,20 @@ class SilenceFiller extends stream_1.Readable {
|
|
|
106
177
|
*/
|
|
107
178
|
endStream() {
|
|
108
179
|
return new Promise((resolve) => {
|
|
180
|
+
if (this.ended) {
|
|
181
|
+
resolve();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
this.ended = true;
|
|
109
185
|
// Stop pushing data
|
|
110
|
-
if (this.
|
|
111
|
-
clearInterval(this.
|
|
112
|
-
this.
|
|
186
|
+
if (this.pushIntervalId) {
|
|
187
|
+
clearInterval(this.pushIntervalId);
|
|
188
|
+
this.pushIntervalId = null;
|
|
113
189
|
}
|
|
114
190
|
// Drain all remaining audio from SilenceFiller
|
|
115
191
|
const now = Date.now();
|
|
116
192
|
// Keep reading until no more audio is available
|
|
117
|
-
while (
|
|
193
|
+
while (this.destination) {
|
|
118
194
|
const remainingChunk = this.unclockedSilenceFiller.readAudio(now);
|
|
119
195
|
if (!remainingChunk || remainingChunk.length === 0) {
|
|
120
196
|
break;
|
|
@@ -122,13 +198,11 @@ class SilenceFiller extends stream_1.Readable {
|
|
|
122
198
|
const alignedChunkSize = Math.floor(remainingChunk.length / this.bytesPerSample) * this.bytesPerSample;
|
|
123
199
|
if (alignedChunkSize > 0) {
|
|
124
200
|
const chunk = remainingChunk.subarray(0, alignedChunkSize);
|
|
125
|
-
this.
|
|
201
|
+
this.destination.write(chunk);
|
|
126
202
|
}
|
|
127
203
|
}
|
|
128
|
-
this.
|
|
129
|
-
|
|
130
|
-
resolve();
|
|
131
|
-
});
|
|
204
|
+
this.emit("end");
|
|
205
|
+
resolve();
|
|
132
206
|
});
|
|
133
207
|
}
|
|
134
208
|
}
|
|
@@ -176,11 +250,11 @@ class UnclockedSilenceFiller {
|
|
|
176
250
|
if (alignedBytesNeeded <= 0) {
|
|
177
251
|
return null;
|
|
178
252
|
}
|
|
179
|
-
let chunk =
|
|
253
|
+
let chunk = new Uint8Array(0);
|
|
180
254
|
// Drain from queue until we have enough bytes
|
|
181
255
|
while (chunk.length < alignedBytesNeeded && this.audioQueue.length > 0) {
|
|
182
256
|
const nextBuffer = this.audioQueue.shift();
|
|
183
|
-
chunk =
|
|
257
|
+
chunk = concatUint8Arrays(chunk, nextBuffer);
|
|
184
258
|
this.totalBufferedBytes -= nextBuffer.length;
|
|
185
259
|
}
|
|
186
260
|
// If we have more than needed, put the excess back
|
|
@@ -192,8 +266,8 @@ class UnclockedSilenceFiller {
|
|
|
192
266
|
}
|
|
193
267
|
// Fill remaining with silence if needed
|
|
194
268
|
if (chunk.length < alignedBytesNeeded) {
|
|
195
|
-
const silenceNeeded =
|
|
196
|
-
chunk =
|
|
269
|
+
const silenceNeeded = new Uint8Array(alignedBytesNeeded - chunk.length); // Uint8Array is zero-filled by default
|
|
270
|
+
chunk = concatUint8Arrays(chunk, silenceNeeded);
|
|
197
271
|
}
|
|
198
272
|
// Update total bytes sent
|
|
199
273
|
this.totalBytesSent += chunk.length;
|
|
@@ -201,3 +275,12 @@ class UnclockedSilenceFiller {
|
|
|
201
275
|
}
|
|
202
276
|
}
|
|
203
277
|
exports.UnclockedSilenceFiller = UnclockedSilenceFiller;
|
|
278
|
+
/**
|
|
279
|
+
* Concatenates two Uint8Arrays into a new Uint8Array.
|
|
280
|
+
*/
|
|
281
|
+
function concatUint8Arrays(a, b) {
|
|
282
|
+
const result = new Uint8Array(a.length + b.length);
|
|
283
|
+
result.set(a, 0);
|
|
284
|
+
result.set(b, a.length);
|
|
285
|
+
return result;
|
|
286
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExpressionMeasurementClient as FernClient } from "../../api/resources/expressionMeasurement/client/Client.js";
|
|
2
2
|
import { BatchClient } from "./batch/BatchClient.js";
|
|
3
3
|
import { StreamClient } from "./streaming/StreamingClient.js";
|
|
4
4
|
export declare class ExpressionMeasurement extends FernClient {
|
|
@@ -4,7 +4,7 @@ exports.ExpressionMeasurement = void 0;
|
|
|
4
4
|
const Client_js_1 = require("../../api/resources/expressionMeasurement/client/Client.js");
|
|
5
5
|
const BatchClient_js_1 = require("./batch/BatchClient.js");
|
|
6
6
|
const StreamingClient_js_1 = require("./streaming/StreamingClient.js");
|
|
7
|
-
class ExpressionMeasurement extends Client_js_1.
|
|
7
|
+
class ExpressionMeasurement extends Client_js_1.ExpressionMeasurementClient {
|
|
8
8
|
// BatchClient here is overridden from the generated version, we wrap expression measurement jobs in
|
|
9
9
|
// a helper that makes it easier to await the result of a job.
|
|
10
10
|
get batch() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BatchClient as FernClient } from "../../../api/resources/expressionMeasurement/resources/batch/client/Client.js";
|
|
2
2
|
import * as Hume from "../../../api/index.js";
|
|
3
3
|
import { Job } from "./Job.js";
|
|
4
4
|
import * as core from "../../../core/index.js";
|
|
@@ -37,7 +37,7 @@ exports.BatchClient = void 0;
|
|
|
37
37
|
const Client_js_1 = require("../../../api/resources/expressionMeasurement/resources/batch/client/Client.js");
|
|
38
38
|
const Job_js_1 = require("./Job.js");
|
|
39
39
|
const core = __importStar(require("../../../core/index.js"));
|
|
40
|
-
class BatchClient extends Client_js_1.
|
|
40
|
+
class BatchClient extends Client_js_1.BatchClient {
|
|
41
41
|
// This just wraps the return value of the base class's `startInferenceJob` and `startInferenceJobFromLocalFile` methods
|
|
42
42
|
// and returns a `Job` instance (has helper functions to await the job's result) instead of a raw job ID.
|
|
43
43
|
startInferenceJob(request = {}, requestOptions) {
|
|
@@ -41,6 +41,9 @@ const fetchAccessToken = (_a) => __awaiter(void 0, [_a], void 0, function* ({ ap
|
|
|
41
41
|
grant_type: "client_credentials",
|
|
42
42
|
}).toString(),
|
|
43
43
|
});
|
|
44
|
+
if (!res.ok) {
|
|
45
|
+
throw new Error(`Failed to fetch access token: (${res.status} ${res.statusText})\n ${yield res.text()}`);
|
|
46
|
+
}
|
|
44
47
|
return zod_1.z
|
|
45
48
|
.object({
|
|
46
49
|
access_token: zod_1.z.string(),
|
|
@@ -12,4 +12,9 @@ export { ExpressionMeasurement } from "./expressionMeasurement/ExpressionMeasure
|
|
|
12
12
|
export { EVIWebAudioPlayer } from "./EVIWebAudioPlayer.js";
|
|
13
13
|
export type { EVIWebAudioPlayerFFTOptions, EVIWebAudioPlayerOptions } from "./EVIWebAudioPlayer.js";
|
|
14
14
|
export { collate } from "./collate.js";
|
|
15
|
+
export { SilenceFiller } from "./SilenceFiller.js";
|
|
16
|
+
export type { PipeDestination } from "./SilenceFiller.js";
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated SilenceFiller no longer requires dynamic import. Use `import { SilenceFiller } from 'hume'` directly.
|
|
19
|
+
*/
|
|
15
20
|
export declare const createSilenceFiller: () => Promise<typeof import("./SilenceFiller.js").SilenceFiller>;
|
|
@@ -42,7 +42,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.createSilenceFiller = exports.collate = exports.EVIWebAudioPlayer = exports.ExpressionMeasurement = exports.HumeClient = exports.getBrowserSupportedMimeType = exports.MimeType = exports.getAudioStream = exports.fetchAccessToken = exports.checkForAudioTracks = exports.ensureSingleValidAudioTrack = exports.convertBlobToBase64 = exports.convertBase64ToBlob = exports.base64Encode = exports.base64Decode = void 0;
|
|
45
|
+
exports.createSilenceFiller = exports.SilenceFiller = exports.collate = exports.EVIWebAudioPlayer = exports.ExpressionMeasurement = exports.HumeClient = exports.getBrowserSupportedMimeType = exports.MimeType = exports.getAudioStream = exports.fetchAccessToken = exports.checkForAudioTracks = exports.ensureSingleValidAudioTrack = exports.convertBlobToBase64 = exports.convertBase64ToBlob = exports.base64Encode = exports.base64Decode = void 0;
|
|
46
46
|
var base64Decode_js_1 = require("./base64Decode.js");
|
|
47
47
|
Object.defineProperty(exports, "base64Decode", { enumerable: true, get: function () { return base64Decode_js_1.base64Decode; } });
|
|
48
48
|
var base64Encode_js_1 = require("./base64Encode.js");
|
|
@@ -70,12 +70,12 @@ var EVIWebAudioPlayer_js_1 = require("./EVIWebAudioPlayer.js");
|
|
|
70
70
|
Object.defineProperty(exports, "EVIWebAudioPlayer", { enumerable: true, get: function () { return EVIWebAudioPlayer_js_1.EVIWebAudioPlayer; } });
|
|
71
71
|
var collate_js_1 = require("./collate.js");
|
|
72
72
|
Object.defineProperty(exports, "collate", { enumerable: true, get: function () { return collate_js_1.collate; } });
|
|
73
|
-
|
|
73
|
+
var SilenceFiller_js_1 = require("./SilenceFiller.js");
|
|
74
|
+
Object.defineProperty(exports, "SilenceFiller", { enumerable: true, get: function () { return SilenceFiller_js_1.SilenceFiller; } });
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated SilenceFiller no longer requires dynamic import. Use `import { SilenceFiller } from 'hume'` directly.
|
|
77
|
+
*/
|
|
74
78
|
const createSilenceFiller = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
|
-
var _a;
|
|
76
|
-
if (typeof process === "undefined" || !((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node)) {
|
|
77
|
-
throw new Error("SilenceFiller is only available in Node.js environments");
|
|
78
|
-
}
|
|
79
79
|
const { SilenceFiller } = yield Promise.resolve().then(() => __importStar(require("./SilenceFiller.js")));
|
|
80
80
|
return SilenceFiller;
|
|
81
81
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.mjs";
|
|
2
|
+
import * as core from "./core/index.mjs";
|
|
2
3
|
import type * as environments from "./environments.mjs";
|
|
3
|
-
export
|
|
4
|
+
export type BaseClientOptions = {
|
|
4
5
|
environment?: core.Supplier<environments.HumeEnvironment | environments.HumeEnvironmentUrls>;
|
|
5
6
|
/** Specify a custom URL to connect the client to. */
|
|
6
7
|
baseUrl?: core.Supplier<string>;
|
|
7
|
-
apiKey?: core.Supplier<string | undefined>;
|
|
8
8
|
/** Additional headers to include in requests. */
|
|
9
9
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
10
10
|
/** The default maximum time to wait for a response in seconds. */
|
|
@@ -16,7 +16,7 @@ export interface BaseClientOptions {
|
|
|
16
16
|
fetcher?: core.FetchFunction;
|
|
17
17
|
/** Configure logging for the client. */
|
|
18
18
|
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
19
|
-
}
|
|
19
|
+
} & HeaderAuthProvider.AuthOptions;
|
|
20
20
|
export interface BaseRequestOptions {
|
|
21
21
|
/** The maximum time to wait for a response in seconds. */
|
|
22
22
|
timeoutInSeconds?: number;
|
|
@@ -29,3 +29,12 @@ export interface BaseRequestOptions {
|
|
|
29
29
|
/** Additional headers to include in the request. */
|
|
30
30
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
31
31
|
}
|
|
32
|
+
export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
|
|
33
|
+
logging: core.logging.Logger;
|
|
34
|
+
authProvider?: core.AuthProvider;
|
|
35
|
+
};
|
|
36
|
+
export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions> = NormalizedClientOptions<T> & {
|
|
37
|
+
authProvider: core.AuthProvider;
|
|
38
|
+
};
|
|
39
|
+
export declare function normalizeClientOptions<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptions<T>;
|
|
40
|
+
export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;
|
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -1,2 +1,25 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
2
|
+
import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.mjs";
|
|
3
|
+
import { mergeHeaders } from "./core/headers.mjs";
|
|
4
|
+
import * as core from "./core/index.mjs";
|
|
5
|
+
export function normalizeClientOptions(options) {
|
|
6
|
+
const headers = mergeHeaders({
|
|
7
|
+
"X-Fern-Language": "JavaScript",
|
|
8
|
+
"X-Fern-SDK-Name": "hume",
|
|
9
|
+
"X-Fern-SDK-Version": "0.15.10",
|
|
10
|
+
"User-Agent": "hume/0.15.10",
|
|
11
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
|
+
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
14
|
+
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
15
|
+
}
|
|
16
|
+
export function normalizeClientOptionsWithAuth(options) {
|
|
17
|
+
var _a;
|
|
18
|
+
const normalized = normalizeClientOptions(options);
|
|
19
|
+
const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
|
|
20
|
+
(_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new HeaderAuthProvider(normalizedWithNoOpAuthProvider));
|
|
21
|
+
return normalized;
|
|
22
|
+
}
|
|
23
|
+
function withNoOpAuthProvider(options) {
|
|
24
|
+
return Object.assign(Object.assign({}, options), { authProvider: new core.NoOpAuthProvider() });
|
|
25
|
+
}
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { EmpathicVoiceClient } from "./api/resources/empathicVoice/client/Client.mjs";
|
|
2
|
+
import { ExpressionMeasurementClient } from "./api/resources/expressionMeasurement/client/Client.mjs";
|
|
3
|
+
import { TtsClient } from "./api/resources/tts/client/Client.mjs";
|
|
4
4
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
5
|
+
import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
5
6
|
export declare namespace HumeClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
7
|
+
type Options = BaseClientOptions;
|
|
8
8
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export declare class HumeClient {
|
|
12
|
-
protected readonly _options: HumeClient.Options
|
|
13
|
-
protected
|
|
14
|
-
protected
|
|
15
|
-
protected _expressionMeasurement:
|
|
16
|
-
constructor(
|
|
17
|
-
get
|
|
18
|
-
get
|
|
19
|
-
get expressionMeasurement():
|
|
12
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<HumeClient.Options>;
|
|
13
|
+
protected _empathicVoice: EmpathicVoiceClient | undefined;
|
|
14
|
+
protected _tts: TtsClient | undefined;
|
|
15
|
+
protected _expressionMeasurement: ExpressionMeasurementClient | undefined;
|
|
16
|
+
constructor(options?: HumeClient.Options);
|
|
17
|
+
get empathicVoice(): EmpathicVoiceClient;
|
|
18
|
+
get tts(): TtsClient;
|
|
19
|
+
get expressionMeasurement(): ExpressionMeasurementClient;
|
|
20
20
|
}
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import * as core from "./core/index.mjs";
|
|
2
|
+
import { EmpathicVoiceClient } from "./api/resources/empathicVoice/client/Client.mjs";
|
|
3
|
+
import { ExpressionMeasurementClient } from "./api/resources/expressionMeasurement/client/Client.mjs";
|
|
4
|
+
import { TtsClient } from "./api/resources/tts/client/Client.mjs";
|
|
5
|
+
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
7
6
|
export class HumeClient {
|
|
8
|
-
constructor(
|
|
9
|
-
this._options =
|
|
10
|
-
"X-Fern-Language": "JavaScript",
|
|
11
|
-
"X-Fern-SDK-Name": "hume",
|
|
12
|
-
"X-Fern-SDK-Version": "0.15.8",
|
|
13
|
-
"User-Agent": "hume/0.15.8",
|
|
14
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
15
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
16
|
-
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
7
|
+
constructor(options = {}) {
|
|
8
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
17
9
|
}
|
|
18
|
-
get
|
|
10
|
+
get empathicVoice() {
|
|
19
11
|
var _a;
|
|
20
|
-
return ((_a = this.
|
|
12
|
+
return ((_a = this._empathicVoice) !== null && _a !== void 0 ? _a : (this._empathicVoice = new EmpathicVoiceClient(this._options)));
|
|
21
13
|
}
|
|
22
|
-
get
|
|
14
|
+
get tts() {
|
|
23
15
|
var _a;
|
|
24
|
-
return ((_a = this.
|
|
16
|
+
return ((_a = this._tts) !== null && _a !== void 0 ? _a : (this._tts = new TtsClient(this._options)));
|
|
25
17
|
}
|
|
26
18
|
get expressionMeasurement() {
|
|
27
19
|
var _a;
|
|
28
|
-
return ((_a = this._expressionMeasurement) !== null && _a !== void 0 ? _a : (this._expressionMeasurement = new
|
|
20
|
+
return ((_a = this._expressionMeasurement) !== null && _a !== void 0 ? _a : (this._expressionMeasurement = new ExpressionMeasurementClient(this._options)));
|
|
29
21
|
}
|
|
30
22
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import type { BaseClientOptions } from "../../../../BaseClient.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import { ChatClient } from "../resources/chat/client/Client.mjs";
|
|
4
|
+
import { ChatGroupsClient } from "../resources/chatGroups/client/Client.mjs";
|
|
5
|
+
import { ChatsClient } from "../resources/chats/client/Client.mjs";
|
|
6
|
+
import { ConfigsClient } from "../resources/configs/client/Client.mjs";
|
|
7
|
+
import { ControlPlaneClient } from "../resources/controlPlane/client/Client.mjs";
|
|
8
|
+
import { PromptsClient } from "../resources/prompts/client/Client.mjs";
|
|
9
|
+
import { ToolsClient } from "../resources/tools/client/Client.mjs";
|
|
10
|
+
export declare namespace EmpathicVoiceClient {
|
|
11
|
+
type Options = BaseClientOptions;
|
|
12
12
|
}
|
|
13
|
-
export declare class
|
|
14
|
-
protected readonly _options:
|
|
15
|
-
protected _controlPlane:
|
|
16
|
-
protected _chatGroups:
|
|
17
|
-
protected _chats:
|
|
18
|
-
protected _configs:
|
|
19
|
-
protected _prompts:
|
|
20
|
-
protected _tools:
|
|
21
|
-
protected _chat:
|
|
22
|
-
constructor(
|
|
23
|
-
get controlPlane():
|
|
24
|
-
get chatGroups():
|
|
25
|
-
get chats():
|
|
26
|
-
get configs():
|
|
27
|
-
get prompts():
|
|
28
|
-
get tools():
|
|
29
|
-
get chat():
|
|
13
|
+
export declare class EmpathicVoiceClient {
|
|
14
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<EmpathicVoiceClient.Options>;
|
|
15
|
+
protected _controlPlane: ControlPlaneClient | undefined;
|
|
16
|
+
protected _chatGroups: ChatGroupsClient | undefined;
|
|
17
|
+
protected _chats: ChatsClient | undefined;
|
|
18
|
+
protected _configs: ConfigsClient | undefined;
|
|
19
|
+
protected _prompts: PromptsClient | undefined;
|
|
20
|
+
protected _tools: ToolsClient | undefined;
|
|
21
|
+
protected _chat: ChatClient | undefined;
|
|
22
|
+
constructor(options?: EmpathicVoiceClient.Options);
|
|
23
|
+
get controlPlane(): ControlPlaneClient;
|
|
24
|
+
get chatGroups(): ChatGroupsClient;
|
|
25
|
+
get chats(): ChatsClient;
|
|
26
|
+
get configs(): ConfigsClient;
|
|
27
|
+
get prompts(): PromptsClient;
|
|
28
|
+
get tools(): ToolsClient;
|
|
29
|
+
get chat(): ChatClient;
|
|
30
30
|
}
|
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import { ChatClient } from "../resources/chat/client/Client.mjs";
|
|
4
|
+
import { ChatGroupsClient } from "../resources/chatGroups/client/Client.mjs";
|
|
5
|
+
import { ChatsClient } from "../resources/chats/client/Client.mjs";
|
|
6
|
+
import { ConfigsClient } from "../resources/configs/client/Client.mjs";
|
|
7
|
+
import { ControlPlaneClient } from "../resources/controlPlane/client/Client.mjs";
|
|
8
|
+
import { PromptsClient } from "../resources/prompts/client/Client.mjs";
|
|
9
|
+
import { ToolsClient } from "../resources/tools/client/Client.mjs";
|
|
10
|
+
export class EmpathicVoiceClient {
|
|
11
|
+
constructor(options = {}) {
|
|
12
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
12
13
|
}
|
|
13
14
|
get controlPlane() {
|
|
14
15
|
var _a;
|
|
15
|
-
return ((_a = this._controlPlane) !== null && _a !== void 0 ? _a : (this._controlPlane = new
|
|
16
|
+
return ((_a = this._controlPlane) !== null && _a !== void 0 ? _a : (this._controlPlane = new ControlPlaneClient(this._options)));
|
|
16
17
|
}
|
|
17
18
|
get chatGroups() {
|
|
18
19
|
var _a;
|
|
19
|
-
return ((_a = this._chatGroups) !== null && _a !== void 0 ? _a : (this._chatGroups = new
|
|
20
|
+
return ((_a = this._chatGroups) !== null && _a !== void 0 ? _a : (this._chatGroups = new ChatGroupsClient(this._options)));
|
|
20
21
|
}
|
|
21
22
|
get chats() {
|
|
22
23
|
var _a;
|
|
23
|
-
return ((_a = this._chats) !== null && _a !== void 0 ? _a : (this._chats = new
|
|
24
|
+
return ((_a = this._chats) !== null && _a !== void 0 ? _a : (this._chats = new ChatsClient(this._options)));
|
|
24
25
|
}
|
|
25
26
|
get configs() {
|
|
26
27
|
var _a;
|
|
27
|
-
return ((_a = this._configs) !== null && _a !== void 0 ? _a : (this._configs = new
|
|
28
|
+
return ((_a = this._configs) !== null && _a !== void 0 ? _a : (this._configs = new ConfigsClient(this._options)));
|
|
28
29
|
}
|
|
29
30
|
get prompts() {
|
|
30
31
|
var _a;
|
|
31
|
-
return ((_a = this._prompts) !== null && _a !== void 0 ? _a : (this._prompts = new
|
|
32
|
+
return ((_a = this._prompts) !== null && _a !== void 0 ? _a : (this._prompts = new PromptsClient(this._options)));
|
|
32
33
|
}
|
|
33
34
|
get tools() {
|
|
34
35
|
var _a;
|
|
35
|
-
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new
|
|
36
|
+
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new ToolsClient(this._options)));
|
|
36
37
|
}
|
|
37
38
|
get chat() {
|
|
38
39
|
var _a;
|
|
39
|
-
return ((_a = this._chat) !== null && _a !== void 0 ? _a : (this._chat = new
|
|
40
|
+
return ((_a = this._chat) !== null && _a !== void 0 ? _a : (this._chat = new ChatClient(this._options)));
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -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
|
}
|
|
@@ -3,7 +3,7 @@ import * as environments from "../../../../../../environments.mjs";
|
|
|
3
3
|
import * as core from "../../../../../../core/index.mjs";
|
|
4
4
|
import * as Hume from "../../../../../index.mjs";
|
|
5
5
|
import { ChatSocket } from "./Socket.mjs";
|
|
6
|
-
export declare namespace
|
|
6
|
+
export declare namespace ChatClient {
|
|
7
7
|
interface Options {
|
|
8
8
|
environment?: core.Supplier<environments.HumeEnvironment | environments.HumeEnvironmentUrls>;
|
|
9
9
|
/** Specify a custom URL to connect the client to. */
|
|
@@ -34,9 +34,9 @@ export declare namespace Chat {
|
|
|
34
34
|
reconnectAttempts?: number;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
export declare class
|
|
38
|
-
protected readonly _options:
|
|
39
|
-
constructor(_options?:
|
|
40
|
-
connect(args?:
|
|
37
|
+
export declare class ChatClient {
|
|
38
|
+
protected readonly _options: ChatClient.Options;
|
|
39
|
+
constructor(_options?: ChatClient.Options);
|
|
40
|
+
connect(args?: ChatClient.ConnectArgs): ChatSocket;
|
|
41
41
|
protected _getCustomAuthorizationHeaders(): Record<string, string | null | undefined>;
|
|
42
42
|
}
|
|
@@ -5,7 +5,7 @@ import * as Hume from "../../../../../index.mjs";
|
|
|
5
5
|
import { mergeOnlyDefinedHeaders, mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
6
6
|
import * as serializers from "../../../../../../serialization/index.mjs";
|
|
7
7
|
import { ChatSocket } from "./Socket.mjs";
|
|
8
|
-
export class
|
|
8
|
+
export class ChatClient {
|
|
9
9
|
constructor(_options = {}) {
|
|
10
10
|
this._options = _options;
|
|
11
11
|
}
|