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,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Contains an error code identifying the type of error encountered, a detailed description of the error, and a short, human-readable identifier and description (slug) for the error.
|
|
2
|
+
* When provided, the output is an error message.
|
|
5
3
|
*/
|
|
6
4
|
export interface WebSocketError {
|
|
7
5
|
/** Error code. Identifies the type of error encountered. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { BaseClientOptions } from "../../../../BaseClient.mjs";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import { BatchClient } from "../resources/batch/client/Client.mjs";
|
|
4
|
+
export declare namespace ExpressionMeasurementClient {
|
|
5
|
+
type Options = BaseClientOptions;
|
|
6
6
|
}
|
|
7
|
-
export declare class
|
|
8
|
-
protected readonly _options:
|
|
9
|
-
protected _batch:
|
|
10
|
-
constructor(
|
|
11
|
-
get batch():
|
|
7
|
+
export declare class ExpressionMeasurementClient {
|
|
8
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ExpressionMeasurementClient.Options>;
|
|
9
|
+
protected _batch: BatchClient | undefined;
|
|
10
|
+
constructor(options?: ExpressionMeasurementClient.Options);
|
|
11
|
+
get batch(): BatchClient;
|
|
12
12
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import { BatchClient } from "../resources/batch/client/Client.mjs";
|
|
4
|
+
export class ExpressionMeasurementClient {
|
|
5
|
+
constructor(options = {}) {
|
|
6
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
6
7
|
}
|
|
7
8
|
get batch() {
|
|
8
9
|
var _a;
|
|
9
|
-
return ((_a = this._batch) !== null && _a !== void 0 ? _a : (this._batch = new
|
|
10
|
+
return ((_a = this._batch) !== null && _a !== void 0 ? _a : (this._batch = new BatchClient(this._options)));
|
|
10
11
|
}
|
|
11
12
|
}
|
|
@@ -1,31 +1,31 @@
|
|
|
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 type * as Hume from "../../../../../index.mjs";
|
|
4
|
-
export declare namespace
|
|
5
|
-
|
|
6
|
-
}
|
|
5
|
+
export declare namespace BatchClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
10
|
+
export declare class BatchClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<BatchClient.Options>;
|
|
12
|
+
constructor(options?: BatchClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Sort and filter jobs.
|
|
15
15
|
*
|
|
16
16
|
* @param {Hume.expressionMeasurement.batch.BatchListJobsRequest} request
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {BatchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* await client.expressionMeasurement.batch.listJobs()
|
|
21
21
|
*/
|
|
22
|
-
listJobs(request?: Hume.expressionMeasurement.batch.BatchListJobsRequest, requestOptions?:
|
|
22
|
+
listJobs(request?: Hume.expressionMeasurement.batch.BatchListJobsRequest, requestOptions?: BatchClient.RequestOptions): core.HttpResponsePromise<Hume.expressionMeasurement.batch.UnionJob[]>;
|
|
23
23
|
private __listJobs;
|
|
24
24
|
/**
|
|
25
25
|
* Start a new measurement inference job.
|
|
26
26
|
*
|
|
27
27
|
* @param {Hume.expressionMeasurement.batch.InferenceBaseRequest} request
|
|
28
|
-
* @param {
|
|
28
|
+
* @param {BatchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* await client.expressionMeasurement.batch.startInferenceJob({
|
|
@@ -33,40 +33,40 @@ export declare class Batch {
|
|
|
33
33
|
* notify: true
|
|
34
34
|
* })
|
|
35
35
|
*/
|
|
36
|
-
startInferenceJob(request: Hume.expressionMeasurement.batch.InferenceBaseRequest, requestOptions?:
|
|
36
|
+
startInferenceJob(request: Hume.expressionMeasurement.batch.InferenceBaseRequest, requestOptions?: BatchClient.RequestOptions): core.HttpResponsePromise<Hume.expressionMeasurement.batch.JobId>;
|
|
37
37
|
private __startInferenceJob;
|
|
38
38
|
/**
|
|
39
39
|
* Get the request details and state of a given job.
|
|
40
40
|
*
|
|
41
41
|
* @param {string} id - The unique identifier for the job.
|
|
42
|
-
* @param {
|
|
42
|
+
* @param {BatchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
45
|
* await client.expressionMeasurement.batch.getJobDetails("job_id")
|
|
46
46
|
*/
|
|
47
|
-
getJobDetails(id: string, requestOptions?:
|
|
47
|
+
getJobDetails(id: string, requestOptions?: BatchClient.RequestOptions): core.HttpResponsePromise<Hume.expressionMeasurement.batch.UnionJob>;
|
|
48
48
|
private __getJobDetails;
|
|
49
49
|
/**
|
|
50
50
|
* Get the JSON predictions of a completed inference job.
|
|
51
51
|
*
|
|
52
52
|
* @param {string} id - The unique identifier for the job.
|
|
53
|
-
* @param {
|
|
53
|
+
* @param {BatchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
56
|
* await client.expressionMeasurement.batch.getJobPredictions("job_id")
|
|
57
57
|
*/
|
|
58
|
-
getJobPredictions(id: string, requestOptions?:
|
|
58
|
+
getJobPredictions(id: string, requestOptions?: BatchClient.RequestOptions): core.HttpResponsePromise<Hume.expressionMeasurement.batch.UnionPredictResult[]>;
|
|
59
59
|
private __getJobPredictions;
|
|
60
60
|
/**
|
|
61
61
|
* Get the artifacts ZIP of a completed inference job.
|
|
62
62
|
*/
|
|
63
|
-
getJobArtifacts(id: string, requestOptions?:
|
|
63
|
+
getJobArtifacts(id: string, requestOptions?: BatchClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
64
64
|
private __getJobArtifacts;
|
|
65
65
|
/**
|
|
66
66
|
* Start a new batch inference job.
|
|
67
67
|
*
|
|
68
68
|
* @param {Hume.expressionMeasurement.batch.BatchStartInferenceJobFromLocalFileRequest} request
|
|
69
|
-
* @param {
|
|
69
|
+
* @param {BatchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
72
72
|
* import { createReadStream } from "fs";
|
|
@@ -74,7 +74,6 @@ export declare class Batch {
|
|
|
74
74
|
* file: [fs.createReadStream("/path/to/your/file")]
|
|
75
75
|
* })
|
|
76
76
|
*/
|
|
77
|
-
startInferenceJobFromLocalFile(request: Hume.expressionMeasurement.batch.BatchStartInferenceJobFromLocalFileRequest, requestOptions?:
|
|
77
|
+
startInferenceJobFromLocalFile(request: Hume.expressionMeasurement.batch.BatchStartInferenceJobFromLocalFileRequest, requestOptions?: BatchClient.RequestOptions): core.HttpResponsePromise<Hume.expressionMeasurement.batch.JobId>;
|
|
78
78
|
private __startInferenceJobFromLocalFile;
|
|
79
|
-
protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
|
|
80
79
|
}
|
|
@@ -8,21 +8,23 @@ 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
|
-
export class
|
|
18
|
-
constructor(
|
|
19
|
-
this._options =
|
|
19
|
+
export class BatchClient {
|
|
20
|
+
constructor(options = {}) {
|
|
21
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* Sort and filter jobs.
|
|
23
25
|
*
|
|
24
26
|
* @param {Hume.expressionMeasurement.batch.BatchListJobsRequest} request
|
|
25
|
-
* @param {
|
|
27
|
+
* @param {BatchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
28
|
*
|
|
27
29
|
* @example
|
|
28
30
|
* await client.expressionMeasurement.batch.listJobs()
|
|
@@ -34,46 +36,41 @@ export class Batch {
|
|
|
34
36
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
35
37
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
36
38
|
const { limit, status, when, timestampMs, sortBy, direction } = request;
|
|
37
|
-
const _queryParams = {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (status != null) {
|
|
42
|
-
if (Array.isArray(status)) {
|
|
43
|
-
_queryParams.status = status.map((item) => serializers.expressionMeasurement.batch.Status.jsonOrThrow(item, {
|
|
39
|
+
const _queryParams = {
|
|
40
|
+
limit,
|
|
41
|
+
status: Array.isArray(status)
|
|
42
|
+
? status.map((item) => serializers.expressionMeasurement.batch.Status.jsonOrThrow(item, {
|
|
44
43
|
unrecognizedObjectKeys: "strip",
|
|
45
44
|
omitUndefined: true,
|
|
46
|
-
}))
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
}))
|
|
46
|
+
: status != null
|
|
47
|
+
? serializers.expressionMeasurement.batch.Status.jsonOrThrow(status, {
|
|
48
|
+
unrecognizedObjectKeys: "strip",
|
|
49
|
+
omitUndefined: true,
|
|
50
|
+
})
|
|
51
|
+
: undefined,
|
|
52
|
+
when: when != null
|
|
53
|
+
? serializers.expressionMeasurement.batch.When.jsonOrThrow(when, {
|
|
50
54
|
unrecognizedObjectKeys: "strip",
|
|
51
55
|
omitUndefined: true,
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (direction != null) {
|
|
71
|
-
_queryParams.direction = serializers.expressionMeasurement.batch.Direction.jsonOrThrow(direction, {
|
|
72
|
-
unrecognizedObjectKeys: "strip",
|
|
73
|
-
omitUndefined: true,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
56
|
+
})
|
|
57
|
+
: undefined,
|
|
58
|
+
timestamp_ms: timestampMs,
|
|
59
|
+
sort_by: sortBy != null
|
|
60
|
+
? serializers.expressionMeasurement.batch.SortBy.jsonOrThrow(sortBy, {
|
|
61
|
+
unrecognizedObjectKeys: "strip",
|
|
62
|
+
omitUndefined: true,
|
|
63
|
+
})
|
|
64
|
+
: undefined,
|
|
65
|
+
direction: direction != null
|
|
66
|
+
? serializers.expressionMeasurement.batch.Direction.jsonOrThrow(direction, {
|
|
67
|
+
unrecognizedObjectKeys: "strip",
|
|
68
|
+
omitUndefined: true,
|
|
69
|
+
})
|
|
70
|
+
: undefined,
|
|
71
|
+
};
|
|
72
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
73
|
+
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);
|
|
77
74
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
78
75
|
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/batch/jobs"),
|
|
79
76
|
method: "GET",
|
|
@@ -104,28 +101,14 @@ export class Batch {
|
|
|
104
101
|
rawResponse: _response.rawResponse,
|
|
105
102
|
});
|
|
106
103
|
}
|
|
107
|
-
|
|
108
|
-
case "non-json":
|
|
109
|
-
throw new errors.HumeError({
|
|
110
|
-
statusCode: _response.error.statusCode,
|
|
111
|
-
body: _response.error.rawBody,
|
|
112
|
-
rawResponse: _response.rawResponse,
|
|
113
|
-
});
|
|
114
|
-
case "timeout":
|
|
115
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/batch/jobs.");
|
|
116
|
-
case "unknown":
|
|
117
|
-
throw new errors.HumeError({
|
|
118
|
-
message: _response.error.errorMessage,
|
|
119
|
-
rawResponse: _response.rawResponse,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
104
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/batch/jobs");
|
|
122
105
|
});
|
|
123
106
|
}
|
|
124
107
|
/**
|
|
125
108
|
* Start a new measurement inference job.
|
|
126
109
|
*
|
|
127
110
|
* @param {Hume.expressionMeasurement.batch.InferenceBaseRequest} request
|
|
128
|
-
* @param {
|
|
111
|
+
* @param {BatchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
129
112
|
*
|
|
130
113
|
* @example
|
|
131
114
|
* await client.expressionMeasurement.batch.startInferenceJob({
|
|
@@ -139,7 +122,8 @@ export class Batch {
|
|
|
139
122
|
__startInferenceJob(request, requestOptions) {
|
|
140
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
141
124
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
142
|
-
const
|
|
125
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
126
|
+
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);
|
|
143
127
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
144
128
|
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/batch/jobs"),
|
|
145
129
|
method: "POST",
|
|
@@ -176,28 +160,14 @@ export class Batch {
|
|
|
176
160
|
rawResponse: _response.rawResponse,
|
|
177
161
|
});
|
|
178
162
|
}
|
|
179
|
-
|
|
180
|
-
case "non-json":
|
|
181
|
-
throw new errors.HumeError({
|
|
182
|
-
statusCode: _response.error.statusCode,
|
|
183
|
-
body: _response.error.rawBody,
|
|
184
|
-
rawResponse: _response.rawResponse,
|
|
185
|
-
});
|
|
186
|
-
case "timeout":
|
|
187
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/batch/jobs.");
|
|
188
|
-
case "unknown":
|
|
189
|
-
throw new errors.HumeError({
|
|
190
|
-
message: _response.error.errorMessage,
|
|
191
|
-
rawResponse: _response.rawResponse,
|
|
192
|
-
});
|
|
193
|
-
}
|
|
163
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/batch/jobs");
|
|
194
164
|
});
|
|
195
165
|
}
|
|
196
166
|
/**
|
|
197
167
|
* Get the request details and state of a given job.
|
|
198
168
|
*
|
|
199
169
|
* @param {string} id - The unique identifier for the job.
|
|
200
|
-
* @param {
|
|
170
|
+
* @param {BatchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
201
171
|
*
|
|
202
172
|
* @example
|
|
203
173
|
* await client.expressionMeasurement.batch.getJobDetails("job_id")
|
|
@@ -208,7 +178,8 @@ export class Batch {
|
|
|
208
178
|
__getJobDetails(id, requestOptions) {
|
|
209
179
|
return __awaiter(this, void 0, void 0, function* () {
|
|
210
180
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
211
|
-
const
|
|
181
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
182
|
+
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);
|
|
212
183
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
213
184
|
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/batch/jobs/${core.url.encodePathParam(id)}`),
|
|
214
185
|
method: "GET",
|
|
@@ -239,28 +210,14 @@ export class Batch {
|
|
|
239
210
|
rawResponse: _response.rawResponse,
|
|
240
211
|
});
|
|
241
212
|
}
|
|
242
|
-
|
|
243
|
-
case "non-json":
|
|
244
|
-
throw new errors.HumeError({
|
|
245
|
-
statusCode: _response.error.statusCode,
|
|
246
|
-
body: _response.error.rawBody,
|
|
247
|
-
rawResponse: _response.rawResponse,
|
|
248
|
-
});
|
|
249
|
-
case "timeout":
|
|
250
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/batch/jobs/{id}.");
|
|
251
|
-
case "unknown":
|
|
252
|
-
throw new errors.HumeError({
|
|
253
|
-
message: _response.error.errorMessage,
|
|
254
|
-
rawResponse: _response.rawResponse,
|
|
255
|
-
});
|
|
256
|
-
}
|
|
213
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/batch/jobs/{id}");
|
|
257
214
|
});
|
|
258
215
|
}
|
|
259
216
|
/**
|
|
260
217
|
* Get the JSON predictions of a completed inference job.
|
|
261
218
|
*
|
|
262
219
|
* @param {string} id - The unique identifier for the job.
|
|
263
|
-
* @param {
|
|
220
|
+
* @param {BatchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
264
221
|
*
|
|
265
222
|
* @example
|
|
266
223
|
* await client.expressionMeasurement.batch.getJobPredictions("job_id")
|
|
@@ -271,7 +228,8 @@ export class Batch {
|
|
|
271
228
|
__getJobPredictions(id, requestOptions) {
|
|
272
229
|
return __awaiter(this, void 0, void 0, function* () {
|
|
273
230
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
274
|
-
const
|
|
231
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
232
|
+
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);
|
|
275
233
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
276
234
|
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/batch/jobs/${core.url.encodePathParam(id)}/predictions`),
|
|
277
235
|
method: "GET",
|
|
@@ -302,21 +260,7 @@ export class Batch {
|
|
|
302
260
|
rawResponse: _response.rawResponse,
|
|
303
261
|
});
|
|
304
262
|
}
|
|
305
|
-
|
|
306
|
-
case "non-json":
|
|
307
|
-
throw new errors.HumeError({
|
|
308
|
-
statusCode: _response.error.statusCode,
|
|
309
|
-
body: _response.error.rawBody,
|
|
310
|
-
rawResponse: _response.rawResponse,
|
|
311
|
-
});
|
|
312
|
-
case "timeout":
|
|
313
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/batch/jobs/{id}/predictions.");
|
|
314
|
-
case "unknown":
|
|
315
|
-
throw new errors.HumeError({
|
|
316
|
-
message: _response.error.errorMessage,
|
|
317
|
-
rawResponse: _response.rawResponse,
|
|
318
|
-
});
|
|
319
|
-
}
|
|
263
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/batch/jobs/{id}/predictions");
|
|
320
264
|
});
|
|
321
265
|
}
|
|
322
266
|
/**
|
|
@@ -328,7 +272,8 @@ export class Batch {
|
|
|
328
272
|
__getJobArtifacts(id, requestOptions) {
|
|
329
273
|
return __awaiter(this, void 0, void 0, function* () {
|
|
330
274
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
331
|
-
const
|
|
275
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
276
|
+
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);
|
|
332
277
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
333
278
|
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/batch/jobs/${core.url.encodePathParam(id)}/artifacts`),
|
|
334
279
|
method: "GET",
|
|
@@ -351,28 +296,14 @@ export class Batch {
|
|
|
351
296
|
rawResponse: _response.rawResponse,
|
|
352
297
|
});
|
|
353
298
|
}
|
|
354
|
-
|
|
355
|
-
case "non-json":
|
|
356
|
-
throw new errors.HumeError({
|
|
357
|
-
statusCode: _response.error.statusCode,
|
|
358
|
-
body: _response.error.rawBody,
|
|
359
|
-
rawResponse: _response.rawResponse,
|
|
360
|
-
});
|
|
361
|
-
case "timeout":
|
|
362
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/batch/jobs/{id}/artifacts.");
|
|
363
|
-
case "unknown":
|
|
364
|
-
throw new errors.HumeError({
|
|
365
|
-
message: _response.error.errorMessage,
|
|
366
|
-
rawResponse: _response.rawResponse,
|
|
367
|
-
});
|
|
368
|
-
}
|
|
299
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/batch/jobs/{id}/artifacts");
|
|
369
300
|
});
|
|
370
301
|
}
|
|
371
302
|
/**
|
|
372
303
|
* Start a new batch inference job.
|
|
373
304
|
*
|
|
374
305
|
* @param {Hume.expressionMeasurement.batch.BatchStartInferenceJobFromLocalFileRequest} request
|
|
375
|
-
* @param {
|
|
306
|
+
* @param {BatchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
376
307
|
*
|
|
377
308
|
* @example
|
|
378
309
|
* import { createReadStream } from "fs";
|
|
@@ -386,18 +317,19 @@ export class Batch {
|
|
|
386
317
|
__startInferenceJobFromLocalFile(request, requestOptions) {
|
|
387
318
|
return __awaiter(this, void 0, void 0, function* () {
|
|
388
319
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
389
|
-
const
|
|
320
|
+
const _body = yield core.newFormData();
|
|
390
321
|
if (request.json != null) {
|
|
391
|
-
|
|
322
|
+
_body.append("json", toJson(serializers.expressionMeasurement.batch.InferenceBaseRequest.jsonOrThrow(request.json, {
|
|
392
323
|
unrecognizedObjectKeys: "strip",
|
|
393
324
|
omitUndefined: true,
|
|
394
325
|
})));
|
|
395
326
|
}
|
|
396
327
|
for (const _file of request.file) {
|
|
397
|
-
yield
|
|
328
|
+
yield _body.appendFile("file", _file);
|
|
398
329
|
}
|
|
399
|
-
const _maybeEncodedRequest = yield
|
|
400
|
-
const
|
|
330
|
+
const _maybeEncodedRequest = yield _body.getRequest();
|
|
331
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
332
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
401
333
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
402
334
|
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/batch/jobs"),
|
|
403
335
|
method: "POST",
|
|
@@ -431,27 +363,7 @@ export class Batch {
|
|
|
431
363
|
rawResponse: _response.rawResponse,
|
|
432
364
|
});
|
|
433
365
|
}
|
|
434
|
-
|
|
435
|
-
case "non-json":
|
|
436
|
-
throw new errors.HumeError({
|
|
437
|
-
statusCode: _response.error.statusCode,
|
|
438
|
-
body: _response.error.rawBody,
|
|
439
|
-
rawResponse: _response.rawResponse,
|
|
440
|
-
});
|
|
441
|
-
case "timeout":
|
|
442
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/batch/jobs.");
|
|
443
|
-
case "unknown":
|
|
444
|
-
throw new errors.HumeError({
|
|
445
|
-
message: _response.error.errorMessage,
|
|
446
|
-
rawResponse: _response.rawResponse,
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
_getCustomAuthorizationHeaders() {
|
|
452
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
453
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
454
|
-
return { "X-Hume-Api-Key": apiKeyValue };
|
|
366
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/batch/jobs");
|
|
455
367
|
});
|
|
456
368
|
}
|
|
457
369
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BaseClientOptions } from "../../../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptions } from "../../../../../../../../BaseClient.mjs";
|
|
2
3
|
import { StreamSocket } from "./Socket.mjs";
|
|
3
|
-
export declare namespace
|
|
4
|
-
|
|
5
|
-
}
|
|
4
|
+
export declare namespace StreamClient {
|
|
5
|
+
type Options = BaseClientOptions;
|
|
6
6
|
interface ConnectArgs {
|
|
7
7
|
"X-Hume-Api-Key": string;
|
|
8
8
|
/** Arbitrary headers to send with the websocket connect request. */
|
|
@@ -13,9 +13,8 @@ export declare namespace Stream {
|
|
|
13
13
|
reconnectAttempts?: number;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
export declare class
|
|
17
|
-
protected readonly _options:
|
|
18
|
-
constructor(
|
|
19
|
-
connect(args:
|
|
20
|
-
protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
|
|
16
|
+
export declare class StreamClient {
|
|
17
|
+
protected readonly _options: NormalizedClientOptions<StreamClient.Options>;
|
|
18
|
+
constructor(options?: StreamClient.Options);
|
|
19
|
+
connect(args: StreamClient.ConnectArgs): Promise<StreamSocket>;
|
|
21
20
|
}
|
|
@@ -8,19 +8,20 @@ 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 { StreamSocket } from "./Socket.mjs";
|
|
15
|
-
export class
|
|
16
|
-
constructor(
|
|
17
|
-
this._options =
|
|
16
|
+
export class StreamClient {
|
|
17
|
+
constructor(options = {}) {
|
|
18
|
+
this._options = normalizeClientOptions(options);
|
|
18
19
|
}
|
|
19
20
|
connect(args) {
|
|
20
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
22
|
var _a, _b;
|
|
22
23
|
const { headers, debug, reconnectAttempts } = args;
|
|
23
|
-
const _headers = mergeHeaders(mergeOnlyDefinedHeaders(
|
|
24
|
+
const _headers = mergeHeaders(mergeOnlyDefinedHeaders({ "X-Hume-Api-Key": args["X-Hume-Api-Key"] }), headers);
|
|
24
25
|
const socket = new core.ReconnectingWebSocket({
|
|
25
26
|
url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Prod).stream, "/models"),
|
|
26
27
|
protocols: [],
|
|
@@ -31,10 +32,4 @@ export class Stream {
|
|
|
31
32
|
return new StreamSocket({ socket });
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
|
-
_getCustomAuthorizationHeaders() {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
37
|
-
return { "X-Hume-Api-Key": apiKeyValue };
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
35
|
}
|