@elevenlabs/elevenlabs-js 2.0.1 → 2.1.0
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/.mock/asyncapi.yml +6 -6
- package/.mock/definition/__package__.yml +109 -5
- package/.mock/definition/conversationalAi/agents/knowledgeBase.yml +32 -0
- package/.mock/definition/conversationalAi/agents/link.yml +2 -1
- package/.mock/definition/conversationalAi/agents/llmUsage.yml +51 -0
- package/.mock/definition/conversationalAi/llmUsage.yml +52 -0
- package/.mock/definition/v1TextToSpeechVoiceIdMultiStreamInput.yml +5 -3
- package/.mock/openapi.json +501 -1
- package/README.md +2 -2
- package/api/resources/audioIsolation/client/Client.js +4 -4
- package/api/resources/audioNative/client/Client.js +6 -6
- package/api/resources/conversationalAi/client/Client.d.ts +3 -0
- package/api/resources/conversationalAi/client/Client.js +21 -16
- package/api/resources/conversationalAi/resources/agents/client/Client.d.ts +6 -0
- package/api/resources/conversationalAi/resources/agents/client/Client.js +24 -14
- package/api/resources/conversationalAi/resources/agents/resources/index.d.ts +3 -0
- package/api/resources/conversationalAi/resources/agents/resources/index.js +4 -1
- package/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/client/Client.d.ts +44 -0
- package/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/client/Client.js +137 -0
- package/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/client/index.d.ts +1 -0
- package/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/client/index.js +2 -0
- package/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/index.d.ts +1 -0
- package/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/index.js +17 -0
- package/api/resources/conversationalAi/resources/agents/resources/link/client/Client.js +2 -2
- package/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/Client.d.ts +45 -0
- package/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/Client.js +141 -0
- package/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/index.d.ts +1 -0
- package/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/index.js +17 -0
- package/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/LlmUsageCalculatorRequestModel.d.ts +15 -0
- package/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/LlmUsageCalculatorRequestModel.js +5 -0
- package/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/index.d.ts +1 -0
- package/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/index.js +2 -0
- package/api/resources/conversationalAi/resources/agents/resources/llmUsage/index.d.ts +1 -0
- package/api/resources/conversationalAi/resources/agents/resources/llmUsage/index.js +17 -0
- package/api/resources/conversationalAi/resources/agents/resources/widget/client/Client.js +2 -2
- package/api/resources/conversationalAi/resources/agents/resources/widget/resources/avatar/client/Client.js +2 -2
- package/api/resources/conversationalAi/resources/batchCalls/client/Client.js +6 -6
- package/api/resources/conversationalAi/resources/conversations/client/Client.js +8 -8
- package/api/resources/conversationalAi/resources/conversations/resources/audio/client/Client.js +2 -2
- package/api/resources/conversationalAi/resources/conversations/resources/feedback/client/Client.js +2 -2
- package/api/resources/conversationalAi/resources/dashboard/resources/settings/client/Client.js +4 -4
- package/api/resources/conversationalAi/resources/index.d.ts +2 -0
- package/api/resources/conversationalAi/resources/index.js +3 -1
- package/api/resources/conversationalAi/resources/knowledgeBase/client/Client.js +2 -2
- package/api/resources/conversationalAi/resources/knowledgeBase/resources/document/client/Client.js +2 -2
- package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.js +16 -16
- package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/resources/chunk/client/Client.js +2 -2
- package/api/resources/conversationalAi/resources/llmUsage/client/Client.d.ts +48 -0
- package/api/resources/conversationalAi/resources/llmUsage/client/Client.js +144 -0
- package/api/resources/conversationalAi/resources/llmUsage/client/index.d.ts +1 -0
- package/api/resources/conversationalAi/resources/llmUsage/client/index.js +17 -0
- package/api/resources/conversationalAi/resources/llmUsage/client/requests/LlmUsageCalculatorPublicRequestModel.d.ts +19 -0
- package/api/resources/conversationalAi/resources/llmUsage/client/requests/LlmUsageCalculatorPublicRequestModel.js +5 -0
- package/api/resources/conversationalAi/resources/llmUsage/client/requests/index.d.ts +1 -0
- package/api/resources/conversationalAi/resources/llmUsage/client/requests/index.js +2 -0
- package/api/resources/conversationalAi/resources/llmUsage/index.d.ts +1 -0
- package/api/resources/conversationalAi/resources/llmUsage/index.js +17 -0
- package/api/resources/conversationalAi/resources/phoneNumbers/client/Client.js +10 -10
- package/api/resources/conversationalAi/resources/secrets/client/Client.js +6 -6
- package/api/resources/conversationalAi/resources/settings/client/Client.js +4 -4
- package/api/resources/conversationalAi/resources/sipTrunk/client/Client.js +2 -2
- package/api/resources/conversationalAi/resources/twilio/client/Client.js +2 -2
- package/api/resources/dubbing/client/Client.js +6 -6
- package/api/resources/dubbing/resources/audio/client/Client.js +2 -2
- package/api/resources/dubbing/resources/resource/client/Client.js +10 -10
- package/api/resources/dubbing/resources/resource/resources/language/client/Client.js +2 -2
- package/api/resources/dubbing/resources/resource/resources/segment/client/Client.js +4 -4
- package/api/resources/dubbing/resources/resource/resources/speaker/client/Client.js +4 -4
- package/api/resources/dubbing/resources/resource/resources/speaker/resources/segment/client/Client.js +2 -2
- package/api/resources/dubbing/resources/transcript/client/Client.js +2 -2
- package/api/resources/forcedAlignment/client/Client.js +2 -2
- package/api/resources/history/client/Client.js +10 -10
- package/api/resources/models/client/Client.js +2 -2
- package/api/resources/pronunciationDictionaries/client/Client.js +10 -10
- package/api/resources/pronunciationDictionaries/resources/rules/client/Client.js +4 -4
- package/api/resources/samples/client/Client.js +2 -2
- package/api/resources/speechToSpeech/client/Client.js +4 -4
- package/api/resources/studio/client/Client.js +2 -2
- package/api/resources/studio/resources/projects/client/Client.js +12 -12
- package/api/resources/studio/resources/projects/resources/chapters/client/Client.js +12 -12
- package/api/resources/studio/resources/projects/resources/chapters/resources/snapshots/client/Client.js +6 -6
- package/api/resources/studio/resources/projects/resources/content/client/Client.js +2 -2
- package/api/resources/studio/resources/projects/resources/pronunciationDictionaries/client/Client.js +2 -2
- package/api/resources/studio/resources/projects/resources/snapshots/client/Client.js +8 -8
- package/api/resources/textToSoundEffects/client/Client.js +2 -2
- package/api/resources/textToSpeech/client/Client.js +8 -8
- package/api/resources/textToVoice/client/Client.js +4 -4
- package/api/resources/usage/client/Client.js +2 -2
- package/api/resources/user/client/Client.js +2 -2
- package/api/resources/user/resources/subscription/client/Client.js +2 -2
- package/api/resources/voices/client/Client.js +16 -16
- package/api/resources/voices/resources/ivc/client/Client.js +2 -2
- package/api/resources/voices/resources/pvc/client/Client.js +6 -6
- package/api/resources/voices/resources/pvc/resources/samples/client/Client.js +6 -6
- package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/Client.js +2 -2
- package/api/resources/voices/resources/pvc/resources/samples/resources/speakers/client/Client.js +4 -4
- package/api/resources/voices/resources/pvc/resources/samples/resources/speakers/resources/audio/client/Client.js +2 -2
- package/api/resources/voices/resources/pvc/resources/samples/resources/waveform/client/Client.js +2 -2
- package/api/resources/voices/resources/pvc/resources/verification/client/Client.js +2 -2
- package/api/resources/voices/resources/pvc/resources/verification/resources/captcha/client/Client.js +4 -4
- package/api/resources/voices/resources/samples/resources/audio/client/Client.js +2 -2
- package/api/resources/voices/resources/settings/client/Client.js +6 -6
- package/api/resources/workspace/resources/groups/client/Client.js +2 -2
- package/api/resources/workspace/resources/groups/resources/members/client/Client.js +4 -4
- package/api/resources/workspace/resources/invites/client/Client.js +6 -6
- package/api/resources/workspace/resources/members/client/Client.js +4 -4
- package/api/resources/workspace/resources/resources/client/Client.js +6 -6
- package/api/types/AudioOutputMulti.d.ts +1 -1
- package/api/types/ChapterContentBlockInputModel.d.ts +1 -0
- package/api/types/ChapterContentBlockInputModelSubType.d.ts +10 -0
- package/api/types/ChapterContentBlockInputModelSubType.js +12 -0
- package/api/types/ConversationTokenDbModel.d.ts +2 -0
- package/api/types/GetAgentKnowledgebaseSizeResponseModel.d.ts +6 -0
- package/api/types/GetAgentKnowledgebaseSizeResponseModel.js +5 -0
- package/api/types/LlmUsageCalculatorLlmResponseModel.d.ts +8 -0
- package/api/types/LlmUsageCalculatorLlmResponseModel.js +5 -0
- package/api/types/LlmUsageCalculatorResponseModel.d.ts +7 -0
- package/api/types/LlmUsageCalculatorResponseModel.js +5 -0
- package/api/types/NativeMcpToolConfigInput.d.ts +20 -0
- package/api/types/NativeMcpToolConfigInput.js +5 -0
- package/api/types/NativeMcpToolConfigOutput.d.ts +20 -0
- package/api/types/NativeMcpToolConfigOutput.js +5 -0
- package/api/types/PromptAgent.d.ts +2 -0
- package/api/types/PromptAgentDbModel.d.ts +2 -0
- package/api/types/PromptAgentDbModelToolsItem.d.ts +4 -1
- package/api/types/PromptAgentInputToolsItem.d.ts +4 -1
- package/api/types/PromptAgentOutputToolsItem.d.ts +4 -1
- package/api/types/WebsocketTtsClientMessageMulti.d.ts +2 -2
- package/api/types/index.d.ts +6 -0
- package/api/types/index.js +6 -0
- package/dist/api/resources/audioIsolation/client/Client.js +4 -4
- package/dist/api/resources/audioNative/client/Client.js +6 -6
- package/dist/api/resources/conversationalAi/client/Client.d.ts +3 -0
- package/dist/api/resources/conversationalAi/client/Client.js +21 -16
- package/dist/api/resources/conversationalAi/resources/agents/client/Client.d.ts +6 -0
- package/dist/api/resources/conversationalAi/resources/agents/client/Client.js +24 -14
- package/dist/api/resources/conversationalAi/resources/agents/resources/index.d.ts +3 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/index.js +4 -1
- package/dist/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/client/Client.d.ts +44 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/client/Client.js +137 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/client/index.d.ts +1 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/client/index.js +2 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/index.d.ts +1 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/index.js +17 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/link/client/Client.js +2 -2
- package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/Client.d.ts +45 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/Client.js +141 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/index.d.ts +1 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/index.js +17 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/LlmUsageCalculatorRequestModel.d.ts +15 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/LlmUsageCalculatorRequestModel.js +5 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/index.d.ts +1 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/index.js +2 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/index.d.ts +1 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/index.js +17 -0
- package/dist/api/resources/conversationalAi/resources/agents/resources/widget/client/Client.js +2 -2
- package/dist/api/resources/conversationalAi/resources/agents/resources/widget/resources/avatar/client/Client.js +2 -2
- package/dist/api/resources/conversationalAi/resources/batchCalls/client/Client.js +6 -6
- package/dist/api/resources/conversationalAi/resources/conversations/client/Client.js +8 -8
- package/dist/api/resources/conversationalAi/resources/conversations/resources/audio/client/Client.js +2 -2
- package/dist/api/resources/conversationalAi/resources/conversations/resources/feedback/client/Client.js +2 -2
- package/dist/api/resources/conversationalAi/resources/dashboard/resources/settings/client/Client.js +4 -4
- package/dist/api/resources/conversationalAi/resources/index.d.ts +2 -0
- package/dist/api/resources/conversationalAi/resources/index.js +3 -1
- package/dist/api/resources/conversationalAi/resources/knowledgeBase/client/Client.js +2 -2
- package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/document/client/Client.js +2 -2
- package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.js +16 -16
- package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/resources/chunk/client/Client.js +2 -2
- package/dist/api/resources/conversationalAi/resources/llmUsage/client/Client.d.ts +48 -0
- package/dist/api/resources/conversationalAi/resources/llmUsage/client/Client.js +144 -0
- package/dist/api/resources/conversationalAi/resources/llmUsage/client/index.d.ts +1 -0
- package/dist/api/resources/conversationalAi/resources/llmUsage/client/index.js +17 -0
- package/dist/api/resources/conversationalAi/resources/llmUsage/client/requests/LlmUsageCalculatorPublicRequestModel.d.ts +19 -0
- package/dist/api/resources/conversationalAi/resources/llmUsage/client/requests/LlmUsageCalculatorPublicRequestModel.js +5 -0
- package/dist/api/resources/conversationalAi/resources/llmUsage/client/requests/index.d.ts +1 -0
- package/dist/api/resources/conversationalAi/resources/llmUsage/client/requests/index.js +2 -0
- package/dist/api/resources/conversationalAi/resources/llmUsage/index.d.ts +1 -0
- package/dist/api/resources/conversationalAi/resources/llmUsage/index.js +17 -0
- package/dist/api/resources/conversationalAi/resources/phoneNumbers/client/Client.js +10 -10
- package/dist/api/resources/conversationalAi/resources/secrets/client/Client.js +6 -6
- package/dist/api/resources/conversationalAi/resources/settings/client/Client.js +4 -4
- package/dist/api/resources/conversationalAi/resources/sipTrunk/client/Client.js +2 -2
- package/dist/api/resources/conversationalAi/resources/twilio/client/Client.js +2 -2
- package/dist/api/resources/dubbing/client/Client.js +6 -6
- package/dist/api/resources/dubbing/resources/audio/client/Client.js +2 -2
- package/dist/api/resources/dubbing/resources/resource/client/Client.js +10 -10
- package/dist/api/resources/dubbing/resources/resource/resources/language/client/Client.js +2 -2
- package/dist/api/resources/dubbing/resources/resource/resources/segment/client/Client.js +4 -4
- package/dist/api/resources/dubbing/resources/resource/resources/speaker/client/Client.js +4 -4
- package/dist/api/resources/dubbing/resources/resource/resources/speaker/resources/segment/client/Client.js +2 -2
- package/dist/api/resources/dubbing/resources/transcript/client/Client.js +2 -2
- package/dist/api/resources/forcedAlignment/client/Client.js +2 -2
- package/dist/api/resources/history/client/Client.js +10 -10
- package/dist/api/resources/models/client/Client.js +2 -2
- package/dist/api/resources/pronunciationDictionaries/client/Client.js +10 -10
- package/dist/api/resources/pronunciationDictionaries/resources/rules/client/Client.js +4 -4
- package/dist/api/resources/samples/client/Client.js +2 -2
- package/dist/api/resources/speechToSpeech/client/Client.js +4 -4
- package/dist/api/resources/studio/client/Client.js +2 -2
- package/dist/api/resources/studio/resources/projects/client/Client.js +12 -12
- package/dist/api/resources/studio/resources/projects/resources/chapters/client/Client.js +12 -12
- package/dist/api/resources/studio/resources/projects/resources/chapters/resources/snapshots/client/Client.js +6 -6
- package/dist/api/resources/studio/resources/projects/resources/content/client/Client.js +2 -2
- package/dist/api/resources/studio/resources/projects/resources/pronunciationDictionaries/client/Client.js +2 -2
- package/dist/api/resources/studio/resources/projects/resources/snapshots/client/Client.js +8 -8
- package/dist/api/resources/textToSoundEffects/client/Client.js +2 -2
- package/dist/api/resources/textToSpeech/client/Client.js +8 -8
- package/dist/api/resources/textToVoice/client/Client.js +4 -4
- package/dist/api/resources/usage/client/Client.js +2 -2
- package/dist/api/resources/user/client/Client.js +2 -2
- package/dist/api/resources/user/resources/subscription/client/Client.js +2 -2
- package/dist/api/resources/voices/client/Client.js +16 -16
- package/dist/api/resources/voices/resources/ivc/client/Client.js +2 -2
- package/dist/api/resources/voices/resources/pvc/client/Client.js +6 -6
- package/dist/api/resources/voices/resources/pvc/resources/samples/client/Client.js +6 -6
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/Client.js +2 -2
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/speakers/client/Client.js +4 -4
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/speakers/resources/audio/client/Client.js +2 -2
- package/dist/api/resources/voices/resources/pvc/resources/samples/resources/waveform/client/Client.js +2 -2
- package/dist/api/resources/voices/resources/pvc/resources/verification/client/Client.js +2 -2
- package/dist/api/resources/voices/resources/pvc/resources/verification/resources/captcha/client/Client.js +4 -4
- package/dist/api/resources/voices/resources/samples/resources/audio/client/Client.js +2 -2
- package/dist/api/resources/voices/resources/settings/client/Client.js +6 -6
- package/dist/api/resources/workspace/resources/groups/client/Client.js +2 -2
- package/dist/api/resources/workspace/resources/groups/resources/members/client/Client.js +4 -4
- package/dist/api/resources/workspace/resources/invites/client/Client.js +6 -6
- package/dist/api/resources/workspace/resources/members/client/Client.js +4 -4
- package/dist/api/resources/workspace/resources/resources/client/Client.js +6 -6
- package/dist/api/types/AudioOutputMulti.d.ts +1 -1
- package/dist/api/types/ChapterContentBlockInputModel.d.ts +1 -0
- package/dist/api/types/ChapterContentBlockInputModelSubType.d.ts +10 -0
- package/dist/api/types/ChapterContentBlockInputModelSubType.js +12 -0
- package/dist/api/types/ConversationTokenDbModel.d.ts +2 -0
- package/dist/api/types/GetAgentKnowledgebaseSizeResponseModel.d.ts +6 -0
- package/dist/api/types/GetAgentKnowledgebaseSizeResponseModel.js +5 -0
- package/dist/api/types/LlmUsageCalculatorLlmResponseModel.d.ts +8 -0
- package/dist/api/types/LlmUsageCalculatorLlmResponseModel.js +5 -0
- package/dist/api/types/LlmUsageCalculatorResponseModel.d.ts +7 -0
- package/dist/api/types/LlmUsageCalculatorResponseModel.js +5 -0
- package/dist/api/types/NativeMcpToolConfigInput.d.ts +20 -0
- package/dist/api/types/NativeMcpToolConfigInput.js +5 -0
- package/dist/api/types/NativeMcpToolConfigOutput.d.ts +20 -0
- package/dist/api/types/NativeMcpToolConfigOutput.js +5 -0
- package/dist/api/types/PromptAgent.d.ts +2 -0
- package/dist/api/types/PromptAgentDbModel.d.ts +2 -0
- package/dist/api/types/PromptAgentDbModelToolsItem.d.ts +4 -1
- package/dist/api/types/PromptAgentInputToolsItem.d.ts +4 -1
- package/dist/api/types/PromptAgentOutputToolsItem.d.ts +4 -1
- package/dist/api/types/WebsocketTtsClientMessageMulti.d.ts +2 -2
- package/dist/api/types/index.d.ts +6 -0
- package/dist/api/types/index.js +6 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/index.d.ts +1 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/index.js +1 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/resources/index.d.ts +2 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/resources/index.js +41 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/index.d.ts +1 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/index.js +17 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/LlmUsageCalculatorRequestModel.d.ts +14 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/LlmUsageCalculatorRequestModel.js +45 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/index.js +5 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/index.d.ts +1 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/index.js +17 -0
- package/dist/serialization/resources/conversationalAi/resources/index.d.ts +2 -0
- package/dist/serialization/resources/conversationalAi/resources/index.js +3 -1
- package/dist/serialization/resources/conversationalAi/resources/llmUsage/client/index.d.ts +1 -0
- package/dist/serialization/resources/conversationalAi/resources/llmUsage/client/index.js +17 -0
- package/dist/serialization/resources/conversationalAi/resources/llmUsage/client/requests/LlmUsageCalculatorPublicRequestModel.d.ts +14 -0
- package/dist/serialization/resources/conversationalAi/resources/llmUsage/client/requests/LlmUsageCalculatorPublicRequestModel.js +45 -0
- package/dist/serialization/resources/conversationalAi/resources/llmUsage/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/conversationalAi/resources/llmUsage/client/requests/index.js +5 -0
- package/dist/serialization/resources/conversationalAi/resources/llmUsage/index.d.ts +1 -0
- package/dist/serialization/resources/conversationalAi/resources/llmUsage/index.js +17 -0
- package/dist/serialization/types/AudioOutputMulti.d.ts +1 -1
- package/dist/serialization/types/AudioOutputMulti.js +1 -1
- package/dist/serialization/types/ChapterContentBlockInputModel.d.ts +2 -0
- package/dist/serialization/types/ChapterContentBlockInputModel.js +2 -0
- package/dist/serialization/types/ChapterContentBlockInputModelSubType.d.ts +10 -0
- package/dist/serialization/types/ChapterContentBlockInputModelSubType.js +41 -0
- package/dist/serialization/types/ConversationTokenDbModel.d.ts +1 -0
- package/dist/serialization/types/ConversationTokenDbModel.js +1 -0
- package/dist/serialization/types/GetAgentKnowledgebaseSizeResponseModel.d.ts +12 -0
- package/dist/serialization/types/GetAgentKnowledgebaseSizeResponseModel.js +43 -0
- package/dist/serialization/types/LlmUsageCalculatorLlmResponseModel.d.ts +14 -0
- package/dist/serialization/types/LlmUsageCalculatorLlmResponseModel.js +45 -0
- package/dist/serialization/types/LlmUsageCalculatorResponseModel.d.ts +13 -0
- package/dist/serialization/types/LlmUsageCalculatorResponseModel.js +44 -0
- package/dist/serialization/types/NativeMcpToolConfigInput.d.ts +18 -0
- package/dist/serialization/types/NativeMcpToolConfigInput.js +50 -0
- package/dist/serialization/types/NativeMcpToolConfigOutput.d.ts +18 -0
- package/dist/serialization/types/NativeMcpToolConfigOutput.js +50 -0
- package/dist/serialization/types/PromptAgent.d.ts +1 -0
- package/dist/serialization/types/PromptAgent.js +1 -0
- package/dist/serialization/types/PromptAgentDbModel.d.ts +1 -0
- package/dist/serialization/types/PromptAgentDbModel.js +1 -0
- package/dist/serialization/types/PromptAgentDbModelToolsItem.d.ts +5 -1
- package/dist/serialization/types/PromptAgentDbModelToolsItem.js +2 -0
- package/dist/serialization/types/PromptAgentInputToolsItem.d.ts +5 -1
- package/dist/serialization/types/PromptAgentInputToolsItem.js +2 -0
- package/dist/serialization/types/PromptAgentOutputToolsItem.d.ts +5 -1
- package/dist/serialization/types/PromptAgentOutputToolsItem.js +2 -0
- package/dist/serialization/types/WebsocketTtsClientMessageMulti.d.ts +1 -1
- package/dist/serialization/types/WebsocketTtsClientMessageMulti.js +1 -1
- package/dist/serialization/types/index.d.ts +6 -0
- package/dist/serialization/types/index.js +6 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +207 -0
- package/serialization/resources/conversationalAi/resources/agents/index.d.ts +1 -0
- package/serialization/resources/conversationalAi/resources/agents/index.js +1 -0
- package/serialization/resources/conversationalAi/resources/agents/resources/index.d.ts +2 -0
- package/serialization/resources/conversationalAi/resources/agents/resources/index.js +41 -0
- package/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/index.d.ts +1 -0
- package/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/index.js +17 -0
- package/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/LlmUsageCalculatorRequestModel.d.ts +14 -0
- package/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/LlmUsageCalculatorRequestModel.js +45 -0
- package/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/index.d.ts +1 -0
- package/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/client/requests/index.js +5 -0
- package/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/index.d.ts +1 -0
- package/serialization/resources/conversationalAi/resources/agents/resources/llmUsage/index.js +17 -0
- package/serialization/resources/conversationalAi/resources/index.d.ts +2 -0
- package/serialization/resources/conversationalAi/resources/index.js +3 -1
- package/serialization/resources/conversationalAi/resources/llmUsage/client/index.d.ts +1 -0
- package/serialization/resources/conversationalAi/resources/llmUsage/client/index.js +17 -0
- package/serialization/resources/conversationalAi/resources/llmUsage/client/requests/LlmUsageCalculatorPublicRequestModel.d.ts +14 -0
- package/serialization/resources/conversationalAi/resources/llmUsage/client/requests/LlmUsageCalculatorPublicRequestModel.js +45 -0
- package/serialization/resources/conversationalAi/resources/llmUsage/client/requests/index.d.ts +1 -0
- package/serialization/resources/conversationalAi/resources/llmUsage/client/requests/index.js +5 -0
- package/serialization/resources/conversationalAi/resources/llmUsage/index.d.ts +1 -0
- package/serialization/resources/conversationalAi/resources/llmUsage/index.js +17 -0
- package/serialization/types/AudioOutputMulti.d.ts +1 -1
- package/serialization/types/AudioOutputMulti.js +1 -1
- package/serialization/types/ChapterContentBlockInputModel.d.ts +2 -0
- package/serialization/types/ChapterContentBlockInputModel.js +2 -0
- package/serialization/types/ChapterContentBlockInputModelSubType.d.ts +10 -0
- package/serialization/types/ChapterContentBlockInputModelSubType.js +41 -0
- package/serialization/types/ConversationTokenDbModel.d.ts +1 -0
- package/serialization/types/ConversationTokenDbModel.js +1 -0
- package/serialization/types/GetAgentKnowledgebaseSizeResponseModel.d.ts +12 -0
- package/serialization/types/GetAgentKnowledgebaseSizeResponseModel.js +43 -0
- package/serialization/types/LlmUsageCalculatorLlmResponseModel.d.ts +14 -0
- package/serialization/types/LlmUsageCalculatorLlmResponseModel.js +45 -0
- package/serialization/types/LlmUsageCalculatorResponseModel.d.ts +13 -0
- package/serialization/types/LlmUsageCalculatorResponseModel.js +44 -0
- package/serialization/types/NativeMcpToolConfigInput.d.ts +18 -0
- package/serialization/types/NativeMcpToolConfigInput.js +50 -0
- package/serialization/types/NativeMcpToolConfigOutput.d.ts +18 -0
- package/serialization/types/NativeMcpToolConfigOutput.js +50 -0
- package/serialization/types/PromptAgent.d.ts +1 -0
- package/serialization/types/PromptAgent.js +1 -0
- package/serialization/types/PromptAgentDbModel.d.ts +1 -0
- package/serialization/types/PromptAgentDbModel.js +1 -0
- package/serialization/types/PromptAgentDbModelToolsItem.d.ts +5 -1
- package/serialization/types/PromptAgentDbModelToolsItem.js +2 -0
- package/serialization/types/PromptAgentInputToolsItem.d.ts +5 -1
- package/serialization/types/PromptAgentInputToolsItem.js +2 -0
- package/serialization/types/PromptAgentOutputToolsItem.d.ts +5 -1
- package/serialization/types/PromptAgentOutputToolsItem.js +2 -0
- package/serialization/types/WebsocketTtsClientMessageMulti.d.ts +1 -1
- package/serialization/types/WebsocketTtsClientMessageMulti.js +1 -1
- package/serialization/types/index.d.ts +6 -0
- package/serialization/types/index.js +6 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -57,6 +57,8 @@ const url_join_1 = __importDefault(require("url-join"));
|
|
|
57
57
|
const errors = __importStar(require("../../../../../../errors/index"));
|
|
58
58
|
const Client_1 = require("../resources/widget/client/Client");
|
|
59
59
|
const Client_2 = require("../resources/link/client/Client");
|
|
60
|
+
const Client_3 = require("../resources/knowledgeBase/client/Client");
|
|
61
|
+
const Client_4 = require("../resources/llmUsage/client/Client");
|
|
60
62
|
class Agents {
|
|
61
63
|
constructor(_options = {}) {
|
|
62
64
|
this._options = _options;
|
|
@@ -69,6 +71,14 @@ class Agents {
|
|
|
69
71
|
var _a;
|
|
70
72
|
return ((_a = this._link) !== null && _a !== void 0 ? _a : (this._link = new Client_2.Link(this._options)));
|
|
71
73
|
}
|
|
74
|
+
get knowledgeBase() {
|
|
75
|
+
var _a;
|
|
76
|
+
return ((_a = this._knowledgeBase) !== null && _a !== void 0 ? _a : (this._knowledgeBase = new Client_3.KnowledgeBase(this._options)));
|
|
77
|
+
}
|
|
78
|
+
get llmUsage() {
|
|
79
|
+
var _a;
|
|
80
|
+
return ((_a = this._llmUsage) !== null && _a !== void 0 ? _a : (this._llmUsage = new Client_4.LlmUsage(this._options)));
|
|
81
|
+
}
|
|
72
82
|
/**
|
|
73
83
|
* Create an agent from a config object
|
|
74
84
|
*
|
|
@@ -93,13 +103,13 @@ class Agents {
|
|
|
93
103
|
method: "POST",
|
|
94
104
|
headers: Object.assign({ "xi-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
|
|
95
105
|
? yield core.Supplier.get(this._options.apiKey)
|
|
96
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.0
|
|
106
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.1.0", "User-Agent": "@elevenlabs/elevenlabs-js/v2.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
97
107
|
contentType: "application/json",
|
|
98
108
|
requestType: "json",
|
|
99
109
|
body: serializers.conversationalAi.BodyCreateAgentV1ConvaiAgentsCreatePost.jsonOrThrow(request, {
|
|
100
110
|
unrecognizedObjectKeys: "strip",
|
|
101
111
|
}),
|
|
102
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 :
|
|
112
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
103
113
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
104
114
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
105
115
|
});
|
|
@@ -170,10 +180,10 @@ class Agents {
|
|
|
170
180
|
method: "GET",
|
|
171
181
|
headers: Object.assign({ "xi-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
|
|
172
182
|
? yield core.Supplier.get(this._options.apiKey)
|
|
173
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.0
|
|
183
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.1.0", "User-Agent": "@elevenlabs/elevenlabs-js/v2.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
174
184
|
contentType: "application/json",
|
|
175
185
|
requestType: "json",
|
|
176
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 :
|
|
186
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
177
187
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
178
188
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
179
189
|
});
|
|
@@ -244,10 +254,10 @@ class Agents {
|
|
|
244
254
|
method: "DELETE",
|
|
245
255
|
headers: Object.assign({ "xi-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
|
|
246
256
|
? yield core.Supplier.get(this._options.apiKey)
|
|
247
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.0
|
|
257
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.1.0", "User-Agent": "@elevenlabs/elevenlabs-js/v2.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
248
258
|
contentType: "application/json",
|
|
249
259
|
requestType: "json",
|
|
250
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 :
|
|
260
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
251
261
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
252
262
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
253
263
|
});
|
|
@@ -311,13 +321,13 @@ class Agents {
|
|
|
311
321
|
method: "PATCH",
|
|
312
322
|
headers: Object.assign({ "xi-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
|
|
313
323
|
? yield core.Supplier.get(this._options.apiKey)
|
|
314
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.0
|
|
324
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.1.0", "User-Agent": "@elevenlabs/elevenlabs-js/v2.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
315
325
|
contentType: "application/json",
|
|
316
326
|
requestType: "json",
|
|
317
327
|
body: serializers.conversationalAi.UpdateAgentRequest.jsonOrThrow(request, {
|
|
318
328
|
unrecognizedObjectKeys: "strip",
|
|
319
329
|
}),
|
|
320
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 :
|
|
330
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
321
331
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
322
332
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
323
333
|
});
|
|
@@ -399,11 +409,11 @@ class Agents {
|
|
|
399
409
|
method: "GET",
|
|
400
410
|
headers: Object.assign({ "xi-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
|
|
401
411
|
? yield core.Supplier.get(this._options.apiKey)
|
|
402
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.0
|
|
412
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.1.0", "User-Agent": "@elevenlabs/elevenlabs-js/v2.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
403
413
|
contentType: "application/json",
|
|
404
414
|
queryParameters: _queryParams,
|
|
405
415
|
requestType: "json",
|
|
406
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 :
|
|
416
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
407
417
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
408
418
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
409
419
|
});
|
|
@@ -482,11 +492,11 @@ class Agents {
|
|
|
482
492
|
method: "POST",
|
|
483
493
|
headers: Object.assign({ "xi-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
|
|
484
494
|
? yield core.Supplier.get(this._options.apiKey)
|
|
485
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.0
|
|
495
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.1.0", "User-Agent": "@elevenlabs/elevenlabs-js/v2.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
486
496
|
contentType: "application/json",
|
|
487
497
|
requestType: "json",
|
|
488
498
|
body: serializers.conversationalAi.BodySimulatesAConversationV1ConvaiAgentsAgentIdSimulateConversationPost.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
489
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 :
|
|
499
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
490
500
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
491
501
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
492
502
|
});
|
|
@@ -565,11 +575,11 @@ class Agents {
|
|
|
565
575
|
method: "POST",
|
|
566
576
|
headers: Object.assign({ "xi-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
|
|
567
577
|
? yield core.Supplier.get(this._options.apiKey)
|
|
568
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.0
|
|
578
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.1.0", "User-Agent": "@elevenlabs/elevenlabs-js/v2.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
569
579
|
contentType: "application/json",
|
|
570
580
|
requestType: "json",
|
|
571
581
|
body: serializers.conversationalAi.BodySimulatesAConversationStreamV1ConvaiAgentsAgentIdSimulateConversationStreamPost.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
572
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 :
|
|
582
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
573
583
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
574
584
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
575
585
|
});
|
|
@@ -36,7 +36,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.link = exports.widget = void 0;
|
|
39
|
+
exports.llmUsage = exports.knowledgeBase = exports.link = exports.widget = void 0;
|
|
40
40
|
exports.widget = __importStar(require("./widget"));
|
|
41
41
|
exports.link = __importStar(require("./link"));
|
|
42
|
+
exports.knowledgeBase = __importStar(require("./knowledgeBase"));
|
|
43
|
+
exports.llmUsage = __importStar(require("./llmUsage"));
|
|
42
44
|
__exportStar(require("./widget/client/requests"), exports);
|
|
45
|
+
__exportStar(require("./llmUsage/client/requests"), exports);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../../../environments";
|
|
5
|
+
import * as core from "../../../../../../../../core";
|
|
6
|
+
import * as ElevenLabs from "../../../../../../../index";
|
|
7
|
+
export declare namespace KnowledgeBase {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ElevenLabsEnvironment | environments.ElevenLabsEnvironmentUrls>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
/** Override the xi-api-key header */
|
|
13
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
14
|
+
}
|
|
15
|
+
interface RequestOptions {
|
|
16
|
+
/** The maximum time to wait for a response in seconds. */
|
|
17
|
+
timeoutInSeconds?: number;
|
|
18
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
19
|
+
maxRetries?: number;
|
|
20
|
+
/** A hook to abort the request. */
|
|
21
|
+
abortSignal?: AbortSignal;
|
|
22
|
+
/** Override the xi-api-key header */
|
|
23
|
+
apiKey?: string | undefined;
|
|
24
|
+
/** Additional headers to include in the request. */
|
|
25
|
+
headers?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export declare class KnowledgeBase {
|
|
29
|
+
protected readonly _options: KnowledgeBase.Options;
|
|
30
|
+
constructor(_options?: KnowledgeBase.Options);
|
|
31
|
+
/**
|
|
32
|
+
* Returns the number of pages in the agent's knowledge base.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} agentId
|
|
35
|
+
* @param {KnowledgeBase.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* await client.conversationalAi.agents.knowledgeBase.size("agent_id")
|
|
41
|
+
*/
|
|
42
|
+
size(agentId: string, requestOptions?: KnowledgeBase.RequestOptions): core.HttpResponsePromise<ElevenLabs.GetAgentKnowledgebaseSizeResponseModel>;
|
|
43
|
+
private __size;
|
|
44
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.KnowledgeBase = void 0;
|
|
52
|
+
const environments = __importStar(require("../../../../../../../../environments"));
|
|
53
|
+
const core = __importStar(require("../../../../../../../../core"));
|
|
54
|
+
const ElevenLabs = __importStar(require("../../../../../../../index"));
|
|
55
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
56
|
+
const serializers = __importStar(require("../../../../../../../../serialization/index"));
|
|
57
|
+
const errors = __importStar(require("../../../../../../../../errors/index"));
|
|
58
|
+
class KnowledgeBase {
|
|
59
|
+
constructor(_options = {}) {
|
|
60
|
+
this._options = _options;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Returns the number of pages in the agent's knowledge base.
|
|
64
|
+
*
|
|
65
|
+
* @param {string} agentId
|
|
66
|
+
* @param {KnowledgeBase.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
|
+
*
|
|
68
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* await client.conversationalAi.agents.knowledgeBase.size("agent_id")
|
|
72
|
+
*/
|
|
73
|
+
size(agentId, requestOptions) {
|
|
74
|
+
return core.HttpResponsePromise.fromPromise(this.__size(agentId, requestOptions));
|
|
75
|
+
}
|
|
76
|
+
__size(agentId, requestOptions) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
const _response = yield core.fetcher({
|
|
80
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, `v1/convai/agent/${encodeURIComponent(agentId)}/knowledge-base/size`),
|
|
81
|
+
method: "GET",
|
|
82
|
+
headers: Object.assign({ "xi-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
|
|
83
|
+
? yield core.Supplier.get(this._options.apiKey)
|
|
84
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.1.0", "User-Agent": "@elevenlabs/elevenlabs-js/v2.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
85
|
+
contentType: "application/json",
|
|
86
|
+
requestType: "json",
|
|
87
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
88
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
89
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
90
|
+
});
|
|
91
|
+
if (_response.ok) {
|
|
92
|
+
return {
|
|
93
|
+
data: serializers.GetAgentKnowledgebaseSizeResponseModel.parseOrThrow(_response.body, {
|
|
94
|
+
unrecognizedObjectKeys: "passthrough",
|
|
95
|
+
allowUnrecognizedUnionMembers: true,
|
|
96
|
+
allowUnrecognizedEnumValues: true,
|
|
97
|
+
breadcrumbsPrefix: ["response"],
|
|
98
|
+
}),
|
|
99
|
+
rawResponse: _response.rawResponse,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (_response.error.reason === "status-code") {
|
|
103
|
+
switch (_response.error.statusCode) {
|
|
104
|
+
case 422:
|
|
105
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
106
|
+
unrecognizedObjectKeys: "passthrough",
|
|
107
|
+
allowUnrecognizedUnionMembers: true,
|
|
108
|
+
allowUnrecognizedEnumValues: true,
|
|
109
|
+
breadcrumbsPrefix: ["response"],
|
|
110
|
+
}), _response.rawResponse);
|
|
111
|
+
default:
|
|
112
|
+
throw new errors.ElevenLabsError({
|
|
113
|
+
statusCode: _response.error.statusCode,
|
|
114
|
+
body: _response.error.body,
|
|
115
|
+
rawResponse: _response.rawResponse,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
switch (_response.error.reason) {
|
|
120
|
+
case "non-json":
|
|
121
|
+
throw new errors.ElevenLabsError({
|
|
122
|
+
statusCode: _response.error.statusCode,
|
|
123
|
+
body: _response.error.rawBody,
|
|
124
|
+
rawResponse: _response.rawResponse,
|
|
125
|
+
});
|
|
126
|
+
case "timeout":
|
|
127
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/agent/{agent_id}/knowledge-base/size.");
|
|
128
|
+
case "unknown":
|
|
129
|
+
throw new errors.ElevenLabsError({
|
|
130
|
+
message: _response.error.errorMessage,
|
|
131
|
+
rawResponse: _response.rawResponse,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.KnowledgeBase = KnowledgeBase;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/api/resources/conversationalAi/resources/agents/resources/knowledgeBase/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client"), exports);
|
package/dist/api/resources/conversationalAi/resources/agents/resources/link/client/Client.js
CHANGED
|
@@ -81,10 +81,10 @@ class Link {
|
|
|
81
81
|
method: "GET",
|
|
82
82
|
headers: Object.assign({ "xi-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
|
|
83
83
|
? yield core.Supplier.get(this._options.apiKey)
|
|
84
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.0
|
|
84
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.1.0", "User-Agent": "@elevenlabs/elevenlabs-js/v2.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
85
85
|
contentType: "application/json",
|
|
86
86
|
requestType: "json",
|
|
87
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 :
|
|
87
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
88
88
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
89
89
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
90
90
|
});
|
package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/Client.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../../../environments";
|
|
5
|
+
import * as core from "../../../../../../../../core";
|
|
6
|
+
import * as ElevenLabs from "../../../../../../../index";
|
|
7
|
+
export declare namespace LlmUsage {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ElevenLabsEnvironment | environments.ElevenLabsEnvironmentUrls>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
/** Override the xi-api-key header */
|
|
13
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
14
|
+
}
|
|
15
|
+
interface RequestOptions {
|
|
16
|
+
/** The maximum time to wait for a response in seconds. */
|
|
17
|
+
timeoutInSeconds?: number;
|
|
18
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
19
|
+
maxRetries?: number;
|
|
20
|
+
/** A hook to abort the request. */
|
|
21
|
+
abortSignal?: AbortSignal;
|
|
22
|
+
/** Override the xi-api-key header */
|
|
23
|
+
apiKey?: string | undefined;
|
|
24
|
+
/** Additional headers to include in the request. */
|
|
25
|
+
headers?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export declare class LlmUsage {
|
|
29
|
+
protected readonly _options: LlmUsage.Options;
|
|
30
|
+
constructor(_options?: LlmUsage.Options);
|
|
31
|
+
/**
|
|
32
|
+
* Calculates expected number of LLM tokens needed for the specified agent.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} agentId
|
|
35
|
+
* @param {ElevenLabs.conversationalAi.agents.LlmUsageCalculatorRequestModel} request
|
|
36
|
+
* @param {LlmUsage.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
|
+
*
|
|
38
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* await client.conversationalAi.agents.llmUsage.calculate("agent_id")
|
|
42
|
+
*/
|
|
43
|
+
calculate(agentId: string, request?: ElevenLabs.conversationalAi.agents.LlmUsageCalculatorRequestModel, requestOptions?: LlmUsage.RequestOptions): core.HttpResponsePromise<ElevenLabs.LlmUsageCalculatorResponseModel>;
|
|
44
|
+
private __calculate;
|
|
45
|
+
}
|
package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/Client.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.LlmUsage = void 0;
|
|
52
|
+
const environments = __importStar(require("../../../../../../../../environments"));
|
|
53
|
+
const core = __importStar(require("../../../../../../../../core"));
|
|
54
|
+
const ElevenLabs = __importStar(require("../../../../../../../index"));
|
|
55
|
+
const serializers = __importStar(require("../../../../../../../../serialization/index"));
|
|
56
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
57
|
+
const errors = __importStar(require("../../../../../../../../errors/index"));
|
|
58
|
+
class LlmUsage {
|
|
59
|
+
constructor(_options = {}) {
|
|
60
|
+
this._options = _options;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Calculates expected number of LLM tokens needed for the specified agent.
|
|
64
|
+
*
|
|
65
|
+
* @param {string} agentId
|
|
66
|
+
* @param {ElevenLabs.conversationalAi.agents.LlmUsageCalculatorRequestModel} request
|
|
67
|
+
* @param {LlmUsage.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
|
+
*
|
|
69
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* await client.conversationalAi.agents.llmUsage.calculate("agent_id")
|
|
73
|
+
*/
|
|
74
|
+
calculate(agentId, request = {}, requestOptions) {
|
|
75
|
+
return core.HttpResponsePromise.fromPromise(this.__calculate(agentId, request, requestOptions));
|
|
76
|
+
}
|
|
77
|
+
__calculate(agentId_1) {
|
|
78
|
+
return __awaiter(this, arguments, void 0, function* (agentId, request = {}, requestOptions) {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
const _response = yield core.fetcher({
|
|
81
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, `v1/convai/agent/${encodeURIComponent(agentId)}/llm-usage/calculate`),
|
|
82
|
+
method: "POST",
|
|
83
|
+
headers: Object.assign({ "xi-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
|
|
84
|
+
? yield core.Supplier.get(this._options.apiKey)
|
|
85
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js", "X-Fern-SDK-Version": "v2.1.0", "User-Agent": "@elevenlabs/elevenlabs-js/v2.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
86
|
+
contentType: "application/json",
|
|
87
|
+
requestType: "json",
|
|
88
|
+
body: serializers.conversationalAi.agents.LlmUsageCalculatorRequestModel.jsonOrThrow(request, {
|
|
89
|
+
unrecognizedObjectKeys: "strip",
|
|
90
|
+
}),
|
|
91
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
92
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
93
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
94
|
+
});
|
|
95
|
+
if (_response.ok) {
|
|
96
|
+
return {
|
|
97
|
+
data: serializers.LlmUsageCalculatorResponseModel.parseOrThrow(_response.body, {
|
|
98
|
+
unrecognizedObjectKeys: "passthrough",
|
|
99
|
+
allowUnrecognizedUnionMembers: true,
|
|
100
|
+
allowUnrecognizedEnumValues: true,
|
|
101
|
+
breadcrumbsPrefix: ["response"],
|
|
102
|
+
}),
|
|
103
|
+
rawResponse: _response.rawResponse,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (_response.error.reason === "status-code") {
|
|
107
|
+
switch (_response.error.statusCode) {
|
|
108
|
+
case 422:
|
|
109
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
110
|
+
unrecognizedObjectKeys: "passthrough",
|
|
111
|
+
allowUnrecognizedUnionMembers: true,
|
|
112
|
+
allowUnrecognizedEnumValues: true,
|
|
113
|
+
breadcrumbsPrefix: ["response"],
|
|
114
|
+
}), _response.rawResponse);
|
|
115
|
+
default:
|
|
116
|
+
throw new errors.ElevenLabsError({
|
|
117
|
+
statusCode: _response.error.statusCode,
|
|
118
|
+
body: _response.error.body,
|
|
119
|
+
rawResponse: _response.rawResponse,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
switch (_response.error.reason) {
|
|
124
|
+
case "non-json":
|
|
125
|
+
throw new errors.ElevenLabsError({
|
|
126
|
+
statusCode: _response.error.statusCode,
|
|
127
|
+
body: _response.error.rawBody,
|
|
128
|
+
rawResponse: _response.rawResponse,
|
|
129
|
+
});
|
|
130
|
+
case "timeout":
|
|
131
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/agent/{agent_id}/llm-usage/calculate.");
|
|
132
|
+
case "unknown":
|
|
133
|
+
throw new errors.ElevenLabsError({
|
|
134
|
+
message: _response.error.errorMessage,
|
|
135
|
+
rawResponse: _response.rawResponse,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
exports.LlmUsage = LlmUsage;
|
package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|
package/dist/api/resources/conversationalAi/resources/agents/resources/llmUsage/client/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {}
|
|
7
|
+
*/
|
|
8
|
+
export interface LlmUsageCalculatorRequestModel {
|
|
9
|
+
/** Length of the prompt in characters. */
|
|
10
|
+
promptLength?: number;
|
|
11
|
+
/** Pages of content in pdf documents OR urls in agent's Knowledge Base. */
|
|
12
|
+
numberOfPages?: number;
|
|
13
|
+
/** Whether RAG is enabled. */
|
|
14
|
+
ragEnabled?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type LlmUsageCalculatorRequestModel } from "./LlmUsageCalculatorRequestModel";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client";
|