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,24 +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.ToolsClient = 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 ToolsClient {
|
|
56
|
+
constructor(options = {}) {
|
|
57
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
58
|
-
* Fetches a paginated list of **Tools**.
|
|
59
|
-
*
|
|
60
|
-
* Refer to our [tool use](/docs/speech-to-speech-evi/features/tool-use#function-calling) guide for comprehensive instructions on defining and integrating tools into EVI.
|
|
61
|
-
*
|
|
62
60
|
* @param {Hume.empathicVoice.ToolsListToolsRequest} request
|
|
63
|
-
* @param {
|
|
61
|
+
* @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
62
|
*
|
|
65
63
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
66
64
|
*
|
|
@@ -75,20 +73,14 @@ class Tools {
|
|
|
75
73
|
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
76
74
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
77
75
|
const { pageNumber, pageSize, restrictToMostRecent, name } = request;
|
|
78
|
-
const _queryParams = {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
_queryParams.restrict_to_most_recent = restrictToMostRecent.toString();
|
|
87
|
-
}
|
|
88
|
-
if (name != null) {
|
|
89
|
-
_queryParams.name = name;
|
|
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);
|
|
76
|
+
const _queryParams = {
|
|
77
|
+
page_number: pageNumber,
|
|
78
|
+
page_size: pageSize,
|
|
79
|
+
restrict_to_most_recent: restrictToMostRecent,
|
|
80
|
+
name,
|
|
81
|
+
};
|
|
82
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
83
|
+
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
84
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
93
85
|
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
86
|
.base, "v0/evi/tools"),
|
|
@@ -131,21 +123,7 @@ class Tools {
|
|
|
131
123
|
});
|
|
132
124
|
}
|
|
133
125
|
}
|
|
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/tools.");
|
|
143
|
-
case "unknown":
|
|
144
|
-
throw new errors.HumeError({
|
|
145
|
-
message: _response.error.errorMessage,
|
|
146
|
-
rawResponse: _response.rawResponse,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
126
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/evi/tools");
|
|
149
127
|
}));
|
|
150
128
|
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
151
129
|
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
@@ -162,12 +140,8 @@ class Tools {
|
|
|
162
140
|
});
|
|
163
141
|
}
|
|
164
142
|
/**
|
|
165
|
-
* Creates a **Tool** that can be added to an [EVI configuration](/reference/speech-to-speech-evi/configs/create-config).
|
|
166
|
-
*
|
|
167
|
-
* Refer to our [tool use](/docs/speech-to-speech-evi/features/tool-use#function-calling) guide for comprehensive instructions on defining and integrating tools into EVI.
|
|
168
|
-
*
|
|
169
143
|
* @param {Hume.empathicVoice.PostedUserDefinedTool} request
|
|
170
|
-
* @param {
|
|
144
|
+
* @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
171
145
|
*
|
|
172
146
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
173
147
|
*
|
|
@@ -186,7 +160,8 @@ class Tools {
|
|
|
186
160
|
__createTool(request, requestOptions) {
|
|
187
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
188
162
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
189
|
-
const
|
|
163
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
164
|
+
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);
|
|
190
165
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
191
166
|
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/tools"),
|
|
192
167
|
method: "POST",
|
|
@@ -234,31 +209,13 @@ class Tools {
|
|
|
234
209
|
});
|
|
235
210
|
}
|
|
236
211
|
}
|
|
237
|
-
|
|
238
|
-
case "non-json":
|
|
239
|
-
throw new errors.HumeError({
|
|
240
|
-
statusCode: _response.error.statusCode,
|
|
241
|
-
body: _response.error.rawBody,
|
|
242
|
-
rawResponse: _response.rawResponse,
|
|
243
|
-
});
|
|
244
|
-
case "timeout":
|
|
245
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/evi/tools.");
|
|
246
|
-
case "unknown":
|
|
247
|
-
throw new errors.HumeError({
|
|
248
|
-
message: _response.error.errorMessage,
|
|
249
|
-
rawResponse: _response.rawResponse,
|
|
250
|
-
});
|
|
251
|
-
}
|
|
212
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/evi/tools");
|
|
252
213
|
});
|
|
253
214
|
}
|
|
254
215
|
/**
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
* Refer to our [tool use](/docs/speech-to-speech-evi/features/tool-use#function-calling) guide for comprehensive instructions on defining and integrating tools into EVI.
|
|
258
|
-
*
|
|
259
|
-
* @param {string} id - Identifier for a Tool. Formatted as a UUID.
|
|
216
|
+
* @param {string} id
|
|
260
217
|
* @param {Hume.empathicVoice.ToolsListToolVersionsRequest} request
|
|
261
|
-
* @param {
|
|
218
|
+
* @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
262
219
|
*
|
|
263
220
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
264
221
|
*
|
|
@@ -270,17 +227,13 @@ class Tools {
|
|
|
270
227
|
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
271
228
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
272
229
|
const { pageNumber, pageSize, restrictToMostRecent } = request;
|
|
273
|
-
const _queryParams = {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
if (restrictToMostRecent != null) {
|
|
281
|
-
_queryParams.restrict_to_most_recent = restrictToMostRecent.toString();
|
|
282
|
-
}
|
|
283
|
-
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);
|
|
230
|
+
const _queryParams = {
|
|
231
|
+
page_number: pageNumber,
|
|
232
|
+
page_size: pageSize,
|
|
233
|
+
restrict_to_most_recent: restrictToMostRecent,
|
|
234
|
+
};
|
|
235
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
236
|
+
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);
|
|
284
237
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
285
238
|
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)
|
|
286
239
|
.base, `v0/evi/tools/${core.url.encodePathParam(id)}`),
|
|
@@ -323,21 +276,7 @@ class Tools {
|
|
|
323
276
|
});
|
|
324
277
|
}
|
|
325
278
|
}
|
|
326
|
-
|
|
327
|
-
case "non-json":
|
|
328
|
-
throw new errors.HumeError({
|
|
329
|
-
statusCode: _response.error.statusCode,
|
|
330
|
-
body: _response.error.rawBody,
|
|
331
|
-
rawResponse: _response.rawResponse,
|
|
332
|
-
});
|
|
333
|
-
case "timeout":
|
|
334
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/tools/{id}.");
|
|
335
|
-
case "unknown":
|
|
336
|
-
throw new errors.HumeError({
|
|
337
|
-
message: _response.error.errorMessage,
|
|
338
|
-
rawResponse: _response.rawResponse,
|
|
339
|
-
});
|
|
340
|
-
}
|
|
279
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/evi/tools/{id}");
|
|
341
280
|
}));
|
|
342
281
|
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
343
282
|
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
@@ -354,13 +293,9 @@ class Tools {
|
|
|
354
293
|
});
|
|
355
294
|
}
|
|
356
295
|
/**
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
* Refer to our [tool use](/docs/speech-to-speech-evi/features/tool-use#function-calling) guide for comprehensive instructions on defining and integrating tools into EVI.
|
|
360
|
-
*
|
|
361
|
-
* @param {string} id - Identifier for a Tool. Formatted as a UUID.
|
|
296
|
+
* @param {string} id - Identifier for a tool. Formatted as a UUID.
|
|
362
297
|
* @param {Hume.empathicVoice.PostedUserDefinedToolVersion} request
|
|
363
|
-
* @param {
|
|
298
|
+
* @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
364
299
|
*
|
|
365
300
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
366
301
|
*
|
|
@@ -378,7 +313,8 @@ class Tools {
|
|
|
378
313
|
__createToolVersion(id, request, requestOptions) {
|
|
379
314
|
return __awaiter(this, void 0, void 0, function* () {
|
|
380
315
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
381
|
-
const
|
|
316
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
317
|
+
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);
|
|
382
318
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
383
319
|
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/tools/${core.url.encodePathParam(id)}`),
|
|
384
320
|
method: "POST",
|
|
@@ -426,30 +362,12 @@ class Tools {
|
|
|
426
362
|
});
|
|
427
363
|
}
|
|
428
364
|
}
|
|
429
|
-
|
|
430
|
-
case "non-json":
|
|
431
|
-
throw new errors.HumeError({
|
|
432
|
-
statusCode: _response.error.statusCode,
|
|
433
|
-
body: _response.error.rawBody,
|
|
434
|
-
rawResponse: _response.rawResponse,
|
|
435
|
-
});
|
|
436
|
-
case "timeout":
|
|
437
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/evi/tools/{id}.");
|
|
438
|
-
case "unknown":
|
|
439
|
-
throw new errors.HumeError({
|
|
440
|
-
message: _response.error.errorMessage,
|
|
441
|
-
rawResponse: _response.rawResponse,
|
|
442
|
-
});
|
|
443
|
-
}
|
|
365
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/evi/tools/{id}");
|
|
444
366
|
});
|
|
445
367
|
}
|
|
446
368
|
/**
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
* Refer to our [tool use](/docs/speech-to-speech-evi/features/tool-use#function-calling) guide for comprehensive instructions on defining and integrating tools into EVI.
|
|
450
|
-
*
|
|
451
|
-
* @param {string} id - Identifier for a Tool. Formatted as a UUID.
|
|
452
|
-
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
369
|
+
* @param {string} id - Identifier for a tool. Formatted as a UUID.
|
|
370
|
+
* @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
453
371
|
*
|
|
454
372
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
455
373
|
*
|
|
@@ -462,7 +380,8 @@ class Tools {
|
|
|
462
380
|
__deleteTool(id, requestOptions) {
|
|
463
381
|
return __awaiter(this, void 0, void 0, function* () {
|
|
464
382
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
465
|
-
const
|
|
383
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
384
|
+
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);
|
|
466
385
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
467
386
|
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/tools/${core.url.encodePathParam(id)}`),
|
|
468
387
|
method: "DELETE",
|
|
@@ -495,31 +414,13 @@ class Tools {
|
|
|
495
414
|
});
|
|
496
415
|
}
|
|
497
416
|
}
|
|
498
|
-
|
|
499
|
-
case "non-json":
|
|
500
|
-
throw new errors.HumeError({
|
|
501
|
-
statusCode: _response.error.statusCode,
|
|
502
|
-
body: _response.error.rawBody,
|
|
503
|
-
rawResponse: _response.rawResponse,
|
|
504
|
-
});
|
|
505
|
-
case "timeout":
|
|
506
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling DELETE /v0/evi/tools/{id}.");
|
|
507
|
-
case "unknown":
|
|
508
|
-
throw new errors.HumeError({
|
|
509
|
-
message: _response.error.errorMessage,
|
|
510
|
-
rawResponse: _response.rawResponse,
|
|
511
|
-
});
|
|
512
|
-
}
|
|
417
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/evi/tools/{id}");
|
|
513
418
|
});
|
|
514
419
|
}
|
|
515
420
|
/**
|
|
516
|
-
*
|
|
517
|
-
*
|
|
518
|
-
* Refer to our [tool use](/docs/speech-to-speech-evi/features/tool-use#function-calling) guide for comprehensive instructions on defining and integrating tools into EVI.
|
|
519
|
-
*
|
|
520
|
-
* @param {string} id - Identifier for a Tool. Formatted as a UUID.
|
|
421
|
+
* @param {string} id - Identifier for a tool. Formatted as a UUID.
|
|
521
422
|
* @param {Hume.empathicVoice.PostedUserDefinedToolName} request
|
|
522
|
-
* @param {
|
|
423
|
+
* @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
523
424
|
*
|
|
524
425
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
525
426
|
*
|
|
@@ -534,7 +435,8 @@ class Tools {
|
|
|
534
435
|
__updateToolName(id, request, requestOptions) {
|
|
535
436
|
return __awaiter(this, void 0, void 0, function* () {
|
|
536
437
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
537
|
-
const
|
|
438
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
439
|
+
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);
|
|
538
440
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
539
441
|
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/tools/${core.url.encodePathParam(id)}`),
|
|
540
442
|
method: "PATCH",
|
|
@@ -574,35 +476,13 @@ class Tools {
|
|
|
574
476
|
});
|
|
575
477
|
}
|
|
576
478
|
}
|
|
577
|
-
|
|
578
|
-
case "non-json":
|
|
579
|
-
throw new errors.HumeError({
|
|
580
|
-
statusCode: _response.error.statusCode,
|
|
581
|
-
body: _response.error.rawBody,
|
|
582
|
-
rawResponse: _response.rawResponse,
|
|
583
|
-
});
|
|
584
|
-
case "timeout":
|
|
585
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling PATCH /v0/evi/tools/{id}.");
|
|
586
|
-
case "unknown":
|
|
587
|
-
throw new errors.HumeError({
|
|
588
|
-
message: _response.error.errorMessage,
|
|
589
|
-
rawResponse: _response.rawResponse,
|
|
590
|
-
});
|
|
591
|
-
}
|
|
479
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/evi/tools/{id}");
|
|
592
480
|
});
|
|
593
481
|
}
|
|
594
482
|
/**
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
-
* @param {string} id - Identifier for a Tool. Formatted as a UUID.
|
|
600
|
-
* @param {number} version - Version number for a Tool.
|
|
601
|
-
*
|
|
602
|
-
* Tools, Configs, Custom Voices, and Prompts are versioned. This versioning system supports iterative development, allowing you to progressively refine tools and revert to previous versions if needed.
|
|
603
|
-
*
|
|
604
|
-
* Version numbers are integer values representing different iterations of the Tool. Each update to the Tool increments its version number.
|
|
605
|
-
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
483
|
+
* @param {string} id - Identifier for a tool. Formatted as a UUID.
|
|
484
|
+
* @param {number} version - Version number for a tool. Version numbers should be integers.
|
|
485
|
+
* @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
606
486
|
*
|
|
607
487
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
608
488
|
*
|
|
@@ -615,7 +495,8 @@ class Tools {
|
|
|
615
495
|
__getToolVersion(id, version, requestOptions) {
|
|
616
496
|
return __awaiter(this, void 0, void 0, function* () {
|
|
617
497
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
618
|
-
const
|
|
498
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
499
|
+
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);
|
|
619
500
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
620
501
|
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/tools/${core.url.encodePathParam(id)}/version/${core.url.encodePathParam(version)}`),
|
|
621
502
|
method: "GET",
|
|
@@ -657,35 +538,13 @@ class Tools {
|
|
|
657
538
|
});
|
|
658
539
|
}
|
|
659
540
|
}
|
|
660
|
-
|
|
661
|
-
case "non-json":
|
|
662
|
-
throw new errors.HumeError({
|
|
663
|
-
statusCode: _response.error.statusCode,
|
|
664
|
-
body: _response.error.rawBody,
|
|
665
|
-
rawResponse: _response.rawResponse,
|
|
666
|
-
});
|
|
667
|
-
case "timeout":
|
|
668
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/tools/{id}/version/{version}.");
|
|
669
|
-
case "unknown":
|
|
670
|
-
throw new errors.HumeError({
|
|
671
|
-
message: _response.error.errorMessage,
|
|
672
|
-
rawResponse: _response.rawResponse,
|
|
673
|
-
});
|
|
674
|
-
}
|
|
541
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/evi/tools/{id}/version/{version}");
|
|
675
542
|
});
|
|
676
543
|
}
|
|
677
544
|
/**
|
|
678
|
-
*
|
|
679
|
-
*
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
* @param {string} id - Identifier for a Tool. Formatted as a UUID.
|
|
683
|
-
* @param {number} version - Version number for a Tool.
|
|
684
|
-
*
|
|
685
|
-
* Tools, Configs, Custom Voices, and Prompts are versioned. This versioning system supports iterative development, allowing you to progressively refine tools and revert to previous versions if needed.
|
|
686
|
-
*
|
|
687
|
-
* Version numbers are integer values representing different iterations of the Tool. Each update to the Tool increments its version number.
|
|
688
|
-
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
545
|
+
* @param {string} id - Identifier for a tool. Formatted as a UUID.
|
|
546
|
+
* @param {number} version - Version number for a tool. Version numbers should be integers.
|
|
547
|
+
* @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
689
548
|
*
|
|
690
549
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
691
550
|
*
|
|
@@ -698,7 +557,8 @@ class Tools {
|
|
|
698
557
|
__deleteToolVersion(id, version, requestOptions) {
|
|
699
558
|
return __awaiter(this, void 0, void 0, function* () {
|
|
700
559
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
701
|
-
const
|
|
560
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
561
|
+
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);
|
|
702
562
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
703
563
|
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/tools/${core.url.encodePathParam(id)}/version/${core.url.encodePathParam(version)}`),
|
|
704
564
|
method: "DELETE",
|
|
@@ -731,36 +591,14 @@ class Tools {
|
|
|
731
591
|
});
|
|
732
592
|
}
|
|
733
593
|
}
|
|
734
|
-
|
|
735
|
-
case "non-json":
|
|
736
|
-
throw new errors.HumeError({
|
|
737
|
-
statusCode: _response.error.statusCode,
|
|
738
|
-
body: _response.error.rawBody,
|
|
739
|
-
rawResponse: _response.rawResponse,
|
|
740
|
-
});
|
|
741
|
-
case "timeout":
|
|
742
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling DELETE /v0/evi/tools/{id}/version/{version}.");
|
|
743
|
-
case "unknown":
|
|
744
|
-
throw new errors.HumeError({
|
|
745
|
-
message: _response.error.errorMessage,
|
|
746
|
-
rawResponse: _response.rawResponse,
|
|
747
|
-
});
|
|
748
|
-
}
|
|
594
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/evi/tools/{id}/version/{version}");
|
|
749
595
|
});
|
|
750
596
|
}
|
|
751
597
|
/**
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
* Refer to our [tool use](/docs/speech-to-speech-evi/features/tool-use#function-calling) guide for comprehensive instructions on defining and integrating tools into EVI.
|
|
755
|
-
*
|
|
756
|
-
* @param {string} id - Identifier for a Tool. Formatted as a UUID.
|
|
757
|
-
* @param {number} version - Version number for a Tool.
|
|
758
|
-
*
|
|
759
|
-
* Tools, Configs, Custom Voices, and Prompts are versioned. This versioning system supports iterative development, allowing you to progressively refine tools and revert to previous versions if needed.
|
|
760
|
-
*
|
|
761
|
-
* Version numbers are integer values representing different iterations of the Tool. Each update to the Tool increments its version number.
|
|
598
|
+
* @param {string} id - Identifier for a tool. Formatted as a UUID.
|
|
599
|
+
* @param {number} version - Version number for a tool. Version numbers should be integers.
|
|
762
600
|
* @param {Hume.empathicVoice.PostedUserDefinedToolVersionDescription} request
|
|
763
|
-
* @param {
|
|
601
|
+
* @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
764
602
|
*
|
|
765
603
|
* @throws {@link Hume.empathicVoice.BadRequestError}
|
|
766
604
|
*
|
|
@@ -775,7 +613,8 @@ class Tools {
|
|
|
775
613
|
__updateToolDescription(id_1, version_1) {
|
|
776
614
|
return __awaiter(this, arguments, void 0, function* (id, version, request = {}, requestOptions) {
|
|
777
615
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
778
|
-
const
|
|
616
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
617
|
+
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);
|
|
779
618
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
780
619
|
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/tools/${core.url.encodePathParam(id)}/version/${core.url.encodePathParam(version)}`),
|
|
781
620
|
method: "PATCH",
|
|
@@ -823,28 +662,8 @@ class Tools {
|
|
|
823
662
|
});
|
|
824
663
|
}
|
|
825
664
|
}
|
|
826
|
-
|
|
827
|
-
case "non-json":
|
|
828
|
-
throw new errors.HumeError({
|
|
829
|
-
statusCode: _response.error.statusCode,
|
|
830
|
-
body: _response.error.rawBody,
|
|
831
|
-
rawResponse: _response.rawResponse,
|
|
832
|
-
});
|
|
833
|
-
case "timeout":
|
|
834
|
-
throw new errors.HumeTimeoutError("Timeout exceeded when calling PATCH /v0/evi/tools/{id}/version/{version}.");
|
|
835
|
-
case "unknown":
|
|
836
|
-
throw new errors.HumeError({
|
|
837
|
-
message: _response.error.errorMessage,
|
|
838
|
-
rawResponse: _response.rawResponse,
|
|
839
|
-
});
|
|
840
|
-
}
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
_getCustomAuthorizationHeaders() {
|
|
844
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
845
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
846
|
-
return { "X-Hume-Api-Key": apiKeyValue };
|
|
665
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/evi/tools/{id}/version/{version}");
|
|
847
666
|
});
|
|
848
667
|
}
|
|
849
668
|
}
|
|
850
|
-
exports.
|
|
669
|
+
exports.ToolsClient = ToolsClient;
|
|
@@ -9,18 +9,14 @@
|
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface PostedUserDefinedTool {
|
|
12
|
-
/**
|
|
12
|
+
/** Text describing what the tool does. */
|
|
13
13
|
description?: string;
|
|
14
|
-
/**
|
|
14
|
+
/** Text to use if the tool fails to generate content. */
|
|
15
15
|
fallbackContent?: string;
|
|
16
16
|
/** Name applied to all versions of a particular Tool. */
|
|
17
17
|
name: string;
|
|
18
|
-
/**
|
|
19
|
-
* Stringified JSON defining the parameters used by this version of the Tool.
|
|
20
|
-
*
|
|
21
|
-
* These parameters define the inputs needed for the Tool's execution, including the expected data type and description for each input field. Structured as a stringified JSON schema, this format ensures the Tool receives data in the expected format.
|
|
22
|
-
*/
|
|
18
|
+
/** Stringified JSON defining the parameters used by this version of the Tool. */
|
|
23
19
|
parameters: string;
|
|
24
|
-
/**
|
|
20
|
+
/** Description that is appended to a specific version of a Tool. */
|
|
25
21
|
versionDescription?: string;
|
|
26
22
|
}
|
|
@@ -8,16 +8,12 @@
|
|
|
8
8
|
* }
|
|
9
9
|
*/
|
|
10
10
|
export interface PostedUserDefinedToolVersion {
|
|
11
|
-
/**
|
|
11
|
+
/** Text describing what the tool does. */
|
|
12
12
|
description?: string;
|
|
13
|
-
/**
|
|
13
|
+
/** Text to use if the tool fails to generate content. */
|
|
14
14
|
fallbackContent?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Stringified JSON defining the parameters used by this version of the Tool.
|
|
17
|
-
*
|
|
18
|
-
* These parameters define the inputs needed for the Tool's execution, including the expected data type and description for each input field. Structured as a stringified JSON schema, this format ensures the Tool receives data in the expected format.
|
|
19
|
-
*/
|
|
15
|
+
/** Stringified JSON defining the parameters used by this version of the Tool. */
|
|
20
16
|
parameters: string;
|
|
21
|
-
/**
|
|
17
|
+
/** Description that is appended to a specific version of a Tool. */
|
|
22
18
|
versionDescription?: string;
|
|
23
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* When provided, the output is an assistant end message.
|
|
3
3
|
*/
|
|
4
4
|
export interface AssistantEnd {
|
|
5
5
|
/** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Our model adds appropriate emotional inflections and tones to the text based on the user's expressions and the context of the conversation. The synthesized audio is streamed back to the user as an Assistant Message.
|
|
2
|
+
* When provided, the input is spoken by EVI.
|
|
5
3
|
*/
|
|
6
4
|
export interface AssistantInput {
|
|
7
|
-
/** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
|
|
8
5
|
customSessionId?: string;
|
|
9
6
|
/**
|
|
10
7
|
* Assistant text to synthesize into spoken audio and insert into the conversation.
|
|
11
8
|
*
|
|
12
|
-
* EVI uses this text to generate spoken audio using our proprietary expressive text-to-speech model. Our model adds appropriate emotional inflections and tones to the text based on the user's expressions and the context of the conversation. The synthesized audio is streamed back to the user as an [Assistant Message](/reference/
|
|
9
|
+
* EVI uses this text to generate spoken audio using our proprietary expressive text-to-speech model. Our model adds appropriate emotional inflections and tones to the text based on the user's expressions and the context of the conversation. The synthesized audio is streamed back to the user as an [Assistant Message](/reference/empathic-voice-interface-evi/chat/chat#receive.Assistant%20Message.type).
|
|
13
10
|
*/
|
|
14
11
|
text: string;
|
|
15
12
|
/** The type of message sent through the socket; must be `assistant_input` for our server to correctly identify and process it as an Assistant Input message. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type * as Hume from "../../../index.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* When provided, the output is an assistant message.
|
|
4
4
|
*/
|
|
5
5
|
export interface AssistantMessage {
|
|
6
6
|
/** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
|
|
7
7
|
customSessionId?: string;
|
|
8
|
-
/** Indicates if this message was inserted into the conversation as text from an [Assistant Input message](/reference/
|
|
8
|
+
/** Indicates if this message was inserted into the conversation as text from an [Assistant Input message](/reference/empathic-voice-interface-evi/chat/chat#send.Assistant%20Input.text). */
|
|
9
9
|
fromText: boolean;
|
|
10
10
|
/** ID of the assistant message. Allows the Assistant Message to be tracked and referenced. */
|
|
11
11
|
id?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as Hume from "../../../index.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* When provided, the output is an Assistant Prosody message.
|
|
4
4
|
*/
|
|
5
5
|
export interface AssistantProsody {
|
|
6
6
|
/** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* For optimal transcription quality, the audio data should be transmitted in small chunks. Hume recommends streaming audio with a buffer window of `20` milliseconds (ms), or `100` milliseconds (ms) for web applications. See our [Audio Guide](/docs/speech-to-speech-evi/guides/audio) for more details on preparing and processing audio.
|
|
2
|
+
* When provided, the input is audio.
|
|
5
3
|
*/
|
|
6
4
|
export interface AudioInput {
|
|
7
5
|
/** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
|
|
@@ -16,6 +14,10 @@ export interface AudioInput {
|
|
|
16
14
|
* Hume recommends streaming audio with a buffer window of 20 milliseconds (ms), or 100 milliseconds (ms) for web applications.
|
|
17
15
|
*/
|
|
18
16
|
data: string;
|
|
19
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* The type of message sent through the socket; must be `audio_input` for our server to correctly identify and process it as an Audio Input message.
|
|
19
|
+
*
|
|
20
|
+
* This message is used for sending audio input data to EVI for processing and expression measurement. Audio data should be sent as a continuous stream, encoded in Base64.
|
|
21
|
+
*/
|
|
20
22
|
type: "audio_input";
|
|
21
23
|
}
|