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
|
@@ -43,22 +43,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.
|
|
46
|
+
exports.ChatGroupsClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../../../BaseClient.js");
|
|
47
48
|
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
48
49
|
const core = __importStar(require("../../../../../../core/index.js"));
|
|
49
50
|
const environments = __importStar(require("../../../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
50
52
|
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
51
53
|
const serializers = __importStar(require("../../../../../../serialization/index.js"));
|
|
52
54
|
const Hume = __importStar(require("../../../../../index.js"));
|
|
53
|
-
class
|
|
54
|
-
constructor(
|
|
55
|
-
this._options =
|
|
55
|
+
class ChatGroupsClient {
|
|
56
|
+
constructor(options = {}) {
|
|
57
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
58
|
-
* Fetches a paginated list of **Chat Groups**.
|
|
59
|
-
*
|
|
60
60
|
* @param {Hume.empathicVoice.ChatGroupsListChatGroupsRequest} request
|
|
61
|
-
* @param {
|
|
61
|
+
* @param {ChatGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
62
|
*
|
|
63
63
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
64
64
|
*
|
|
@@ -75,20 +75,14 @@ class ChatGroups {
|
|
|
75
75
|
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
76
76
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
77
77
|
const { pageNumber, pageSize, ascendingOrder, configId } = request;
|
|
78
|
-
const _queryParams = {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
_queryParams.ascending_order = ascendingOrder.toString();
|
|
87
|
-
}
|
|
88
|
-
if (configId != null) {
|
|
89
|
-
_queryParams.config_id = configId;
|
|
90
|
-
}
|
|
91
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
78
|
+
const _queryParams = {
|
|
79
|
+
page_number: pageNumber,
|
|
80
|
+
page_size: pageSize,
|
|
81
|
+
ascending_order: ascendingOrder,
|
|
82
|
+
config_id: configId,
|
|
83
|
+
};
|
|
84
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
85
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
92
86
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
93
87
|
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)
|
|
94
88
|
.base, "v0/evi/chat_groups"),
|
|
@@ -131,21 +125,7 @@ class ChatGroups {
|
|
|
131
125
|
});
|
|
132
126
|
}
|
|
133
127
|
}
|
|
134
|
-
|
|
135
|
-
case "non-json":
|
|
136
|
-
throw new errors.HumeError({
|
|
137
|
-
statusCode: _response.error.statusCode,
|
|
138
|
-
body: _response.error.rawBody,
|
|
139
|
-
rawResponse: _response.rawResponse,
|
|
140
|
-
});
|
|
141
|
-
case "timeout":
|
|
142
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups.");
|
|
143
|
-
case "unknown":
|
|
144
|
-
throw new errors.HumeError({
|
|
145
|
-
message: _response.error.errorMessage,
|
|
146
|
-
rawResponse: _response.rawResponse,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
128
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/evi/chat_groups");
|
|
149
129
|
}));
|
|
150
130
|
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
151
131
|
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
@@ -162,11 +142,9 @@ class ChatGroups {
|
|
|
162
142
|
});
|
|
163
143
|
}
|
|
164
144
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* @param {string} id - Identifier for a Chat Group. Formatted as a UUID.
|
|
145
|
+
* @param {string} id - Identifier for a chat. Formatted as a UUID.
|
|
168
146
|
* @param {Hume.empathicVoice.ChatGroupsGetChatGroupRequest} request
|
|
169
|
-
* @param {
|
|
147
|
+
* @param {ChatGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
170
148
|
*
|
|
171
149
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
172
150
|
*
|
|
@@ -184,20 +162,14 @@ class ChatGroups {
|
|
|
184
162
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
185
163
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
186
164
|
const { status, pageSize, pageNumber, ascendingOrder } = request;
|
|
187
|
-
const _queryParams = {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
_queryParams.page_number = pageNumber.toString();
|
|
196
|
-
}
|
|
197
|
-
if (ascendingOrder != null) {
|
|
198
|
-
_queryParams.ascending_order = ascendingOrder.toString();
|
|
199
|
-
}
|
|
200
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
165
|
+
const _queryParams = {
|
|
166
|
+
status,
|
|
167
|
+
page_size: pageSize,
|
|
168
|
+
page_number: pageNumber,
|
|
169
|
+
ascending_order: ascendingOrder,
|
|
170
|
+
};
|
|
171
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
172
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
201
173
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
202
174
|
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/evi/chat_groups/${core.url.encodePathParam(id)}`),
|
|
203
175
|
method: "GET",
|
|
@@ -239,29 +211,13 @@ class ChatGroups {
|
|
|
239
211
|
});
|
|
240
212
|
}
|
|
241
213
|
}
|
|
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/evi/chat_groups/{id}.");
|
|
251
|
-
case "unknown":
|
|
252
|
-
throw new errors.HumeError({
|
|
253
|
-
message: _response.error.errorMessage,
|
|
254
|
-
rawResponse: _response.rawResponse,
|
|
255
|
-
});
|
|
256
|
-
}
|
|
214
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/evi/chat_groups/{id}");
|
|
257
215
|
});
|
|
258
216
|
}
|
|
259
217
|
/**
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
* @param {string} id - Identifier for a Chat Group. Formatted as a UUID.
|
|
218
|
+
* @param {string} id - Identifier for a chat. Formatted as a UUID.
|
|
263
219
|
* @param {Hume.empathicVoice.ChatGroupsGetAudioRequest} request
|
|
264
|
-
* @param {
|
|
220
|
+
* @param {ChatGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
265
221
|
*
|
|
266
222
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
267
223
|
*
|
|
@@ -279,17 +235,13 @@ class ChatGroups {
|
|
|
279
235
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
280
236
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
281
237
|
const { pageNumber, pageSize, ascendingOrder } = request;
|
|
282
|
-
const _queryParams = {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
if (ascendingOrder != null) {
|
|
290
|
-
_queryParams.ascending_order = ascendingOrder.toString();
|
|
291
|
-
}
|
|
292
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
238
|
+
const _queryParams = {
|
|
239
|
+
page_number: pageNumber,
|
|
240
|
+
page_size: pageSize,
|
|
241
|
+
ascending_order: ascendingOrder,
|
|
242
|
+
};
|
|
243
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
244
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
293
245
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
294
246
|
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/evi/chat_groups/${core.url.encodePathParam(id)}/audio`),
|
|
295
247
|
method: "GET",
|
|
@@ -331,29 +283,13 @@ class ChatGroups {
|
|
|
331
283
|
});
|
|
332
284
|
}
|
|
333
285
|
}
|
|
334
|
-
|
|
335
|
-
case "non-json":
|
|
336
|
-
throw new errors.HumeError({
|
|
337
|
-
statusCode: _response.error.statusCode,
|
|
338
|
-
body: _response.error.rawBody,
|
|
339
|
-
rawResponse: _response.rawResponse,
|
|
340
|
-
});
|
|
341
|
-
case "timeout":
|
|
342
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}/audio.");
|
|
343
|
-
case "unknown":
|
|
344
|
-
throw new errors.HumeError({
|
|
345
|
-
message: _response.error.errorMessage,
|
|
346
|
-
rawResponse: _response.rawResponse,
|
|
347
|
-
});
|
|
348
|
-
}
|
|
286
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/evi/chat_groups/{id}/audio");
|
|
349
287
|
});
|
|
350
288
|
}
|
|
351
289
|
/**
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
* @param {string} id - Identifier for a Chat Group. Formatted as a UUID.
|
|
290
|
+
* @param {string} id - Identifier for a chat. Formatted as a UUID.
|
|
355
291
|
* @param {Hume.empathicVoice.ChatGroupsListChatGroupEventsRequest} request
|
|
356
|
-
* @param {
|
|
292
|
+
* @param {ChatGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
357
293
|
*
|
|
358
294
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
359
295
|
*
|
|
@@ -369,17 +305,13 @@ class ChatGroups {
|
|
|
369
305
|
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
370
306
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
371
307
|
const { pageSize, pageNumber, ascendingOrder } = request;
|
|
372
|
-
const _queryParams = {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
if (ascendingOrder != null) {
|
|
380
|
-
_queryParams.ascending_order = ascendingOrder.toString();
|
|
381
|
-
}
|
|
382
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
308
|
+
const _queryParams = {
|
|
309
|
+
page_size: pageSize,
|
|
310
|
+
page_number: pageNumber,
|
|
311
|
+
ascending_order: ascendingOrder,
|
|
312
|
+
};
|
|
313
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
314
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
383
315
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
384
316
|
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)
|
|
385
317
|
.base, `v0/evi/chat_groups/${core.url.encodePathParam(id)}/events`),
|
|
@@ -422,21 +354,7 @@ class ChatGroups {
|
|
|
422
354
|
});
|
|
423
355
|
}
|
|
424
356
|
}
|
|
425
|
-
|
|
426
|
-
case "non-json":
|
|
427
|
-
throw new errors.HumeError({
|
|
428
|
-
statusCode: _response.error.statusCode,
|
|
429
|
-
body: _response.error.rawBody,
|
|
430
|
-
rawResponse: _response.rawResponse,
|
|
431
|
-
});
|
|
432
|
-
case "timeout":
|
|
433
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}/events.");
|
|
434
|
-
case "unknown":
|
|
435
|
-
throw new errors.HumeError({
|
|
436
|
-
message: _response.error.errorMessage,
|
|
437
|
-
rawResponse: _response.rawResponse,
|
|
438
|
-
});
|
|
439
|
-
}
|
|
357
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/evi/chat_groups/{id}/events");
|
|
440
358
|
}));
|
|
441
359
|
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
442
360
|
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
@@ -452,11 +370,5 @@ class ChatGroups {
|
|
|
452
370
|
});
|
|
453
371
|
});
|
|
454
372
|
}
|
|
455
|
-
_getCustomAuthorizationHeaders() {
|
|
456
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
457
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
458
|
-
return { "X-Hume-Api-Key": apiKeyValue };
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
373
|
}
|
|
462
|
-
exports.
|
|
374
|
+
exports.ChatGroupsClient = ChatGroupsClient;
|
|
@@ -19,6 +19,6 @@ export interface ChatGroupsGetAudioRequest {
|
|
|
19
19
|
* For example, if `page_size` is set to 10, each page will include up to 10 items. Defaults to 10.
|
|
20
20
|
*/
|
|
21
21
|
pageSize?: number;
|
|
22
|
-
/**
|
|
22
|
+
/** Boolean to indicate if the results should be paginated in chronological order or reverse-chronological order. Defaults to true. */
|
|
23
23
|
ascendingOrder?: boolean;
|
|
24
24
|
}
|
|
@@ -21,6 +21,6 @@ export interface ChatGroupsGetChatGroupRequest {
|
|
|
21
21
|
* This parameter uses zero-based indexing. For example, setting `page_number` to 0 retrieves the first page of results (items 0-9 if `page_size` is 10), setting `page_number` to 1 retrieves the second page (items 10-19), and so on. Defaults to 0, which retrieves the first page.
|
|
22
22
|
*/
|
|
23
23
|
pageNumber?: number;
|
|
24
|
-
/**
|
|
24
|
+
/** Boolean to indicate if the results should be paginated in chronological order or reverse-chronological order. Defaults to true. */
|
|
25
25
|
ascendingOrder?: boolean;
|
|
26
26
|
}
|
|
@@ -19,6 +19,6 @@ export interface ChatGroupsListChatGroupEventsRequest {
|
|
|
19
19
|
* This parameter uses zero-based indexing. For example, setting `page_number` to 0 retrieves the first page of results (items 0-9 if `page_size` is 10), setting `page_number` to 1 retrieves the second page (items 10-19), and so on. Defaults to 0, which retrieves the first page.
|
|
20
20
|
*/
|
|
21
21
|
pageNumber?: number;
|
|
22
|
-
/**
|
|
22
|
+
/** Boolean to indicate if the results should be paginated in chronological order or reverse-chronological order. Defaults to true. */
|
|
23
23
|
ascendingOrder?: boolean;
|
|
24
24
|
}
|
|
@@ -20,12 +20,8 @@ export interface ChatGroupsListChatGroupsRequest {
|
|
|
20
20
|
* For example, if `page_size` is set to 10, each page will include up to 10 items. Defaults to 10.
|
|
21
21
|
*/
|
|
22
22
|
pageSize?: number;
|
|
23
|
-
/**
|
|
23
|
+
/** Boolean to indicate if the results should be paginated in chronological order or reverse-chronological order. Defaults to true. */
|
|
24
24
|
ascendingOrder?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* The unique identifier for an EVI configuration.
|
|
27
|
-
*
|
|
28
|
-
* Filter Chat Groups to only include Chats that used this `config_id` in their most recent Chat.
|
|
29
|
-
*/
|
|
25
|
+
/** Filter chatgroups to only include chats that used this config in their most recent chat. */
|
|
30
26
|
configId?: string;
|
|
31
27
|
}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
|
|
2
3
|
import * as core from "../../../../../../core/index.js";
|
|
3
4
|
import * as Hume from "../../../../../index.js";
|
|
4
|
-
export declare namespace
|
|
5
|
-
|
|
6
|
-
}
|
|
5
|
+
export declare namespace ChatsClient {
|
|
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 ChatsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ChatsClient.Options>;
|
|
12
|
+
constructor(options?: ChatsClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
* Fetches a paginated list of **Chats**.
|
|
15
|
-
*
|
|
16
14
|
* @param {Hume.empathicVoice.ChatsListChatsRequest} request
|
|
17
|
-
* @param {
|
|
15
|
+
* @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
16
|
*
|
|
19
17
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
20
18
|
*
|
|
@@ -25,13 +23,11 @@ export declare class Chats {
|
|
|
25
23
|
* ascendingOrder: true
|
|
26
24
|
* })
|
|
27
25
|
*/
|
|
28
|
-
listChats(request?: Hume.empathicVoice.ChatsListChatsRequest, requestOptions?:
|
|
26
|
+
listChats(request?: Hume.empathicVoice.ChatsListChatsRequest, requestOptions?: ChatsClient.RequestOptions): Promise<core.Page<Hume.empathicVoice.ReturnChat, Hume.empathicVoice.ReturnPagedChats>>;
|
|
29
27
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @param {string} id - Identifier for a Chat. Formatted as a UUID.
|
|
28
|
+
* @param {string} id - Identifier for a chat. Formatted as a UUID.
|
|
33
29
|
* @param {Hume.empathicVoice.ChatsListChatEventsRequest} request
|
|
34
|
-
* @param {
|
|
30
|
+
* @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
31
|
*
|
|
36
32
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
37
33
|
*
|
|
@@ -42,19 +38,16 @@ export declare class Chats {
|
|
|
42
38
|
* ascendingOrder: true
|
|
43
39
|
* })
|
|
44
40
|
*/
|
|
45
|
-
listChatEvents(id: string, request?: Hume.empathicVoice.ChatsListChatEventsRequest, requestOptions?:
|
|
41
|
+
listChatEvents(id: string, request?: Hume.empathicVoice.ChatsListChatEventsRequest, requestOptions?: ChatsClient.RequestOptions): Promise<core.Page<Hume.empathicVoice.ReturnChatEvent, Hume.empathicVoice.ReturnChatPagedEvents>>;
|
|
46
42
|
/**
|
|
47
|
-
* Fetches the audio of a previous **Chat**. For more details, see our guide on audio reconstruction [here](/docs/speech-to-speech-evi/faq#can-i-access-the-audio-of-previous-conversations-with-evi).
|
|
48
|
-
*
|
|
49
43
|
* @param {string} id - Identifier for a chat. Formatted as a UUID.
|
|
50
|
-
* @param {
|
|
44
|
+
* @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
51
45
|
*
|
|
52
46
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
53
47
|
*
|
|
54
48
|
* @example
|
|
55
49
|
* await client.empathicVoice.chats.getAudio("470a49f6-1dec-4afe-8b61-035d3b2d63b0")
|
|
56
50
|
*/
|
|
57
|
-
getAudio(id: string, requestOptions?:
|
|
51
|
+
getAudio(id: string, requestOptions?: ChatsClient.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnChatAudioReconstruction>;
|
|
58
52
|
private __getAudio;
|
|
59
|
-
protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
|
|
60
53
|
}
|
|
@@ -43,22 +43,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.
|
|
46
|
+
exports.ChatsClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../../../BaseClient.js");
|
|
47
48
|
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
48
49
|
const core = __importStar(require("../../../../../../core/index.js"));
|
|
49
50
|
const environments = __importStar(require("../../../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
50
52
|
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
51
53
|
const serializers = __importStar(require("../../../../../../serialization/index.js"));
|
|
52
54
|
const Hume = __importStar(require("../../../../../index.js"));
|
|
53
|
-
class
|
|
54
|
-
constructor(
|
|
55
|
-
this._options =
|
|
55
|
+
class ChatsClient {
|
|
56
|
+
constructor(options = {}) {
|
|
57
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
58
|
-
* Fetches a paginated list of **Chats**.
|
|
59
|
-
*
|
|
60
60
|
* @param {Hume.empathicVoice.ChatsListChatsRequest} request
|
|
61
|
-
* @param {
|
|
61
|
+
* @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
62
|
*
|
|
63
63
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
64
64
|
*
|
|
@@ -74,23 +74,15 @@ class Chats {
|
|
|
74
74
|
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
75
75
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
76
76
|
const { pageNumber, pageSize, ascendingOrder, configId, status } = request;
|
|
77
|
-
const _queryParams = {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
if (configId != null) {
|
|
88
|
-
_queryParams.config_id = configId;
|
|
89
|
-
}
|
|
90
|
-
if (status != null) {
|
|
91
|
-
_queryParams.status = status;
|
|
92
|
-
}
|
|
93
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
77
|
+
const _queryParams = {
|
|
78
|
+
page_number: pageNumber,
|
|
79
|
+
page_size: pageSize,
|
|
80
|
+
ascending_order: ascendingOrder,
|
|
81
|
+
config_id: configId,
|
|
82
|
+
status,
|
|
83
|
+
};
|
|
84
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
85
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
94
86
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
95
87
|
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)
|
|
96
88
|
.base, "v0/evi/chats"),
|
|
@@ -133,21 +125,7 @@ class Chats {
|
|
|
133
125
|
});
|
|
134
126
|
}
|
|
135
127
|
}
|
|
136
|
-
|
|
137
|
-
case "non-json":
|
|
138
|
-
throw new errors.HumeError({
|
|
139
|
-
statusCode: _response.error.statusCode,
|
|
140
|
-
body: _response.error.rawBody,
|
|
141
|
-
rawResponse: _response.rawResponse,
|
|
142
|
-
});
|
|
143
|
-
case "timeout":
|
|
144
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chats.");
|
|
145
|
-
case "unknown":
|
|
146
|
-
throw new errors.HumeError({
|
|
147
|
-
message: _response.error.errorMessage,
|
|
148
|
-
rawResponse: _response.rawResponse,
|
|
149
|
-
});
|
|
150
|
-
}
|
|
128
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/evi/chats");
|
|
151
129
|
}));
|
|
152
130
|
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
153
131
|
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
@@ -164,11 +142,9 @@ class Chats {
|
|
|
164
142
|
});
|
|
165
143
|
}
|
|
166
144
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* @param {string} id - Identifier for a Chat. Formatted as a UUID.
|
|
145
|
+
* @param {string} id - Identifier for a chat. Formatted as a UUID.
|
|
170
146
|
* @param {Hume.empathicVoice.ChatsListChatEventsRequest} request
|
|
171
|
-
* @param {
|
|
147
|
+
* @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
172
148
|
*
|
|
173
149
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
174
150
|
*
|
|
@@ -184,17 +160,13 @@ class Chats {
|
|
|
184
160
|
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
185
161
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
186
162
|
const { pageSize, pageNumber, ascendingOrder } = request;
|
|
187
|
-
const _queryParams = {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
if (ascendingOrder != null) {
|
|
195
|
-
_queryParams.ascending_order = ascendingOrder.toString();
|
|
196
|
-
}
|
|
197
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
163
|
+
const _queryParams = {
|
|
164
|
+
page_size: pageSize,
|
|
165
|
+
page_number: pageNumber,
|
|
166
|
+
ascending_order: ascendingOrder,
|
|
167
|
+
};
|
|
168
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
169
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
198
170
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
199
171
|
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)
|
|
200
172
|
.base, `v0/evi/chats/${core.url.encodePathParam(id)}`),
|
|
@@ -237,21 +209,7 @@ class Chats {
|
|
|
237
209
|
});
|
|
238
210
|
}
|
|
239
211
|
}
|
|
240
|
-
|
|
241
|
-
case "non-json":
|
|
242
|
-
throw new errors.HumeError({
|
|
243
|
-
statusCode: _response.error.statusCode,
|
|
244
|
-
body: _response.error.rawBody,
|
|
245
|
-
rawResponse: _response.rawResponse,
|
|
246
|
-
});
|
|
247
|
-
case "timeout":
|
|
248
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chats/{id}.");
|
|
249
|
-
case "unknown":
|
|
250
|
-
throw new errors.HumeError({
|
|
251
|
-
message: _response.error.errorMessage,
|
|
252
|
-
rawResponse: _response.rawResponse,
|
|
253
|
-
});
|
|
254
|
-
}
|
|
212
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/evi/chats/{id}");
|
|
255
213
|
}));
|
|
256
214
|
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
257
215
|
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
@@ -268,10 +226,8 @@ class Chats {
|
|
|
268
226
|
});
|
|
269
227
|
}
|
|
270
228
|
/**
|
|
271
|
-
* Fetches the audio of a previous **Chat**. For more details, see our guide on audio reconstruction [here](/docs/speech-to-speech-evi/faq#can-i-access-the-audio-of-previous-conversations-with-evi).
|
|
272
|
-
*
|
|
273
229
|
* @param {string} id - Identifier for a chat. Formatted as a UUID.
|
|
274
|
-
* @param {
|
|
230
|
+
* @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
275
231
|
*
|
|
276
232
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
277
233
|
*
|
|
@@ -284,7 +240,8 @@ class Chats {
|
|
|
284
240
|
__getAudio(id, requestOptions) {
|
|
285
241
|
return __awaiter(this, void 0, void 0, function* () {
|
|
286
242
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
287
|
-
const
|
|
243
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
244
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
288
245
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
289
246
|
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/evi/chats/${core.url.encodePathParam(id)}/audio`),
|
|
290
247
|
method: "GET",
|
|
@@ -326,28 +283,8 @@ class Chats {
|
|
|
326
283
|
});
|
|
327
284
|
}
|
|
328
285
|
}
|
|
329
|
-
|
|
330
|
-
case "non-json":
|
|
331
|
-
throw new errors.HumeError({
|
|
332
|
-
statusCode: _response.error.statusCode,
|
|
333
|
-
body: _response.error.rawBody,
|
|
334
|
-
rawResponse: _response.rawResponse,
|
|
335
|
-
});
|
|
336
|
-
case "timeout":
|
|
337
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chats/{id}/audio.");
|
|
338
|
-
case "unknown":
|
|
339
|
-
throw new errors.HumeError({
|
|
340
|
-
message: _response.error.errorMessage,
|
|
341
|
-
rawResponse: _response.rawResponse,
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
_getCustomAuthorizationHeaders() {
|
|
347
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
348
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
349
|
-
return { "X-Hume-Api-Key": apiKeyValue };
|
|
286
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/evi/chats/{id}/audio");
|
|
350
287
|
});
|
|
351
288
|
}
|
|
352
289
|
}
|
|
353
|
-
exports.
|
|
290
|
+
exports.ChatsClient = ChatsClient;
|
|
@@ -19,6 +19,6 @@ export interface ChatsListChatEventsRequest {
|
|
|
19
19
|
* This parameter uses zero-based indexing. For example, setting `page_number` to 0 retrieves the first page of results (items 0-9 if `page_size` is 10), setting `page_number` to 1 retrieves the second page (items 10-19), and so on. Defaults to 0, which retrieves the first page.
|
|
20
20
|
*/
|
|
21
21
|
pageNumber?: number;
|
|
22
|
-
/**
|
|
22
|
+
/** Boolean to indicate if the results should be paginated in chronological order or reverse-chronological order. Defaults to true. */
|
|
23
23
|
ascendingOrder?: boolean;
|
|
24
24
|
}
|
|
@@ -19,7 +19,7 @@ export interface ChatsListChatsRequest {
|
|
|
19
19
|
* For example, if `page_size` is set to 10, each page will include up to 10 items. Defaults to 10.
|
|
20
20
|
*/
|
|
21
21
|
pageSize?: number;
|
|
22
|
-
/**
|
|
22
|
+
/** Boolean to indicate if the results should be paginated in chronological order or reverse-chronological order. Defaults to true. */
|
|
23
23
|
ascendingOrder?: boolean;
|
|
24
24
|
/** Filter to only include chats that used this config. */
|
|
25
25
|
configId?: string;
|