agora-agents 2.3.1 → 2.5.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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.js +8 -16
- package/dist/cjs/agentkit/Agent.js +6 -5
- package/dist/cjs/agentkit/AgentSession.js +2 -0
- package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.js +4 -0
- package/dist/cjs/agentkit/avatar-types.d.ts +18 -5
- package/dist/cjs/agentkit/avatar-types.js +31 -3
- package/dist/cjs/agentkit/constants.d.ts +6 -0
- package/dist/cjs/agentkit/constants.js +6 -1
- package/dist/cjs/agentkit/index.d.ts +10 -10
- package/dist/cjs/agentkit/index.js +11 -3
- package/dist/cjs/agentkit/region-vendors.d.ts +2 -1
- package/dist/cjs/agentkit/types.d.ts +26 -5
- package/dist/cjs/agentkit/vendors/avatar.d.ts +3 -3
- package/dist/cjs/agentkit/vendors/avatar.js +3 -3
- package/dist/cjs/agentkit/vendors/base.d.ts +4 -0
- package/dist/cjs/agentkit/vendors/base.js +4 -0
- package/dist/cjs/agentkit/vendors/cn.d.ts +19 -1
- package/dist/cjs/agentkit/vendors/cn.js +23 -3
- package/dist/cjs/agentkit/vendors/llm.d.ts +1 -1
- package/dist/cjs/agentkit/vendors/llm.js +13 -3
- package/dist/cjs/agentkit/vendors/mllm.d.ts +1 -1
- package/dist/cjs/agentkit/vendors/mllm.js +3 -3
- package/dist/cjs/agentkit/vendors/stt.d.ts +31 -0
- package/dist/cjs/agentkit/vendors/stt.js +26 -1
- package/dist/cjs/agentkit/vendors/tts.d.ts +137 -5
- package/dist/cjs/agentkit/vendors/tts.js +104 -5
- package/dist/cjs/api/resources/agents/client/requests/ListAgentsRequest.d.ts +2 -3
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +18 -1
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +8 -0
- package/dist/cjs/api/resources/agents/types/GetHistoryAgentsResponse.d.ts +6 -0
- package/dist/cjs/api/resources/agents/types/index.d.ts +0 -1
- package/dist/cjs/api/resources/agents/types/index.js +0 -1
- package/dist/cjs/api/types/Asr.d.ts +4 -1
- package/dist/cjs/api/types/GenericHttpTts.d.ts +13 -0
- package/dist/cjs/api/types/GenericHttpTts.js +3 -0
- package/dist/cjs/api/types/GenericHttpTtsParams.d.ts +21 -0
- package/dist/cjs/api/types/GenericHttpTtsParams.js +3 -0
- package/dist/cjs/api/types/GradiumTts.d.ts +9 -0
- package/dist/cjs/api/types/GradiumTts.js +3 -0
- package/dist/cjs/api/types/GradiumTtsParams.d.ts +17 -0
- package/dist/cjs/api/types/GradiumTtsParams.js +3 -0
- package/dist/cjs/api/types/Llm.d.ts +24 -1
- package/dist/cjs/api/types/Llm.js +8 -0
- package/dist/cjs/api/types/MistralTts.d.ts +9 -0
- package/dist/cjs/api/types/MistralTts.js +3 -0
- package/dist/cjs/api/types/MistralTtsParams.d.ts +13 -0
- package/dist/cjs/api/types/MistralTtsParams.js +3 -0
- package/dist/cjs/api/types/RimeTts.d.ts +10 -0
- package/dist/cjs/api/types/RimeTts.js +9 -0
- package/dist/cjs/api/types/RimeTtsParams.d.ts +2 -2
- package/dist/cjs/api/types/SpatiusAvatarParams.d.ts +23 -0
- package/dist/cjs/api/types/SpatiusAvatarParams.js +3 -0
- package/dist/cjs/api/types/Tts.d.ts +13 -1
- package/dist/cjs/api/types/XAiAsr.d.ts +10 -0
- package/dist/cjs/api/types/XAiAsr.js +3 -0
- package/dist/cjs/api/types/XAiAsrParams.d.ts +15 -0
- package/dist/cjs/api/types/XAiAsrParams.js +3 -0
- package/dist/cjs/api/types/XAiTts.d.ts +9 -0
- package/dist/cjs/api/types/XAiTts.js +3 -0
- package/dist/cjs/api/types/XAiTtsParams.d.ts +15 -0
- package/dist/cjs/api/types/XAiTtsParams.js +3 -0
- package/dist/cjs/api/types/index.d.ts +11 -0
- package/dist/cjs/api/types/index.js +11 -0
- package/dist/cjs/core/base64.js +1 -5
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +11 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.mjs +8 -16
- package/dist/esm/agentkit/Agent.mjs +6 -5
- package/dist/esm/agentkit/AgentSession.mjs +3 -1
- package/dist/esm/agentkit/__tests__/area-aware-vendors.test.mjs +5 -1
- package/dist/esm/agentkit/avatar-types.d.mts +18 -5
- package/dist/esm/agentkit/avatar-types.mjs +30 -3
- package/dist/esm/agentkit/constants.d.mts +6 -0
- package/dist/esm/agentkit/constants.mjs +5 -0
- package/dist/esm/agentkit/index.d.mts +10 -10
- package/dist/esm/agentkit/index.mjs +5 -5
- package/dist/esm/agentkit/region-vendors.d.mts +2 -1
- package/dist/esm/agentkit/types.d.mts +26 -5
- package/dist/esm/agentkit/vendors/avatar.d.mts +3 -3
- package/dist/esm/agentkit/vendors/avatar.mjs +3 -3
- package/dist/esm/agentkit/vendors/base.d.mts +4 -0
- package/dist/esm/agentkit/vendors/base.mjs +4 -0
- package/dist/esm/agentkit/vendors/cn.d.mts +19 -1
- package/dist/esm/agentkit/vendors/cn.mjs +21 -2
- package/dist/esm/agentkit/vendors/llm.d.mts +1 -1
- package/dist/esm/agentkit/vendors/llm.mjs +13 -3
- package/dist/esm/agentkit/vendors/mllm.d.mts +1 -1
- package/dist/esm/agentkit/vendors/mllm.mjs +3 -3
- package/dist/esm/agentkit/vendors/stt.d.mts +31 -0
- package/dist/esm/agentkit/vendors/stt.mjs +24 -0
- package/dist/esm/agentkit/vendors/tts.d.mts +137 -5
- package/dist/esm/agentkit/vendors/tts.mjs +99 -4
- package/dist/esm/api/resources/agents/client/requests/ListAgentsRequest.d.mts +2 -3
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +18 -1
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +8 -0
- package/dist/esm/api/resources/agents/types/GetHistoryAgentsResponse.d.mts +6 -0
- package/dist/esm/api/resources/agents/types/index.d.mts +0 -1
- package/dist/esm/api/resources/agents/types/index.mjs +0 -1
- package/dist/esm/api/types/Asr.d.mts +4 -1
- package/dist/esm/api/types/GenericHttpTts.d.mts +13 -0
- package/dist/esm/api/types/GenericHttpTts.mjs +2 -0
- package/dist/esm/api/types/GenericHttpTtsParams.d.mts +21 -0
- package/dist/esm/api/types/GenericHttpTtsParams.mjs +2 -0
- package/dist/esm/api/types/GradiumTts.d.mts +9 -0
- package/dist/esm/api/types/GradiumTts.mjs +2 -0
- package/dist/esm/api/types/GradiumTtsParams.d.mts +17 -0
- package/dist/esm/api/types/GradiumTtsParams.mjs +2 -0
- package/dist/esm/api/types/Llm.d.mts +24 -1
- package/dist/esm/api/types/Llm.mjs +8 -0
- package/dist/esm/api/types/MistralTts.d.mts +9 -0
- package/dist/esm/api/types/MistralTts.mjs +2 -0
- package/dist/esm/api/types/MistralTtsParams.d.mts +13 -0
- package/dist/esm/api/types/MistralTtsParams.mjs +2 -0
- package/dist/esm/api/types/RimeTts.d.mts +10 -0
- package/dist/esm/api/types/RimeTts.mjs +8 -1
- package/dist/esm/api/types/RimeTtsParams.d.mts +2 -2
- package/dist/esm/api/types/SpatiusAvatarParams.d.mts +23 -0
- package/dist/esm/api/types/SpatiusAvatarParams.mjs +2 -0
- package/dist/esm/api/types/Tts.d.mts +13 -1
- package/dist/esm/api/types/XAiAsr.d.mts +10 -0
- package/dist/esm/api/types/XAiAsr.mjs +2 -0
- package/dist/esm/api/types/XAiAsrParams.d.mts +15 -0
- package/dist/esm/api/types/XAiAsrParams.mjs +2 -0
- package/dist/esm/api/types/XAiTts.d.mts +9 -0
- package/dist/esm/api/types/XAiTts.mjs +2 -0
- package/dist/esm/api/types/XAiTtsParams.d.mts +15 -0
- package/dist/esm/api/types/XAiTtsParams.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +11 -0
- package/dist/esm/api/types/index.mjs +11 -0
- package/dist/esm/core/base64.mjs +1 -5
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/dist/cjs/api/resources/agents/types/ListAgentsRequestState.d.ts +0 -10
- package/dist/cjs/api/resources/agents/types/ListAgentsRequestState.js +0 -13
- package/dist/esm/api/resources/agents/types/ListAgentsRequestState.d.mts +0 -10
- package/dist/esm/api/resources/agents/types/ListAgentsRequestState.mjs +0 -10
package/dist/cjs/core/base64.js
CHANGED
|
@@ -4,11 +4,7 @@ exports.base64Encode = base64Encode;
|
|
|
4
4
|
exports.base64Decode = base64Decode;
|
|
5
5
|
function base64ToBytes(base64) {
|
|
6
6
|
const binString = atob(base64);
|
|
7
|
-
|
|
8
|
-
for (let i = 0; i < binString.length; i++) {
|
|
9
|
-
bytes[i] = binString.charCodeAt(i);
|
|
10
|
-
}
|
|
11
|
-
return bytes;
|
|
7
|
+
return Uint8Array.from(binString, (m) => m.codePointAt(0));
|
|
12
8
|
}
|
|
13
9
|
function bytesToBase64(bytes) {
|
|
14
10
|
const binString = String.fromCodePoint(...bytes);
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type { AgoraAuthMode } from "./AgoraPoolClient.js";
|
|
2
2
|
export { AgoraClient } from "./AgoraPoolClient.js";
|
|
3
3
|
export type { AgoraArea, AreaScope, GlobalArea } from "./agentkit/area.js";
|
|
4
|
-
export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AgentOptions, AgentPreset, AgentSessionEvent, AgentSessionEventHandler, AgentSessionOptions, AgentsClient, AkoolAvatarConfig, AkoolAvatarOptions, AkoolSampleRate, AliyunLLMOptions, AmazonBedrockOptions, AmazonSTTOptions, AmazonTTSOptions, AmazonTts, AmazonTtsParams, AnamAvatarConfig, AnamAvatarOptions, AnthropicOptions, AresSTTOptions, AsrConfig, AsrPreset, AsrVendorName, AssemblyAISTTOptions, AvatarConfig, AvatarVendor, AvatarWireVendor, AzureOpenAIOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CartesiaSampleRate, CartesiaTTSOptions, CartesiaTts, CartesiaTtsParams, CNAvatarVendor, CNLlmVendor, CNSttVendor, CNTtsVendor, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, CustomLLMOptions, DeepgramSTTOptions, DeepgramTTSOptions, DeepSeekLLMOptions, DifyOptions, Eagerness, ElevenLabsSampleRate, ElevenLabsTTSOptions, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTTSOptions, FishAudioTts, FishAudioTtsParams, GeminiLiveOptions, GeminiOptions, GenerateConvoAITokenOptions, GenerateTokenOptions, GenericAvatarConfig, GenericAvatarOptions, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GlobalAvatarVendor, GlobalLlmVendor, GlobalSttVendor, GlobalTtsVendor, GoogleSTTOptions, GoogleTTSOptions, GoogleTts, GoogleTtsParams, GroqOptions, HeyGenAvatarConfig, HeyGenAvatarOptions, HeyGenSampleRate, HumeAITTSOptions, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LiveAvatarAvatarConfig, LiveAvatarAvatarOptions, LiveAvatarSampleRate, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmPreset, LlmStyle, LlmVendor, McpServersItem, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MicrosoftSampleRate, MicrosoftSTTOptions, MicrosoftTTSOptions, MicrosoftTts, MicrosoftTtsParams, MiniMaxCNTTSOptions, MiniMaxTTSOptions, MinimaxTts, MinimaxTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTTSOptions, MurfTts, MurfTtsParams, OpenAIOptions, OpenAIRealtimeOptions, OpenAISTTOptions, OpenAITTSOptions, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, PresetCategory, PresetInput, RimeTTSOptions, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SampleRate, SarvamSTTOptions, SarvamTTSOptions, SarvamTts, SarvamTtsParams, SayOptions, SensetimeAvatarConfig, SensetimeAvatarOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpeakPriority, SpeechmaticsSTTOptions, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, StepFunTTSOptions, StrictAvatarConfig, SttConfig, SttVendor, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TtsPreset, TtsVendor, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, VertexAILLMOptions, VertexAIOptions, XaiGrokOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./agentkit/index.js";
|
|
5
|
-
export { Agent, AgentPresets, AgentSession, AkoolAvatar, AliyunLLM, AmazonBedrock, AmazonSTT, AmazonTTS, AnamAvatar, Anthropic, AresSTT, AssemblyAISTT, AudioScenario, AzureOpenAI, BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseMLLM, BaseSTT, BaseTTS, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CartesiaTTS, CosyVoiceTTS, CustomLLM, DataChannel, DeepgramSTT, DeepgramTTS, DeepSeekLLM, Dify, ElevenLabsTTS, ExpiresIn, FengmingSTT, FillerWordsSelectionRule, FishAudioTTS, Gemini, GeminiLive, GenericAvatar, Geofence, GoogleSTT, GoogleTTS, Groq, generateConvoAIToken, generateRtcToken, HeyGenAvatar, HumeAITTS, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, LiveAvatarAvatar, MAX_EXPIRY_SECONDS, MicrosoftCNSTT, MicrosoftCNTTS, MicrosoftSTT, MicrosoftTTS, MiniMaxCNTTS, MiniMaxTTS, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, MurfTTS, normalizePresetInput, OpenAI, OpenAIRealtime, OpenAISTT, OpenAITTS, RimeTTS, SalModeValues, SarvamSTT, SarvamTTS, SensetimeAvatar, SilenceActionValues, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, SpeechmaticsSTT, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, toBaseAvatarConfig, VertexAI, VertexAILLM, validateAvatarConfig, validateTtsSampleRate, XaiGrok, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./agentkit/index.js";
|
|
4
|
+
export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AgentOptions, AgentPreset, AgentSessionEvent, AgentSessionEventHandler, AgentSessionOptions, AgentsClient, AkoolAvatarConfig, AkoolAvatarOptions, AkoolSampleRate, AliyunLLMOptions, AmazonBedrockOptions, AmazonSTTOptions, AmazonTTSOptions, AmazonTts, AmazonTtsParams, AnamAvatarConfig, AnamAvatarOptions, AnthropicOptions, AresSTTOptions, AsrConfig, AsrPreset, AsrVendorName, AssemblyAISTTOptions, AvatarConfig, AvatarVendor, AvatarWireVendor, AzureOpenAIOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CartesiaSampleRate, CartesiaTTSOptions, CartesiaTts, CartesiaTtsParams, CNAvatarVendor, CNLlmVendor, CNSttVendor, CNTtsVendor, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, CustomLLMOptions, DeepgramSTTOptions, DeepgramTTSOptions, DeepSeekLLMOptions, DifyOptions, Eagerness, ElevenLabsSampleRate, ElevenLabsTTSOptions, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTTSOptions, FishAudioTts, FishAudioTtsParams, GeminiLiveOptions, GeminiOptions, GenerateConvoAITokenOptions, GenerateTokenOptions, GenericAvatarConfig, GenericAvatarOptions, GenericTTSOptions, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GlobalAvatarVendor, GlobalLlmVendor, GlobalSttVendor, GlobalTtsVendor, GoogleSTTOptions, GoogleTTSOptions, GoogleTts, GoogleTtsParams, GradiumTTSOptions, GradiumTts, GradiumTtsParams, GroqOptions, HeyGenAvatarConfig, HeyGenAvatarOptions, HeyGenSampleRate, HumeAITTSOptions, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LiveAvatarAvatarConfig, LiveAvatarAvatarOptions, LiveAvatarSampleRate, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmPreset, LlmStyle, LlmVendor, McpServersItem, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MicrosoftSampleRate, MicrosoftSTTOptions, MicrosoftTTSOptions, MicrosoftTts, MicrosoftTtsParams, MiniMaxCNTTSOptions, MiniMaxTTSOptions, MinimaxTts, MinimaxTtsParams, MistralTTSOptions, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTTSOptions, MurfTts, MurfTtsParams, OpenAIOptions, OpenAIRealtimeOptions, OpenAISTTOptions, OpenAITTSOptions, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, PresetCategory, PresetInput, RimeTTSOptions, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SampleRate, SarvamSTTOptions, SarvamTTSOptions, SarvamTts, SarvamTtsParams, SayOptions, SensetimeAvatarConfig, SensetimeAvatarOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpatiusAvatarConfig, SpatiusAvatarOptions, SpatiusAvatarParams, SpeakPriority, SpeechmaticsSTTOptions, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, StepFunTTSOptions, StrictAvatarConfig, SttConfig, SttVendor, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TtsPreset, TtsVendor, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, VertexAILLMOptions, VertexAIOptions, XAiAsr, XAiAsrParams, XAiSTTOptions, XAiTTSOptions, XAiTts, XAiTtsParams, XaiGrokOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./agentkit/index.js";
|
|
5
|
+
export { Agent, AgentPresets, AgentSession, AkoolAvatar, AliyunLLM, AmazonBedrock, AmazonSTT, AmazonTTS, AnamAvatar, Anthropic, AresSTT, AssemblyAISTT, AudioScenario, AzureOpenAI, BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseMLLM, BaseSTT, BaseTTS, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CartesiaTTS, CosyVoiceTTS, CredentialMode, CustomLLM, DataChannel, DeepgramSTT, DeepgramTTS, DeepSeekLLM, Dify, ElevenLabsTTS, ExpiresIn, FengmingSTT, FillerWordsSelectionRule, FishAudioTTS, Gemini, GeminiLive, GenericAvatar, GenericTTS, Geofence, GoogleSTT, GoogleTTS, GradiumTTS, Groq, generateConvoAIToken, generateRtcToken, HeyGenAvatar, HumeAITTS, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, LiveAvatarAvatar, MAX_EXPIRY_SECONDS, MicrosoftCNSTT, MicrosoftCNTTS, MicrosoftSTT, MicrosoftTTS, MiniMaxCNTTS, MiniMaxTTS, MistralTTS, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, MurfTTS, normalizePresetInput, OpenAI, OpenAIRealtime, OpenAISTT, OpenAITTS, RimeTTS, SalModeValues, SarvamSTT, SarvamTTS, SensetimeAvatar, SilenceActionValues, SpatiusAvatar, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, SpeechmaticsSTT, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, toBaseAvatarConfig, VertexAI, VertexAILLM, validateAvatarConfig, validateTtsSampleRate, XAiSTT, XAiTTS, XaiGrok, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./agentkit/index.js";
|
|
6
6
|
export * as Agora from "./api/index.js";
|
|
7
7
|
export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
8
8
|
export { Area } from "./core/domain/index.js";
|
package/dist/cjs/index.js
CHANGED
|
@@ -36,9 +36,9 @@ 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.
|
|
40
|
-
exports.
|
|
41
|
-
exports.AgoraTimeoutError = exports.AgoraError = exports.AgoraEnvironment = exports.Area = exports.Agora = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XaiGrok = exports.validateTtsSampleRate = exports.validateAvatarConfig = exports.VertexAILLM = exports.VertexAI = exports.toBaseAvatarConfig = exports.TurnDetectionTypeValues = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnSpeakingActionIgnore = void 0;
|
|
39
|
+
exports.Groq = exports.GradiumTTS = exports.GoogleTTS = exports.GoogleSTT = exports.Geofence = exports.GenericTTS = exports.GenericAvatar = exports.GeminiLive = exports.Gemini = exports.FishAudioTTS = exports.FillerWordsSelectionRule = exports.FengmingSTT = exports.ExpiresIn = exports.ElevenLabsTTS = exports.Dify = exports.DeepSeekLLM = exports.DeepgramTTS = exports.DeepgramSTT = exports.DataChannel = exports.CustomLLM = exports.CredentialMode = exports.CosyVoiceTTS = exports.CartesiaTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.AzureOpenAI = exports.AudioScenario = exports.AssemblyAISTT = exports.AresSTT = exports.Anthropic = exports.AnamAvatar = exports.AmazonTTS = exports.AmazonSTT = exports.AmazonBedrock = exports.AliyunLLM = exports.AkoolAvatar = exports.AgentSession = exports.AgentPresets = exports.Agent = exports.AgoraClient = void 0;
|
|
40
|
+
exports.StepFunTTS = exports.SpeechmaticsSTT = exports.SpeakPriorityValues = exports.SpeakPriorityInterrupt = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SpatiusAvatar = exports.SilenceActionValues = exports.SensetimeAvatar = exports.SarvamTTS = exports.SarvamSTT = exports.SalModeValues = exports.RimeTTS = exports.OpenAITTS = exports.OpenAISTT = exports.OpenAIRealtime = exports.OpenAI = exports.normalizePresetInput = exports.MurfTTS = exports.MllmTurnDetectionModeValues = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeAgoraVad = exports.MistralTTS = exports.MiniMaxTTS = exports.MiniMaxCNTTS = exports.MicrosoftTTS = exports.MicrosoftSTT = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.MAX_EXPIRY_SECONDS = exports.LiveAvatarAvatar = exports.isSpatiusAvatar = exports.isSensetimeAvatar = exports.isLiveAvatarAvatar = exports.isHeyGenAvatar = exports.isGenericAvatar = exports.isAvatarTokenManaged = exports.isAnamAvatar = exports.isAkoolAvatar = exports.InterruptionModeValues = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeKeywords = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.HumeAITTS = exports.HeyGenAvatar = exports.generateRtcToken = exports.generateConvoAIToken = void 0;
|
|
41
|
+
exports.AgoraTimeoutError = exports.AgoraError = exports.AgoraEnvironment = exports.Area = exports.Agora = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XaiGrok = exports.XAiTTS = exports.XAiSTT = exports.validateTtsSampleRate = exports.validateAvatarConfig = exports.VertexAILLM = exports.VertexAI = exports.toBaseAvatarConfig = exports.TurnDetectionTypeValues = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.ThinkOnListeningActionIgnore = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = void 0;
|
|
42
42
|
var AgoraPoolClient_js_1 = require("./AgoraPoolClient.js");
|
|
43
43
|
Object.defineProperty(exports, "AgoraClient", { enumerable: true, get: function () { return AgoraPoolClient_js_1.AgoraClient; } });
|
|
44
44
|
// Agentkit layer exports - clean, ergonomic API
|
|
@@ -72,6 +72,7 @@ Object.defineProperty(exports, "BytedanceLLM", { enumerable: true, get: function
|
|
|
72
72
|
Object.defineProperty(exports, "BytedanceTTS", { enumerable: true, get: function () { return index_js_1.BytedanceTTS; } });
|
|
73
73
|
Object.defineProperty(exports, "CartesiaTTS", { enumerable: true, get: function () { return index_js_1.CartesiaTTS; } });
|
|
74
74
|
Object.defineProperty(exports, "CosyVoiceTTS", { enumerable: true, get: function () { return index_js_1.CosyVoiceTTS; } });
|
|
75
|
+
Object.defineProperty(exports, "CredentialMode", { enumerable: true, get: function () { return index_js_1.CredentialMode; } });
|
|
75
76
|
Object.defineProperty(exports, "CustomLLM", { enumerable: true, get: function () { return index_js_1.CustomLLM; } });
|
|
76
77
|
Object.defineProperty(exports, "DataChannel", { enumerable: true, get: function () { return index_js_1.DataChannel; } });
|
|
77
78
|
Object.defineProperty(exports, "DeepgramSTT", { enumerable: true, get: function () { return index_js_1.DeepgramSTT; } });
|
|
@@ -87,9 +88,11 @@ Object.defineProperty(exports, "FishAudioTTS", { enumerable: true, get: function
|
|
|
87
88
|
Object.defineProperty(exports, "Gemini", { enumerable: true, get: function () { return index_js_1.Gemini; } });
|
|
88
89
|
Object.defineProperty(exports, "GeminiLive", { enumerable: true, get: function () { return index_js_1.GeminiLive; } });
|
|
89
90
|
Object.defineProperty(exports, "GenericAvatar", { enumerable: true, get: function () { return index_js_1.GenericAvatar; } });
|
|
91
|
+
Object.defineProperty(exports, "GenericTTS", { enumerable: true, get: function () { return index_js_1.GenericTTS; } });
|
|
90
92
|
Object.defineProperty(exports, "Geofence", { enumerable: true, get: function () { return index_js_1.Geofence; } });
|
|
91
93
|
Object.defineProperty(exports, "GoogleSTT", { enumerable: true, get: function () { return index_js_1.GoogleSTT; } });
|
|
92
94
|
Object.defineProperty(exports, "GoogleTTS", { enumerable: true, get: function () { return index_js_1.GoogleTTS; } });
|
|
95
|
+
Object.defineProperty(exports, "GradiumTTS", { enumerable: true, get: function () { return index_js_1.GradiumTTS; } });
|
|
93
96
|
Object.defineProperty(exports, "Groq", { enumerable: true, get: function () { return index_js_1.Groq; } });
|
|
94
97
|
Object.defineProperty(exports, "generateConvoAIToken", { enumerable: true, get: function () { return index_js_1.generateConvoAIToken; } });
|
|
95
98
|
Object.defineProperty(exports, "generateRtcToken", { enumerable: true, get: function () { return index_js_1.generateRtcToken; } });
|
|
@@ -109,6 +112,7 @@ Object.defineProperty(exports, "isGenericAvatar", { enumerable: true, get: funct
|
|
|
109
112
|
Object.defineProperty(exports, "isHeyGenAvatar", { enumerable: true, get: function () { return index_js_1.isHeyGenAvatar; } });
|
|
110
113
|
Object.defineProperty(exports, "isLiveAvatarAvatar", { enumerable: true, get: function () { return index_js_1.isLiveAvatarAvatar; } });
|
|
111
114
|
Object.defineProperty(exports, "isSensetimeAvatar", { enumerable: true, get: function () { return index_js_1.isSensetimeAvatar; } });
|
|
115
|
+
Object.defineProperty(exports, "isSpatiusAvatar", { enumerable: true, get: function () { return index_js_1.isSpatiusAvatar; } });
|
|
112
116
|
Object.defineProperty(exports, "LiveAvatarAvatar", { enumerable: true, get: function () { return index_js_1.LiveAvatarAvatar; } });
|
|
113
117
|
Object.defineProperty(exports, "MAX_EXPIRY_SECONDS", { enumerable: true, get: function () { return index_js_1.MAX_EXPIRY_SECONDS; } });
|
|
114
118
|
Object.defineProperty(exports, "MicrosoftCNSTT", { enumerable: true, get: function () { return index_js_1.MicrosoftCNSTT; } });
|
|
@@ -117,6 +121,7 @@ Object.defineProperty(exports, "MicrosoftSTT", { enumerable: true, get: function
|
|
|
117
121
|
Object.defineProperty(exports, "MicrosoftTTS", { enumerable: true, get: function () { return index_js_1.MicrosoftTTS; } });
|
|
118
122
|
Object.defineProperty(exports, "MiniMaxCNTTS", { enumerable: true, get: function () { return index_js_1.MiniMaxCNTTS; } });
|
|
119
123
|
Object.defineProperty(exports, "MiniMaxTTS", { enumerable: true, get: function () { return index_js_1.MiniMaxTTS; } });
|
|
124
|
+
Object.defineProperty(exports, "MistralTTS", { enumerable: true, get: function () { return index_js_1.MistralTTS; } });
|
|
120
125
|
Object.defineProperty(exports, "MllmTurnDetectionModeAgoraVad", { enumerable: true, get: function () { return index_js_1.MllmTurnDetectionModeAgoraVad; } });
|
|
121
126
|
Object.defineProperty(exports, "MllmTurnDetectionModeSemanticVad", { enumerable: true, get: function () { return index_js_1.MllmTurnDetectionModeSemanticVad; } });
|
|
122
127
|
Object.defineProperty(exports, "MllmTurnDetectionModeServerVad", { enumerable: true, get: function () { return index_js_1.MllmTurnDetectionModeServerVad; } });
|
|
@@ -135,6 +140,7 @@ Object.defineProperty(exports, "SarvamSTT", { enumerable: true, get: function ()
|
|
|
135
140
|
Object.defineProperty(exports, "SarvamTTS", { enumerable: true, get: function () { return index_js_1.SarvamTTS; } });
|
|
136
141
|
Object.defineProperty(exports, "SensetimeAvatar", { enumerable: true, get: function () { return index_js_1.SensetimeAvatar; } });
|
|
137
142
|
Object.defineProperty(exports, "SilenceActionValues", { enumerable: true, get: function () { return index_js_1.SilenceActionValues; } });
|
|
143
|
+
Object.defineProperty(exports, "SpatiusAvatar", { enumerable: true, get: function () { return index_js_1.SpatiusAvatar; } });
|
|
138
144
|
Object.defineProperty(exports, "SpeakPriorityAppend", { enumerable: true, get: function () { return index_js_1.SpeakPriorityAppend; } });
|
|
139
145
|
Object.defineProperty(exports, "SpeakPriorityIgnore", { enumerable: true, get: function () { return index_js_1.SpeakPriorityIgnore; } });
|
|
140
146
|
Object.defineProperty(exports, "SpeakPriorityInterrupt", { enumerable: true, get: function () { return index_js_1.SpeakPriorityInterrupt; } });
|
|
@@ -158,6 +164,8 @@ Object.defineProperty(exports, "VertexAI", { enumerable: true, get: function ()
|
|
|
158
164
|
Object.defineProperty(exports, "VertexAILLM", { enumerable: true, get: function () { return index_js_1.VertexAILLM; } });
|
|
159
165
|
Object.defineProperty(exports, "validateAvatarConfig", { enumerable: true, get: function () { return index_js_1.validateAvatarConfig; } });
|
|
160
166
|
Object.defineProperty(exports, "validateTtsSampleRate", { enumerable: true, get: function () { return index_js_1.validateTtsSampleRate; } });
|
|
167
|
+
Object.defineProperty(exports, "XAiSTT", { enumerable: true, get: function () { return index_js_1.XAiSTT; } });
|
|
168
|
+
Object.defineProperty(exports, "XAiTTS", { enumerable: true, get: function () { return index_js_1.XAiTTS; } });
|
|
161
169
|
Object.defineProperty(exports, "XaiGrok", { enumerable: true, get: function () { return index_js_1.XaiGrok; } });
|
|
162
170
|
Object.defineProperty(exports, "XfyunBigModelSTT", { enumerable: true, get: function () { return index_js_1.XfyunBigModelSTT; } });
|
|
163
171
|
Object.defineProperty(exports, "XfyunDialectSTT", { enumerable: true, get: function () { return index_js_1.XfyunDialectSTT; } });
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "v2.
|
|
1
|
+
export declare const SDK_VERSION = "v2.5.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -5,8 +5,8 @@ export function normalizeClientOptions(options) {
|
|
|
5
5
|
const headers = mergeHeaders({
|
|
6
6
|
"X-Fern-Language": "JavaScript",
|
|
7
7
|
"X-Fern-SDK-Name": "agora-agents",
|
|
8
|
-
"X-Fern-SDK-Version": "v2.
|
|
9
|
-
"User-Agent": "agora-agents/v2.
|
|
8
|
+
"X-Fern-SDK-Version": "v2.5.0",
|
|
9
|
+
"User-Agent": "agora-agents/v2.5.0",
|
|
10
10
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
11
11
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
12
12
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -9,27 +9,19 @@ export class AgoraClient {
|
|
|
9
9
|
this._options = normalizeClientOptions(options);
|
|
10
10
|
}
|
|
11
11
|
get agents() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
return this._agents;
|
|
12
|
+
var _a;
|
|
13
|
+
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new AgentsClient(this._options)));
|
|
16
14
|
}
|
|
17
15
|
get agentManagement() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
return this._agentManagement;
|
|
16
|
+
var _a;
|
|
17
|
+
return ((_a = this._agentManagement) !== null && _a !== void 0 ? _a : (this._agentManagement = new AgentManagementClient(this._options)));
|
|
22
18
|
}
|
|
23
19
|
get telephony() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
return this._telephony;
|
|
20
|
+
var _a;
|
|
21
|
+
return ((_a = this._telephony) !== null && _a !== void 0 ? _a : (this._telephony = new TelephonyClient(this._options)));
|
|
28
22
|
}
|
|
29
23
|
get phoneNumbers() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
return this._phoneNumbers;
|
|
24
|
+
var _a;
|
|
25
|
+
return ((_a = this._phoneNumbers) !== null && _a !== void 0 ? _a : (this._phoneNumbers = new PhoneNumbersClient(this._options)));
|
|
34
26
|
}
|
|
35
27
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* multiple sessions. Set the unique agent instance `name` in
|
|
6
6
|
* {@link Agent.createSession}, not on the Agent itself.
|
|
7
7
|
*/
|
|
8
|
+
import { Area } from "../core/domain/index.mjs";
|
|
8
9
|
import { AgentSession } from "./AgentSession.mjs";
|
|
9
10
|
import { AudioScenario } from "./constants.mjs";
|
|
10
11
|
import { generateConvoAIToken } from "./token.mjs";
|
|
@@ -714,11 +715,11 @@ export class Agent {
|
|
|
714
715
|
return newAgent;
|
|
715
716
|
}
|
|
716
717
|
_resolveAsrConfig(turnDetectionConfig) {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
718
|
+
const asrConfig = this._stt !== undefined
|
|
719
|
+
? Object.assign({}, this._stt)
|
|
720
|
+
: {
|
|
721
|
+
vendor: this._client.area === Area.CN ? "fengming" : "ares",
|
|
722
|
+
};
|
|
722
723
|
asrConfig.language = turnDetectionConfig.language;
|
|
723
724
|
return Object.keys(asrConfig).length > 0 ? asrConfig : undefined;
|
|
724
725
|
}
|
|
@@ -14,7 +14,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
import { AgoraError } from "../errors/index.mjs";
|
|
17
|
-
import { isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, validateAvatarConfig, validateTtsSampleRate, } from "./avatar-types.mjs";
|
|
17
|
+
import { isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, validateAvatarConfig, validateTtsSampleRate, } from "./avatar-types.mjs";
|
|
18
18
|
import { getPresetCategory, inferAsrPreset, inferLlmPreset, inferTtsPreset, normalizePresetInput, resolveSessionPresets, } from "./presets.mjs";
|
|
19
19
|
import { ExpiresIn as ExpiresInHelper, generateConvoAIToken } from "./token.mjs";
|
|
20
20
|
/**
|
|
@@ -192,6 +192,7 @@ export class AgentSession {
|
|
|
192
192
|
if (isHeyGenAvatar(strictAvatar) ||
|
|
193
193
|
isLiveAvatarAvatar(strictAvatar) ||
|
|
194
194
|
isSensetimeAvatar(strictAvatar) ||
|
|
195
|
+
isSpatiusAvatar(strictAvatar) ||
|
|
195
196
|
isAkoolAvatar(strictAvatar) ||
|
|
196
197
|
isAnamAvatar(strictAvatar) ||
|
|
197
198
|
isGenericAvatar(strictAvatar)) {
|
|
@@ -279,6 +280,7 @@ export class AgentSession {
|
|
|
279
280
|
if (isHeyGenAvatar(strictAvatar) ||
|
|
280
281
|
isLiveAvatarAvatar(strictAvatar) ||
|
|
281
282
|
isSensetimeAvatar(strictAvatar) ||
|
|
283
|
+
isSpatiusAvatar(strictAvatar) ||
|
|
282
284
|
isAkoolAvatar(strictAvatar) ||
|
|
283
285
|
isAnamAvatar(strictAvatar) ||
|
|
284
286
|
isGenericAvatar(strictAvatar)) {
|
|
@@ -4,7 +4,7 @@ import { Agent } from "../Agent.mjs";
|
|
|
4
4
|
import { AliyunLLM, FengmingSTT, MiniMaxCNTTS } from "../vendors/cn.mjs";
|
|
5
5
|
import { OpenAI } from "../vendors/llm.mjs";
|
|
6
6
|
import { DeepgramSTT } from "../vendors/stt.mjs";
|
|
7
|
-
import { MiniMaxTTS } from "../vendors/tts.mjs";
|
|
7
|
+
import { GenericTTS, MiniMaxTTS } from "../vendors/tts.mjs";
|
|
8
8
|
const client = new AgoraClient({
|
|
9
9
|
area: Area.US,
|
|
10
10
|
appId: "app-id",
|
|
@@ -24,6 +24,8 @@ new Agent({ client, turnDetection: { language: "en-US" } })
|
|
|
24
24
|
new Agent({ client }).withStt(new FengmingSTT());
|
|
25
25
|
new Agent({ client }).withLlm(new AliyunLLM({ url: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", model: "qwen-plus" }));
|
|
26
26
|
new Agent({ client }).withTts(new MiniMaxCNTTS({ key: "minimax-key", model: "speech-01-turbo", voiceSetting: { voice_id: "female-shaonv" } }));
|
|
27
|
+
const globalGenericTts = new GenericTTS({ url: "https://tts.example.com/v1/audio/speech" });
|
|
28
|
+
new Agent({ client }).withTts(globalGenericTts);
|
|
27
29
|
{
|
|
28
30
|
const client = new AgoraClient({
|
|
29
31
|
area: Area.CN,
|
|
@@ -51,5 +53,7 @@ new Agent({ client }).withTts(new MiniMaxCNTTS({ key: "minimax-key", model: "spe
|
|
|
51
53
|
new Agent({ client }).withStt(new DeepgramSTT({ model: "nova-3", language: "en-US" }));
|
|
52
54
|
new Agent({ client }).withLlm(new OpenAI({ model: "gpt-5-mini" }));
|
|
53
55
|
new Agent({ client }).withTts(new MiniMaxTTS({ model: "speech-2.6-turbo", voiceId: "English_captivating_female1" }));
|
|
56
|
+
const cnGenericTts = new GenericTTS({ url: "https://tts.example.cn/v1/audio/speech" });
|
|
57
|
+
new Agent({ client }).withTts(cnGenericTts);
|
|
54
58
|
}
|
|
55
59
|
new Agent({ client }).withStt(new DeepgramSTT({ model: "nova-3", language: "en-US" }));
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* ensuring that invalid combinations are caught at compile time.
|
|
6
6
|
*/
|
|
7
7
|
import type { SensetimeAvatarParams } from "../api/types/SensetimeAvatarParams.mjs";
|
|
8
|
+
import type { SpatiusAvatarParams } from "../api/types/SpatiusAvatarParams.mjs";
|
|
8
9
|
import type { AvatarConfig as BaseAvatarConfig } from "./types.mjs";
|
|
9
10
|
/**
|
|
10
11
|
* HeyGen-specific avatar configuration (legacy wire vendor `heygen`).
|
|
@@ -74,8 +75,8 @@ export interface AnamAvatarConfig {
|
|
|
74
75
|
params: {
|
|
75
76
|
/** API key for Anam authentication (required) */
|
|
76
77
|
api_key: string;
|
|
77
|
-
/** Anam
|
|
78
|
-
|
|
78
|
+
/** Anam avatar ID (optional) */
|
|
79
|
+
avatar_id?: string;
|
|
79
80
|
[key: string]: unknown;
|
|
80
81
|
};
|
|
81
82
|
}
|
|
@@ -139,16 +140,24 @@ export interface SensetimeAvatarConfig {
|
|
|
139
140
|
appId: string;
|
|
140
141
|
/** SenseTime application key (required) */
|
|
141
142
|
app_key: string;
|
|
142
|
-
/** SenseTime scene configuration list (
|
|
143
|
-
sceneList
|
|
143
|
+
/** SenseTime scene configuration list (optional) */
|
|
144
|
+
sceneList?: SensetimeAvatarParams.SceneList.Item[];
|
|
144
145
|
[key: string]: unknown;
|
|
145
146
|
};
|
|
146
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Spatius-specific avatar configuration.
|
|
150
|
+
*/
|
|
151
|
+
export interface SpatiusAvatarConfig {
|
|
152
|
+
enable?: boolean;
|
|
153
|
+
vendor: "spatius";
|
|
154
|
+
params: SpatiusAvatarParams;
|
|
155
|
+
}
|
|
147
156
|
/**
|
|
148
157
|
* Discriminated union of all avatar configurations.
|
|
149
158
|
* TypeScript will enforce vendor-specific constraints based on the vendor field.
|
|
150
159
|
*/
|
|
151
|
-
export type StrictAvatarConfig = HeyGenAvatarConfig | LiveAvatarAvatarConfig | AkoolAvatarConfig | AnamAvatarConfig | GenericAvatarConfig | SensetimeAvatarConfig;
|
|
160
|
+
export type StrictAvatarConfig = HeyGenAvatarConfig | LiveAvatarAvatarConfig | AkoolAvatarConfig | AnamAvatarConfig | GenericAvatarConfig | SensetimeAvatarConfig | SpatiusAvatarConfig;
|
|
152
161
|
/**
|
|
153
162
|
* Helper type guard to check if an avatar config uses the legacy HeyGen wire vendor.
|
|
154
163
|
*/
|
|
@@ -173,6 +182,10 @@ export declare function isGenericAvatar(config: StrictAvatarConfig): config is G
|
|
|
173
182
|
* Helper type guard to check if an avatar config is for SenseTime (CN).
|
|
174
183
|
*/
|
|
175
184
|
export declare function isSensetimeAvatar(config: StrictAvatarConfig): config is SensetimeAvatarConfig;
|
|
185
|
+
/**
|
|
186
|
+
* Helper type guard to check if an avatar config is for Spatius.
|
|
187
|
+
*/
|
|
188
|
+
export declare function isSpatiusAvatar(config: StrictAvatarConfig): config is SpatiusAvatarConfig;
|
|
176
189
|
/**
|
|
177
190
|
* Returns true when AgentKit manages the avatar's RTC publisher identity
|
|
178
191
|
* (i.e. fills `agora_token`, validates uniqueness against the agent UID).
|
|
@@ -40,6 +40,12 @@ export function isGenericAvatar(config) {
|
|
|
40
40
|
export function isSensetimeAvatar(config) {
|
|
41
41
|
return config.vendor === "sensetime";
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Helper type guard to check if an avatar config is for Spatius.
|
|
45
|
+
*/
|
|
46
|
+
export function isSpatiusAvatar(config) {
|
|
47
|
+
return config.vendor === "spatius";
|
|
48
|
+
}
|
|
43
49
|
/**
|
|
44
50
|
* Returns true when AgentKit manages the avatar's RTC publisher identity
|
|
45
51
|
* (i.e. fills `agora_token`, validates uniqueness against the agent UID).
|
|
@@ -47,7 +53,11 @@ export function isSensetimeAvatar(config) {
|
|
|
47
53
|
* Mirrors the Go and Python SDK gate so all language SDKs behave identically.
|
|
48
54
|
*/
|
|
49
55
|
export function isAvatarTokenManaged(config) {
|
|
50
|
-
return isHeyGenAvatar(config) ||
|
|
56
|
+
return (isHeyGenAvatar(config) ||
|
|
57
|
+
isLiveAvatarAvatar(config) ||
|
|
58
|
+
isGenericAvatar(config) ||
|
|
59
|
+
isSensetimeAvatar(config) ||
|
|
60
|
+
isSpatiusAvatar(config));
|
|
51
61
|
}
|
|
52
62
|
/**
|
|
53
63
|
* Validates avatar configuration at runtime.
|
|
@@ -122,8 +132,25 @@ export function validateAvatarConfig(config, options = {}) {
|
|
|
122
132
|
if (!config.params.app_key) {
|
|
123
133
|
throw new Error("SenseTime avatar requires app_key");
|
|
124
134
|
}
|
|
125
|
-
if (
|
|
126
|
-
throw new Error("SenseTime avatar
|
|
135
|
+
if (config.params.sceneList !== undefined && !Array.isArray(config.params.sceneList)) {
|
|
136
|
+
throw new Error("SenseTime avatar sceneList must be an array when provided");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else if (isSpatiusAvatar(config)) {
|
|
140
|
+
if (!config.params.agora_uid) {
|
|
141
|
+
throw new Error("Spatius avatar requires agora_uid");
|
|
142
|
+
}
|
|
143
|
+
if (!config.params.spatius_api_key) {
|
|
144
|
+
throw new Error("Spatius avatar requires spatius_api_key");
|
|
145
|
+
}
|
|
146
|
+
if (!config.params.spatius_app_id) {
|
|
147
|
+
throw new Error("Spatius avatar requires spatius_app_id");
|
|
148
|
+
}
|
|
149
|
+
if (!config.params.spatius_avatar_id) {
|
|
150
|
+
throw new Error("Spatius avatar requires spatius_avatar_id");
|
|
151
|
+
}
|
|
152
|
+
if (options.requireSessionFields && !config.params.agora_token) {
|
|
153
|
+
throw new Error("Spatius avatar requires agora_token after session enrichment");
|
|
127
154
|
}
|
|
128
155
|
}
|
|
129
156
|
}
|
|
@@ -6,6 +6,12 @@ import { AgentThinkAgentManagementRequest as AgentThinkRequestNS } from "../api/
|
|
|
6
6
|
import { SpeakAgentsRequest as SpeakAgentsRequestNS } from "../api/resources/agents/client/requests/SpeakAgentsRequest.mjs";
|
|
7
7
|
import { StartAgentsRequest as StartAgentsRequestNS } from "../api/resources/agents/client/requests/StartAgentsRequest.mjs";
|
|
8
8
|
import { MllmTurnDetection as MllmTurnDetectionNS } from "../api/types/MllmTurnDetection.mjs";
|
|
9
|
+
/** Credential source for vendors that support Agora-managed credentials and BYOK. */
|
|
10
|
+
export declare const CredentialMode: {
|
|
11
|
+
readonly Managed: "managed";
|
|
12
|
+
readonly Byok: "byok";
|
|
13
|
+
};
|
|
14
|
+
export type CredentialMode = (typeof CredentialMode)[keyof typeof CredentialMode];
|
|
9
15
|
/** Data channel: `"rtm"` | `"datastream"` */
|
|
10
16
|
export declare const DataChannel: typeof StartAgentsRequestNS.Properties.Parameters.DataChannel;
|
|
11
17
|
/** RTC audio scenario: `"default"` | `"chorus"` | `"aiserver"` */
|
|
@@ -7,6 +7,11 @@ import { AgentThinkAgentManagementRequest as AgentThinkRequestNS } from "../api/
|
|
|
7
7
|
import { SpeakAgentsRequest as SpeakAgentsRequestNS } from "../api/resources/agents/client/requests/SpeakAgentsRequest.mjs";
|
|
8
8
|
import { StartAgentsRequest as StartAgentsRequestNS } from "../api/resources/agents/client/requests/StartAgentsRequest.mjs";
|
|
9
9
|
import { MllmTurnDetection as MllmTurnDetectionNS } from "../api/types/MllmTurnDetection.mjs";
|
|
10
|
+
/** Credential source for vendors that support Agora-managed credentials and BYOK. */
|
|
11
|
+
export const CredentialMode = {
|
|
12
|
+
Managed: "managed",
|
|
13
|
+
Byok: "byok",
|
|
14
|
+
};
|
|
10
15
|
/** Data channel: `"rtm"` | `"datastream"` */
|
|
11
16
|
export const DataChannel = StartAgentsRequestNS.Properties.Parameters.DataChannel;
|
|
12
17
|
/** RTC audio scenario: `"default"` | `"chorus"` | `"aiserver"` */
|
|
@@ -23,26 +23,26 @@ export type { AgentOptions } from "./Agent.mjs";
|
|
|
23
23
|
export { Agent } from "./Agent.mjs";
|
|
24
24
|
export type { AgentSessionEvent, AgentSessionEventHandler, AgentSessionOptions, } from "./AgentSession.mjs";
|
|
25
25
|
export { AgentSession } from "./AgentSession.mjs";
|
|
26
|
-
export type { AkoolAvatarConfig, AnamAvatarConfig, GenericAvatarConfig, HeyGenAvatarConfig, LiveAvatarAvatarConfig, SensetimeAvatarConfig, StrictAvatarConfig, } from "./avatar-types.mjs";
|
|
27
|
-
export { isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, toBaseAvatarConfig, validateAvatarConfig, validateTtsSampleRate, } from "./avatar-types.mjs";
|
|
28
|
-
export { AudioScenario, DataChannel, FillerWordsSelectionRule, Geofence, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, SalModeValues, SilenceActionValues, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, } from "./constants.mjs";
|
|
26
|
+
export type { AkoolAvatarConfig, AnamAvatarConfig, GenericAvatarConfig, HeyGenAvatarConfig, LiveAvatarAvatarConfig, SensetimeAvatarConfig, SpatiusAvatarConfig, StrictAvatarConfig, } from "./avatar-types.mjs";
|
|
27
|
+
export { isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, toBaseAvatarConfig, validateAvatarConfig, validateTtsSampleRate, } from "./avatar-types.mjs";
|
|
28
|
+
export { AudioScenario, CredentialMode, DataChannel, FillerWordsSelectionRule, Geofence, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, SalModeValues, SilenceActionValues, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, } from "./constants.mjs";
|
|
29
29
|
export type { AgentPreset, AsrPreset, DeepgramPresetModel, LlmPreset, MiniMaxPresetModel, OpenAIPresetModel, OpenAITtsPresetModel, PresetCategory, PresetInput, TtsPreset, } from "./presets.mjs";
|
|
30
30
|
export { AgentPresets, normalizePresetInput } from "./presets.mjs";
|
|
31
31
|
export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.mjs";
|
|
32
32
|
export type { GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.mjs";
|
|
33
33
|
export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.mjs";
|
|
34
|
-
export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AsrVendorName, AvatarConfig, AvatarWireVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, } from "./types.mjs";
|
|
34
|
+
export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AsrVendorName, AvatarConfig, AvatarWireVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, GradiumTts, GradiumTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpatiusAvatarParams, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.mjs";
|
|
35
35
|
export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LiveAvatarAvatarOptions, } from "./vendors/avatar.mjs";
|
|
36
36
|
export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LiveAvatarAvatar, } from "./vendors/avatar.mjs";
|
|
37
37
|
export type { AkoolSampleRate, CartesiaSampleRate, ElevenLabsSampleRate, HeyGenSampleRate, LiveAvatarSampleRate, MicrosoftSampleRate, SampleRate, } from "./vendors/base.mjs";
|
|
38
38
|
export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, BaseLLM, type BaseLlmOptions, BaseMLLM, BaseSTT, BaseTTS, type GoogleTTSSampleRate, } from "./vendors/base.mjs";
|
|
39
|
-
export type { AliyunLLMOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CosyVoiceTTSOptions, DeepSeekLLMOptions, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MiniMaxCNTTSOptions, SensetimeAvatarOptions, StepFunTTSOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./vendors/cn.mjs";
|
|
40
|
-
export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS, DeepSeekLLM, FengmingSTT, MicrosoftCNSTT, MicrosoftCNTTS, MiniMaxCNTTS, SensetimeAvatar, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./vendors/cn.mjs";
|
|
39
|
+
export type { AliyunLLMOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CosyVoiceTTSOptions, DeepSeekLLMOptions, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MiniMaxCNTTSOptions, SensetimeAvatarOptions, SpatiusAvatarOptions, StepFunTTSOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./vendors/cn.mjs";
|
|
40
|
+
export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS, DeepSeekLLM, FengmingSTT, MicrosoftCNSTT, MicrosoftCNTTS, MiniMaxCNTTS, SensetimeAvatar, SpatiusAvatar, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./vendors/cn.mjs";
|
|
41
41
|
export type { AmazonBedrockOptions, AnthropicOptions, AzureOpenAIOptions, CustomLLMOptions, DifyOptions, GeminiOptions, GroqOptions, OpenAIOptions, VertexAILLMOptions, } from "./vendors/llm.mjs";
|
|
42
42
|
export { AmazonBedrock, Anthropic, AzureOpenAI, CustomLLM, Dify, Gemini, Groq, OpenAI, VertexAILLM, } from "./vendors/llm.mjs";
|
|
43
43
|
export type { GeminiLiveOptions, OpenAIRealtimeOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.mjs";
|
|
44
44
|
export { GeminiLive, OpenAIRealtime, VertexAI, XaiGrok, } from "./vendors/mllm.mjs";
|
|
45
|
-
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SpeechmaticsSTTOptions, } from "./vendors/stt.mjs";
|
|
46
|
-
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, } from "./vendors/stt.mjs";
|
|
47
|
-
export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GoogleTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, } from "./vendors/tts.mjs";
|
|
48
|
-
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GoogleTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, } from "./vendors/tts.mjs";
|
|
45
|
+
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.mjs";
|
|
46
|
+
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.mjs";
|
|
47
|
+
export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, XAiTTSOptions, } from "./vendors/tts.mjs";
|
|
48
|
+
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, XAiTTS, } from "./vendors/tts.mjs";
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
// Core classes
|
|
22
22
|
export { Agent } from "./Agent.mjs";
|
|
23
23
|
export { AgentSession } from "./AgentSession.mjs";
|
|
24
|
-
export { isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, toBaseAvatarConfig, validateAvatarConfig, validateTtsSampleRate, } from "./avatar-types.mjs";
|
|
24
|
+
export { isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, toBaseAvatarConfig, validateAvatarConfig, validateTtsSampleRate, } from "./avatar-types.mjs";
|
|
25
25
|
// Type-safe constants
|
|
26
|
-
export { AudioScenario, DataChannel, FillerWordsSelectionRule, Geofence, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, SalModeValues, SilenceActionValues, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, } from "./constants.mjs";
|
|
26
|
+
export { AudioScenario, CredentialMode, DataChannel, FillerWordsSelectionRule, Geofence, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, SalModeValues, SilenceActionValues, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, } from "./constants.mjs";
|
|
27
27
|
export { AgentPresets, normalizePresetInput } from "./presets.mjs";
|
|
28
28
|
// Token generation
|
|
29
29
|
export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.mjs";
|
|
@@ -31,12 +31,12 @@ export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS,
|
|
|
31
31
|
export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LiveAvatarAvatar, } from "./vendors/avatar.mjs";
|
|
32
32
|
// Base vendor classes
|
|
33
33
|
export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseMLLM, BaseSTT, BaseTTS, } from "./vendors/base.mjs";
|
|
34
|
-
export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS, DeepSeekLLM, FengmingSTT, MicrosoftCNSTT, MicrosoftCNTTS, MiniMaxCNTTS, SensetimeAvatar, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./vendors/cn.mjs";
|
|
34
|
+
export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS, DeepSeekLLM, FengmingSTT, MicrosoftCNSTT, MicrosoftCNTTS, MiniMaxCNTTS, SensetimeAvatar, SpatiusAvatar, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./vendors/cn.mjs";
|
|
35
35
|
// LLM vendor classes
|
|
36
36
|
export { AmazonBedrock, Anthropic, AzureOpenAI, CustomLLM, Dify, Gemini, Groq, OpenAI, VertexAILLM, } from "./vendors/llm.mjs";
|
|
37
37
|
// MLLM vendor classes
|
|
38
38
|
export { GeminiLive, OpenAIRealtime, VertexAI, XaiGrok, } from "./vendors/mllm.mjs";
|
|
39
39
|
// STT vendor classes
|
|
40
|
-
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, } from "./vendors/stt.mjs";
|
|
40
|
+
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.mjs";
|
|
41
41
|
// TTS vendor classes
|
|
42
|
-
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GoogleTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, } from "./vendors/tts.mjs";
|
|
42
|
+
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, XAiTTS, } from "./vendors/tts.mjs";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseSTT, BaseTTS } from "./vendors/base.mjs";
|
|
2
2
|
import type { MicrosoftCNSampleRate, MicrosoftCNSTT, MicrosoftCNTTS } from "./vendors/cn.mjs";
|
|
3
3
|
import type { CustomLLM } from "./vendors/llm.mjs";
|
|
4
|
+
import type { GenericTTS } from "./vendors/tts.mjs";
|
|
4
5
|
export type GlobalLlmVendor = BaseLLM;
|
|
5
6
|
export type GlobalTtsVendor<SR extends number = number> = BaseTTS<SR>;
|
|
6
7
|
export type GlobalSttVendor = BaseSTT;
|
|
7
8
|
export type GlobalAvatarVendor<SR extends number = number> = BaseAvatar<SR>;
|
|
8
9
|
export type CNLlmVendor = BaseCNLLM | CustomLLM;
|
|
9
|
-
export type CNTtsVendor<SR extends number = number> = BaseCNTTS<SR> | (SR extends MicrosoftCNSampleRate ? MicrosoftCNTTS<SR> : never);
|
|
10
|
+
export type CNTtsVendor<SR extends number = number> = BaseCNTTS<SR> | GenericTTS | (SR extends MicrosoftCNSampleRate ? MicrosoftCNTTS<SR> : never);
|
|
10
11
|
export type CNSttVendor = BaseCNSTT | MicrosoftCNSTT;
|
|
11
12
|
export type CNAvatarVendor<SR extends number = number> = BaseCNAvatar<SR>;
|
|
12
13
|
export type LlmVendor = GlobalLlmVendor | CNLlmVendor;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Clean type aliases for the Agora Conversational AI SDK.
|
|
3
3
|
* These provide shorter, more intuitive names for the verbose Fern-generated types.
|
|
4
4
|
*/
|
|
5
|
-
import type { AgentThinkAgentManagementResponse, AmazonTtsParams as AmazonTtsParamsType, AmazonTts as AmazonTtsType, Asr, AsrLanguage, CartesiaTtsParams as CartesiaTtsParamsType, CartesiaTts as CartesiaTtsType, ElevenLabsTtsParams as ElevenLabsTtsParamsType, ElevenLabsTts as ElevenLabsTtsType, FishAudioTtsParams as FishAudioTtsParamsType, FishAudioTts as FishAudioTtsType, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, Llm, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, Mllm, MllmTurnDetection, MllmTurnDetection as MllmTurnDetectionNS, MurfTtsParams as MurfTtsParamsType, MurfTts as MurfTtsType, OpenAiTtsParams as OpenAiTtsParamsType, OpenAiTts as OpenAiTtsType, RimeTtsParams as RimeTtsParamsType, RimeTts as RimeTtsType, SarvamTtsParams as SarvamTtsParamsType, SarvamTts as SarvamTtsType, SpeakAgentsRequest, StartAgentsRequest, Tts, UpdateAgentsRequest } from "../api/index.mjs";
|
|
5
|
+
import type { AgentThinkAgentManagementResponse, AmazonTtsParams as AmazonTtsParamsType, AmazonTts as AmazonTtsType, Asr, AsrLanguage, CartesiaTtsParams as CartesiaTtsParamsType, CartesiaTts as CartesiaTtsType, ElevenLabsTtsParams as ElevenLabsTtsParamsType, ElevenLabsTts as ElevenLabsTtsType, FishAudioTtsParams as FishAudioTtsParamsType, FishAudioTts as FishAudioTtsType, GenericHttpTtsParams as GenericTtsParamsType, GenericHttpTts as GenericTtsType, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, GradiumTtsParams as GradiumTtsParamsType, GradiumTts as GradiumTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, Llm, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, MistralTtsParams as MistralTtsParamsType, MistralTts as MistralTtsType, Mllm, MllmTurnDetection, MllmTurnDetection as MllmTurnDetectionNS, MurfTtsParams as MurfTtsParamsType, MurfTts as MurfTtsType, OpenAiTtsParams as OpenAiTtsParamsType, OpenAiTts as OpenAiTtsType, RimeTtsParams as RimeTtsParamsType, RimeTts as RimeTtsType, SarvamTtsParams as SarvamTtsParamsType, SarvamTts as SarvamTtsType, SpatiusAvatarParams as SpatiusAvatarParamsType, SpeakAgentsRequest, StartAgentsRequest, Tts, UpdateAgentsRequest, XAiAsrParams as XAiAsrParamsType, XAiAsr as XAiAsrType, XAiTtsParams as XAiTtsParamsType, XAiTts as XAiTtsType } from "../api/index.mjs";
|
|
6
6
|
import type { AgentThinkAgentManagementRequest } from "../api/resources/agentManagement/client/requests/AgentThinkAgentManagementRequest.mjs";
|
|
7
7
|
import type { PresetInput } from "./presets.mjs";
|
|
8
8
|
/** LLM request style (openai, gemini, anthropic, dify) */
|
|
@@ -68,6 +68,10 @@ export type SttConfig = {
|
|
|
68
68
|
vendor: "sarvam";
|
|
69
69
|
language?: TurnDetectionLanguage;
|
|
70
70
|
params: SarvamAsrParams;
|
|
71
|
+
} | {
|
|
72
|
+
vendor: "xai";
|
|
73
|
+
language?: TurnDetectionLanguage;
|
|
74
|
+
params: XAiAsrParams;
|
|
71
75
|
} | Asr;
|
|
72
76
|
/** ASR configuration — alias for {@link SttConfig} (wire field: `asr`). */
|
|
73
77
|
export type AsrConfig = SttConfig;
|
|
@@ -82,7 +86,7 @@ export type MllmVendor = Mllm.Vendor;
|
|
|
82
86
|
/** Avatar configuration */
|
|
83
87
|
export type AvatarConfig = StartAgentsRequest.Properties.Avatar;
|
|
84
88
|
/** Avatar vendor (akool, liveavatar, anam, generic, deprecated heygen) */
|
|
85
|
-
/** Wire avatar vendor identifier (e.g. `"liveavatar"`, `"sensetime"`). */
|
|
89
|
+
/** Wire avatar vendor identifier (e.g. `"liveavatar"`, `"sensetime"`, `"spatius"`). */
|
|
86
90
|
export type AvatarWireVendor = StartAgentsRequest.Properties.Avatar.Vendor;
|
|
87
91
|
/** BCP-47 language tag used by `turn_detection.language`. */
|
|
88
92
|
export type TurnDetectionLanguage = AsrLanguage;
|
|
@@ -203,9 +207,9 @@ export type FillerWordsContentSelectionRule = StartAgentsRequest.Properties.Fill
|
|
|
203
207
|
/** Custom business labels attached to the agent (returned in notification callbacks) */
|
|
204
208
|
export type Labels = Record<string, string>;
|
|
205
209
|
/** LLM greeting broadcast configuration (`llm.greeting_configs`) */
|
|
206
|
-
export type LlmGreetingConfigs =
|
|
207
|
-
/** Greeting broadcast
|
|
208
|
-
export type LlmGreetingConfigsMode =
|
|
210
|
+
export type LlmGreetingConfigs = Llm.GreetingConfigs;
|
|
211
|
+
/** Greeting broadcast ASR policy: `"merge_reply"` | `"context"` */
|
|
212
|
+
export type LlmGreetingConfigsMode = Llm.GreetingConfigs.UninterruptibleAsrPolicy;
|
|
209
213
|
/** MCP server config item (`llm.mcp_servers[]`) */
|
|
210
214
|
export type McpServersItem = Record<string, unknown>;
|
|
211
215
|
/** Full agent configuration (alias for StartAgentsRequest.Properties) */
|
|
@@ -366,6 +370,8 @@ interface BaseLlmConfig {
|
|
|
366
370
|
output_modalities?: string[];
|
|
367
371
|
/** Agent greeting message */
|
|
368
372
|
greeting_message?: string;
|
|
373
|
+
/** Publicly accessible greeting audio URL */
|
|
374
|
+
greeting_audio_url?: string;
|
|
369
375
|
/** Failure message when LLM call fails */
|
|
370
376
|
failure_message?: string;
|
|
371
377
|
/** LLM provider (e.g., 'azure', 'custom') */
|
|
@@ -528,6 +534,12 @@ export interface SarvamAsrParams {
|
|
|
528
534
|
/** Additional Sarvam-specific parameters */
|
|
529
535
|
[key: string]: unknown;
|
|
530
536
|
}
|
|
537
|
+
/**
|
|
538
|
+
* xAI STT parameters
|
|
539
|
+
* @see https://docs.agora.io/en/conversational-ai/models/asr/overview
|
|
540
|
+
*/
|
|
541
|
+
export type XAiAsr = XAiAsrType;
|
|
542
|
+
export type XAiAsrParams = XAiAsrParamsType;
|
|
531
543
|
export type MicrosoftTts = MicrosoftTtsType;
|
|
532
544
|
export type MicrosoftTtsParams = MicrosoftTtsParamsType;
|
|
533
545
|
export type ElevenLabsTts = ElevenLabsTtsType;
|
|
@@ -542,14 +554,23 @@ export type RimeTts = RimeTtsType;
|
|
|
542
554
|
export type RimeTtsParams = RimeTtsParamsType;
|
|
543
555
|
export type FishAudioTts = FishAudioTtsType;
|
|
544
556
|
export type FishAudioTtsParams = FishAudioTtsParamsType;
|
|
557
|
+
export type GenericTts = GenericTtsType;
|
|
558
|
+
export type GenericTtsParams = GenericTtsParamsType;
|
|
545
559
|
export type GoogleTts = GoogleTtsType;
|
|
546
560
|
export type GoogleTtsParams = GoogleTtsParamsType;
|
|
561
|
+
export type GradiumTts = GradiumTtsType;
|
|
562
|
+
export type GradiumTtsParams = GradiumTtsParamsType;
|
|
547
563
|
export type AmazonTts = AmazonTtsType;
|
|
548
564
|
export type AmazonTtsParams = AmazonTtsParamsType;
|
|
549
565
|
export type MinimaxTts = MinimaxTtsType;
|
|
550
566
|
export type MinimaxTtsParams = MinimaxTtsParamsType;
|
|
567
|
+
export type MistralTts = MistralTtsType;
|
|
568
|
+
export type MistralTtsParams = MistralTtsParamsType;
|
|
551
569
|
export type MurfTts = MurfTtsType;
|
|
552
570
|
export type MurfTtsParams = MurfTtsParamsType;
|
|
553
571
|
export type SarvamTts = SarvamTtsType;
|
|
554
572
|
export type SarvamTtsParams = SarvamTtsParamsType;
|
|
573
|
+
export type XAiTts = XAiTtsType;
|
|
574
|
+
export type XAiTtsParams = XAiTtsParamsType;
|
|
575
|
+
export type SpatiusAvatarParams = SpatiusAvatarParamsType;
|
|
555
576
|
export {};
|