agora-agents 2.2.0 → 2.3.1
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/README.md +48 -26
- package/dist/cjs/AgoraPoolClient.d.ts +9 -6
- package/dist/cjs/AgoraPoolClient.js +1 -0
- package/dist/cjs/agentkit/Agent.d.ts +52 -51
- package/dist/cjs/agentkit/Agent.js +40 -39
- package/dist/cjs/agentkit/AgentSession.d.ts +11 -10
- package/dist/cjs/agentkit/AgentSession.js +10 -6
- package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.d.ts +1 -0
- package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.js +57 -0
- package/dist/cjs/agentkit/__tests__/readme-examples.test.d.ts +1 -0
- package/dist/cjs/agentkit/__tests__/readme-examples.test.js +126 -0
- package/dist/cjs/agentkit/__tests__/type-safety.test.js +24 -17
- package/dist/cjs/agentkit/area.d.ts +4 -0
- package/dist/cjs/agentkit/area.js +2 -0
- package/dist/cjs/agentkit/avatar-types.d.ts +28 -2
- package/dist/cjs/agentkit/avatar-types.js +24 -2
- package/dist/cjs/agentkit/index.d.ts +8 -5
- package/dist/cjs/agentkit/index.js +27 -2
- package/dist/cjs/agentkit/region-vendors.d.ts +15 -0
- package/dist/cjs/agentkit/region-vendors.js +2 -0
- package/dist/cjs/agentkit/token.d.ts +3 -2
- package/dist/cjs/agentkit/token.js +3 -2
- package/dist/cjs/agentkit/types.d.ts +26 -5
- package/dist/cjs/agentkit/vendors/avatar.d.ts +6 -3
- package/dist/cjs/agentkit/vendors/avatar.js +6 -3
- package/dist/cjs/agentkit/vendors/base.d.ts +38 -5
- package/dist/cjs/agentkit/vendors/base.js +60 -6
- package/dist/cjs/agentkit/vendors/cn.d.ts +251 -0
- package/dist/cjs/agentkit/vendors/cn.js +293 -0
- package/dist/cjs/agentkit/vendors/mllm.d.ts +8 -4
- package/dist/cjs/agentkit/vendors/mllm.js +8 -4
- package/dist/cjs/agentkit/vendors/stt.js +5 -0
- package/dist/cjs/agentkit/vendors/tts.d.ts +3 -3
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +5 -2
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +4 -0
- package/dist/cjs/api/types/Asr.d.ts +16 -1
- package/dist/cjs/api/types/BytedanceDuplexTts.d.ts +9 -0
- package/dist/cjs/api/types/BytedanceDuplexTts.js +3 -0
- package/dist/cjs/api/types/BytedanceDuplexTtsParams.d.ts +13 -0
- package/dist/cjs/api/types/BytedanceDuplexTtsParams.js +3 -0
- package/dist/cjs/api/types/BytedanceTts.d.ts +9 -0
- package/dist/cjs/api/types/BytedanceTts.js +3 -0
- package/dist/cjs/api/types/BytedanceTtsParams.d.ts +23 -0
- package/dist/cjs/api/types/BytedanceTtsParams.js +3 -0
- package/dist/cjs/api/types/CosyvoiceTts.d.ts +9 -0
- package/dist/cjs/api/types/CosyvoiceTts.js +3 -0
- package/dist/cjs/api/types/CosyvoiceTtsParams.d.ts +15 -0
- package/dist/cjs/api/types/CosyvoiceTtsParams.js +3 -0
- package/dist/cjs/api/types/FengmingAsr.d.ts +11 -0
- package/dist/cjs/api/types/FengmingAsr.js +3 -0
- package/dist/cjs/api/types/MinimaxTtsParams.d.ts +52 -3
- package/dist/cjs/api/types/OpenAiTtsParams.d.ts +1 -1
- package/dist/cjs/api/types/SensetimeAvatarParams.d.ts +48 -0
- package/dist/cjs/api/types/SensetimeAvatarParams.js +3 -0
- package/dist/cjs/api/types/StepfunTts.d.ts +9 -0
- package/dist/cjs/api/types/StepfunTts.js +3 -0
- package/dist/cjs/api/types/StepfunTtsParams.d.ts +13 -0
- package/dist/cjs/api/types/StepfunTtsParams.js +3 -0
- package/dist/cjs/api/types/TencentAsr.d.ts +10 -0
- package/dist/cjs/api/types/TencentAsr.js +3 -0
- package/dist/cjs/api/types/TencentAsrParams.d.ts +17 -0
- package/dist/cjs/api/types/TencentAsrParams.js +3 -0
- package/dist/cjs/api/types/TencentTts.d.ts +9 -0
- package/dist/cjs/api/types/TencentTts.js +3 -0
- package/dist/cjs/api/types/TencentTtsParams.d.ts +23 -0
- package/dist/cjs/api/types/TencentTtsParams.js +3 -0
- package/dist/cjs/api/types/Tts.d.ts +16 -1
- package/dist/cjs/api/types/XfyunAsr.d.ts +10 -0
- package/dist/cjs/api/types/XfyunAsr.js +3 -0
- package/dist/cjs/api/types/XfyunAsrParams.d.ts +15 -0
- package/dist/cjs/api/types/XfyunAsrParams.js +3 -0
- package/dist/cjs/api/types/XfyunBigmodelAsr.d.ts +10 -0
- package/dist/cjs/api/types/XfyunBigmodelAsr.js +3 -0
- package/dist/cjs/api/types/XfyunBigmodelAsrParams.d.ts +17 -0
- package/dist/cjs/api/types/XfyunBigmodelAsrParams.js +3 -0
- package/dist/cjs/api/types/XfyunDialectAsr.d.ts +10 -0
- package/dist/cjs/api/types/XfyunDialectAsr.js +3 -0
- package/dist/cjs/api/types/XfyunDialectAsrParams.d.ts +15 -0
- package/dist/cjs/api/types/XfyunDialectAsrParams.js +3 -0
- package/dist/cjs/api/types/index.d.ts +20 -0
- package/dist/cjs/api/types/index.js +20 -0
- package/dist/cjs/core/domain/index.d.ts +2 -1
- package/dist/cjs/core/domain/index.js +5 -3
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +26 -2
- package/dist/esm/AgoraPoolClient.d.mts +9 -6
- package/dist/esm/AgoraPoolClient.mjs +1 -0
- package/dist/esm/agentkit/Agent.d.mts +52 -51
- package/dist/esm/agentkit/Agent.mjs +40 -39
- package/dist/esm/agentkit/AgentSession.d.mts +11 -10
- package/dist/esm/agentkit/AgentSession.mjs +11 -7
- package/dist/esm/agentkit/__tests__/area-aware-vendors.test.d.mts +1 -0
- package/dist/esm/agentkit/__tests__/area-aware-vendors.test.mjs +55 -0
- package/dist/esm/agentkit/__tests__/readme-examples.test.d.mts +1 -0
- package/dist/esm/agentkit/__tests__/readme-examples.test.mjs +124 -0
- package/dist/esm/agentkit/__tests__/type-safety.test.mjs +24 -17
- package/dist/esm/agentkit/area.d.mts +4 -0
- package/dist/esm/agentkit/area.mjs +1 -0
- package/dist/esm/agentkit/avatar-types.d.mts +28 -2
- package/dist/esm/agentkit/avatar-types.mjs +23 -2
- package/dist/esm/agentkit/index.d.mts +8 -5
- package/dist/esm/agentkit/index.mjs +3 -2
- package/dist/esm/agentkit/region-vendors.d.mts +15 -0
- package/dist/esm/agentkit/region-vendors.mjs +1 -0
- package/dist/esm/agentkit/token.d.mts +3 -2
- package/dist/esm/agentkit/token.mjs +3 -2
- package/dist/esm/agentkit/types.d.mts +26 -5
- package/dist/esm/agentkit/vendors/avatar.d.mts +6 -3
- package/dist/esm/agentkit/vendors/avatar.mjs +6 -3
- package/dist/esm/agentkit/vendors/base.d.mts +38 -5
- package/dist/esm/agentkit/vendors/base.mjs +55 -5
- package/dist/esm/agentkit/vendors/cn.d.mts +251 -0
- package/dist/esm/agentkit/vendors/cn.mjs +272 -0
- package/dist/esm/agentkit/vendors/mllm.d.mts +8 -4
- package/dist/esm/agentkit/vendors/mllm.mjs +8 -4
- package/dist/esm/agentkit/vendors/stt.mjs +5 -0
- package/dist/esm/agentkit/vendors/tts.d.mts +3 -3
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +5 -2
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +4 -0
- package/dist/esm/api/types/Asr.d.mts +16 -1
- package/dist/esm/api/types/BytedanceDuplexTts.d.mts +9 -0
- package/dist/esm/api/types/BytedanceDuplexTts.mjs +2 -0
- package/dist/esm/api/types/BytedanceDuplexTtsParams.d.mts +13 -0
- package/dist/esm/api/types/BytedanceDuplexTtsParams.mjs +2 -0
- package/dist/esm/api/types/BytedanceTts.d.mts +9 -0
- package/dist/esm/api/types/BytedanceTts.mjs +2 -0
- package/dist/esm/api/types/BytedanceTtsParams.d.mts +23 -0
- package/dist/esm/api/types/BytedanceTtsParams.mjs +2 -0
- package/dist/esm/api/types/CosyvoiceTts.d.mts +9 -0
- package/dist/esm/api/types/CosyvoiceTts.mjs +2 -0
- package/dist/esm/api/types/CosyvoiceTtsParams.d.mts +15 -0
- package/dist/esm/api/types/CosyvoiceTtsParams.mjs +2 -0
- package/dist/esm/api/types/FengmingAsr.d.mts +11 -0
- package/dist/esm/api/types/FengmingAsr.mjs +2 -0
- package/dist/esm/api/types/MinimaxTtsParams.d.mts +52 -3
- package/dist/esm/api/types/OpenAiTtsParams.d.mts +1 -1
- package/dist/esm/api/types/SensetimeAvatarParams.d.mts +48 -0
- package/dist/esm/api/types/SensetimeAvatarParams.mjs +2 -0
- package/dist/esm/api/types/StepfunTts.d.mts +9 -0
- package/dist/esm/api/types/StepfunTts.mjs +2 -0
- package/dist/esm/api/types/StepfunTtsParams.d.mts +13 -0
- package/dist/esm/api/types/StepfunTtsParams.mjs +2 -0
- package/dist/esm/api/types/TencentAsr.d.mts +10 -0
- package/dist/esm/api/types/TencentAsr.mjs +2 -0
- package/dist/esm/api/types/TencentAsrParams.d.mts +17 -0
- package/dist/esm/api/types/TencentAsrParams.mjs +2 -0
- package/dist/esm/api/types/TencentTts.d.mts +9 -0
- package/dist/esm/api/types/TencentTts.mjs +2 -0
- package/dist/esm/api/types/TencentTtsParams.d.mts +23 -0
- package/dist/esm/api/types/TencentTtsParams.mjs +2 -0
- package/dist/esm/api/types/Tts.d.mts +16 -1
- package/dist/esm/api/types/XfyunAsr.d.mts +10 -0
- package/dist/esm/api/types/XfyunAsr.mjs +2 -0
- package/dist/esm/api/types/XfyunAsrParams.d.mts +15 -0
- package/dist/esm/api/types/XfyunAsrParams.mjs +2 -0
- package/dist/esm/api/types/XfyunBigmodelAsr.d.mts +10 -0
- package/dist/esm/api/types/XfyunBigmodelAsr.mjs +2 -0
- package/dist/esm/api/types/XfyunBigmodelAsrParams.d.mts +17 -0
- package/dist/esm/api/types/XfyunBigmodelAsrParams.mjs +2 -0
- package/dist/esm/api/types/XfyunDialectAsr.d.mts +10 -0
- package/dist/esm/api/types/XfyunDialectAsr.mjs +2 -0
- package/dist/esm/api/types/XfyunDialectAsrParams.d.mts +15 -0
- package/dist/esm/api/types/XfyunDialectAsrParams.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +20 -0
- package/dist/esm/api/types/index.mjs +20 -0
- package/dist/esm/core/domain/index.d.mts +2 -1
- package/dist/esm/core/domain/index.mjs +4 -2
- package/dist/esm/index.d.mts +3 -2
- package/dist/esm/index.mjs +6 -6
- package/package.json +1 -1
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
* parts that need manual updates when adding new sugar.
|
|
21
21
|
*/
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
23
|
+
exports.HeyGenAvatar = exports.GenericAvatar = exports.AnamAvatar = exports.AkoolAvatar = exports.MAX_EXPIRY_SECONDS = exports.generateRtcToken = exports.generateConvoAIToken = exports.ExpiresIn = exports.normalizePresetInput = exports.AgentPresets = exports.TurnDetectionTypeValues = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.ThinkOnListeningActionIgnore = exports.SpeakPriorityValues = exports.SpeakPriorityInterrupt = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SilenceActionValues = exports.SalModeValues = exports.MllmTurnDetectionModeValues = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeAgoraVad = exports.InterruptionModeValues = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeKeywords = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.Geofence = exports.FillerWordsSelectionRule = exports.DataChannel = exports.AudioScenario = exports.validateTtsSampleRate = exports.validateAvatarConfig = exports.toBaseAvatarConfig = exports.isSensetimeAvatar = exports.isLiveAvatarAvatar = exports.isHeyGenAvatar = exports.isGenericAvatar = exports.isAvatarTokenManaged = exports.isAnamAvatar = exports.isAkoolAvatar = exports.AgentSession = exports.Agent = void 0;
|
|
24
|
+
exports.SpeechmaticsSTT = exports.SarvamSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.GoogleSTT = exports.DeepgramSTT = exports.AssemblyAISTT = exports.AresSTT = exports.AmazonSTT = exports.XaiGrok = exports.VertexAI = exports.OpenAIRealtime = exports.GeminiLive = exports.VertexAILLM = exports.OpenAI = exports.Groq = exports.Gemini = exports.Dify = exports.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SensetimeAvatar = exports.MiniMaxCNTTS = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.FengmingSTT = exports.DeepSeekLLM = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.AliyunLLM = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.LiveAvatarAvatar = void 0;
|
|
25
|
+
exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GoogleTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = void 0;
|
|
25
26
|
// Core classes
|
|
26
27
|
var Agent_js_1 = require("./Agent.js");
|
|
27
28
|
Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return Agent_js_1.Agent; } });
|
|
@@ -34,6 +35,7 @@ Object.defineProperty(exports, "isAvatarTokenManaged", { enumerable: true, get:
|
|
|
34
35
|
Object.defineProperty(exports, "isGenericAvatar", { enumerable: true, get: function () { return avatar_types_js_1.isGenericAvatar; } });
|
|
35
36
|
Object.defineProperty(exports, "isHeyGenAvatar", { enumerable: true, get: function () { return avatar_types_js_1.isHeyGenAvatar; } });
|
|
36
37
|
Object.defineProperty(exports, "isLiveAvatarAvatar", { enumerable: true, get: function () { return avatar_types_js_1.isLiveAvatarAvatar; } });
|
|
38
|
+
Object.defineProperty(exports, "isSensetimeAvatar", { enumerable: true, get: function () { return avatar_types_js_1.isSensetimeAvatar; } });
|
|
37
39
|
Object.defineProperty(exports, "toBaseAvatarConfig", { enumerable: true, get: function () { return avatar_types_js_1.toBaseAvatarConfig; } });
|
|
38
40
|
Object.defineProperty(exports, "validateAvatarConfig", { enumerable: true, get: function () { return avatar_types_js_1.validateAvatarConfig; } });
|
|
39
41
|
Object.defineProperty(exports, "validateTtsSampleRate", { enumerable: true, get: function () { return avatar_types_js_1.validateTtsSampleRate; } });
|
|
@@ -86,10 +88,33 @@ Object.defineProperty(exports, "LiveAvatarAvatar", { enumerable: true, get: func
|
|
|
86
88
|
// Base vendor classes
|
|
87
89
|
var base_js_1 = require("./vendors/base.js");
|
|
88
90
|
Object.defineProperty(exports, "BaseAvatar", { enumerable: true, get: function () { return base_js_1.BaseAvatar; } });
|
|
91
|
+
Object.defineProperty(exports, "BaseCNAvatar", { enumerable: true, get: function () { return base_js_1.BaseCNAvatar; } });
|
|
92
|
+
Object.defineProperty(exports, "BaseCNLLM", { enumerable: true, get: function () { return base_js_1.BaseCNLLM; } });
|
|
93
|
+
Object.defineProperty(exports, "BaseCNSTT", { enumerable: true, get: function () { return base_js_1.BaseCNSTT; } });
|
|
94
|
+
Object.defineProperty(exports, "BaseCNTTS", { enumerable: true, get: function () { return base_js_1.BaseCNTTS; } });
|
|
89
95
|
Object.defineProperty(exports, "BaseLLM", { enumerable: true, get: function () { return base_js_1.BaseLLM; } });
|
|
90
96
|
Object.defineProperty(exports, "BaseMLLM", { enumerable: true, get: function () { return base_js_1.BaseMLLM; } });
|
|
91
97
|
Object.defineProperty(exports, "BaseSTT", { enumerable: true, get: function () { return base_js_1.BaseSTT; } });
|
|
92
98
|
Object.defineProperty(exports, "BaseTTS", { enumerable: true, get: function () { return base_js_1.BaseTTS; } });
|
|
99
|
+
var cn_js_1 = require("./vendors/cn.js");
|
|
100
|
+
Object.defineProperty(exports, "AliyunLLM", { enumerable: true, get: function () { return cn_js_1.AliyunLLM; } });
|
|
101
|
+
Object.defineProperty(exports, "BytedanceDuplexTTS", { enumerable: true, get: function () { return cn_js_1.BytedanceDuplexTTS; } });
|
|
102
|
+
Object.defineProperty(exports, "BytedanceLLM", { enumerable: true, get: function () { return cn_js_1.BytedanceLLM; } });
|
|
103
|
+
Object.defineProperty(exports, "BytedanceTTS", { enumerable: true, get: function () { return cn_js_1.BytedanceTTS; } });
|
|
104
|
+
Object.defineProperty(exports, "CosyVoiceTTS", { enumerable: true, get: function () { return cn_js_1.CosyVoiceTTS; } });
|
|
105
|
+
Object.defineProperty(exports, "DeepSeekLLM", { enumerable: true, get: function () { return cn_js_1.DeepSeekLLM; } });
|
|
106
|
+
Object.defineProperty(exports, "FengmingSTT", { enumerable: true, get: function () { return cn_js_1.FengmingSTT; } });
|
|
107
|
+
Object.defineProperty(exports, "MicrosoftCNSTT", { enumerable: true, get: function () { return cn_js_1.MicrosoftCNSTT; } });
|
|
108
|
+
Object.defineProperty(exports, "MicrosoftCNTTS", { enumerable: true, get: function () { return cn_js_1.MicrosoftCNTTS; } });
|
|
109
|
+
Object.defineProperty(exports, "MiniMaxCNTTS", { enumerable: true, get: function () { return cn_js_1.MiniMaxCNTTS; } });
|
|
110
|
+
Object.defineProperty(exports, "SensetimeAvatar", { enumerable: true, get: function () { return cn_js_1.SensetimeAvatar; } });
|
|
111
|
+
Object.defineProperty(exports, "StepFunTTS", { enumerable: true, get: function () { return cn_js_1.StepFunTTS; } });
|
|
112
|
+
Object.defineProperty(exports, "TencentLLM", { enumerable: true, get: function () { return cn_js_1.TencentLLM; } });
|
|
113
|
+
Object.defineProperty(exports, "TencentSTT", { enumerable: true, get: function () { return cn_js_1.TencentSTT; } });
|
|
114
|
+
Object.defineProperty(exports, "TencentTTS", { enumerable: true, get: function () { return cn_js_1.TencentTTS; } });
|
|
115
|
+
Object.defineProperty(exports, "XfyunBigModelSTT", { enumerable: true, get: function () { return cn_js_1.XfyunBigModelSTT; } });
|
|
116
|
+
Object.defineProperty(exports, "XfyunDialectSTT", { enumerable: true, get: function () { return cn_js_1.XfyunDialectSTT; } });
|
|
117
|
+
Object.defineProperty(exports, "XfyunSTT", { enumerable: true, get: function () { return cn_js_1.XfyunSTT; } });
|
|
93
118
|
// LLM vendor classes
|
|
94
119
|
var llm_js_1 = require("./vendors/llm.js");
|
|
95
120
|
Object.defineProperty(exports, "AmazonBedrock", { enumerable: true, get: function () { return llm_js_1.AmazonBedrock; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseSTT, BaseTTS } from "./vendors/base.js";
|
|
2
|
+
import type { MicrosoftCNSampleRate, MicrosoftCNSTT, MicrosoftCNTTS } from "./vendors/cn.js";
|
|
3
|
+
import type { CustomLLM } from "./vendors/llm.js";
|
|
4
|
+
export type GlobalLlmVendor = BaseLLM;
|
|
5
|
+
export type GlobalTtsVendor<SR extends number = number> = BaseTTS<SR>;
|
|
6
|
+
export type GlobalSttVendor = BaseSTT;
|
|
7
|
+
export type GlobalAvatarVendor<SR extends number = number> = BaseAvatar<SR>;
|
|
8
|
+
export type CNLlmVendor = BaseCNLLM | CustomLLM;
|
|
9
|
+
export type CNTtsVendor<SR extends number = number> = BaseCNTTS<SR> | (SR extends MicrosoftCNSampleRate ? MicrosoftCNTTS<SR> : never);
|
|
10
|
+
export type CNSttVendor = BaseCNSTT | MicrosoftCNSTT;
|
|
11
|
+
export type CNAvatarVendor<SR extends number = number> = BaseCNAvatar<SR>;
|
|
12
|
+
export type LlmVendor = GlobalLlmVendor | CNLlmVendor;
|
|
13
|
+
export type TtsVendor<SR extends number = number> = GlobalTtsVendor<SR> | CNTtsVendor<SR>;
|
|
14
|
+
export type SttVendor = GlobalSttVendor | CNSttVendor;
|
|
15
|
+
export type AvatarVendor<SR extends number = number> = GlobalAvatarVendor<SR> | CNAvatarVendor<SR>;
|
|
@@ -18,8 +18,9 @@ export declare const MAX_EXPIRY_SECONDS = 86400;
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```typescript
|
|
21
|
-
* agent.createSession(
|
|
22
|
-
*
|
|
21
|
+
* agent.createSession({
|
|
22
|
+
* name: `conversation-${Date.now()}`,
|
|
23
|
+
* channel: `demo-channel-${Date.now()}`,
|
|
23
24
|
* agentUid: '1',
|
|
24
25
|
* remoteUids: ['100'],
|
|
25
26
|
* expiresIn: ExpiresIn.hours(12),
|
|
@@ -29,8 +29,9 @@ exports.MAX_EXPIRY_SECONDS = 86400;
|
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```typescript
|
|
32
|
-
* agent.createSession(
|
|
33
|
-
*
|
|
32
|
+
* agent.createSession({
|
|
33
|
+
* name: `conversation-${Date.now()}`,
|
|
34
|
+
* channel: `demo-channel-${Date.now()}`,
|
|
34
35
|
* agentUid: '1',
|
|
35
36
|
* remoteUids: ['100'],
|
|
36
37
|
* expiresIn: ExpiresIn.hours(12),
|
|
@@ -13,6 +13,26 @@ export type LlmStyle = Llm.Style;
|
|
|
13
13
|
* When using shorthand strings or minimal configs, the untyped variant is available.
|
|
14
14
|
*/
|
|
15
15
|
export type SttConfig = {
|
|
16
|
+
vendor: "fengming";
|
|
17
|
+
language?: TurnDetectionLanguage;
|
|
18
|
+
params?: Record<string, unknown>;
|
|
19
|
+
} | {
|
|
20
|
+
vendor: "tencent";
|
|
21
|
+
language?: TurnDetectionLanguage;
|
|
22
|
+
params?: Record<string, unknown>;
|
|
23
|
+
} | {
|
|
24
|
+
vendor: "xfyun";
|
|
25
|
+
language?: TurnDetectionLanguage;
|
|
26
|
+
params?: Record<string, unknown>;
|
|
27
|
+
} | {
|
|
28
|
+
vendor: "xfyun_bigmodel";
|
|
29
|
+
language?: TurnDetectionLanguage;
|
|
30
|
+
params?: Record<string, unknown>;
|
|
31
|
+
} | {
|
|
32
|
+
vendor: "xfyun_dialect";
|
|
33
|
+
language?: TurnDetectionLanguage;
|
|
34
|
+
params?: Record<string, unknown>;
|
|
35
|
+
} | {
|
|
16
36
|
vendor: "speechmatics";
|
|
17
37
|
language?: TurnDetectionLanguage;
|
|
18
38
|
params: SpeechmaticsParams;
|
|
@@ -51,8 +71,8 @@ export type SttConfig = {
|
|
|
51
71
|
} | Asr;
|
|
52
72
|
/** ASR configuration — alias for {@link SttConfig} (wire field: `asr`). */
|
|
53
73
|
export type AsrConfig = SttConfig;
|
|
54
|
-
/**
|
|
55
|
-
export type
|
|
74
|
+
/** Wire ASR vendor identifier (e.g. `"deepgram"`, `"fengming"`). */
|
|
75
|
+
export type AsrVendorName = string;
|
|
56
76
|
/** TTS (Text-to-Speech) configuration - discriminated union */
|
|
57
77
|
export type TtsConfig = Tts;
|
|
58
78
|
/** MLLM (Multimodal LLM) configuration */
|
|
@@ -62,7 +82,8 @@ export type MllmVendor = Mllm.Vendor;
|
|
|
62
82
|
/** Avatar configuration */
|
|
63
83
|
export type AvatarConfig = StartAgentsRequest.Properties.Avatar;
|
|
64
84
|
/** Avatar vendor (akool, liveavatar, anam, generic, deprecated heygen) */
|
|
65
|
-
|
|
85
|
+
/** Wire avatar vendor identifier (e.g. `"liveavatar"`, `"sensetime"`). */
|
|
86
|
+
export type AvatarWireVendor = StartAgentsRequest.Properties.Avatar.Vendor;
|
|
66
87
|
/** BCP-47 language tag used by `turn_detection.language`. */
|
|
67
88
|
export type TurnDetectionLanguage = AsrLanguage;
|
|
68
89
|
/** Turn detection configuration */
|
|
@@ -191,9 +212,9 @@ export type McpServersItem = Record<string, unknown>;
|
|
|
191
212
|
export type AgentConfig = StartAgentsRequest.Properties;
|
|
192
213
|
/** Agent configuration update (for runtime updates) */
|
|
193
214
|
export type AgentConfigUpdate = UpdateAgentsRequest.Properties;
|
|
194
|
-
/** Options for creating a session */
|
|
215
|
+
/** Options for creating a session via {@link Agent.createSession} */
|
|
195
216
|
export interface SessionOptions {
|
|
196
|
-
/** Unique
|
|
217
|
+
/** Unique agent instance name sent to the Agora API. Omit to auto-generate `agent-{timestamp}`. */
|
|
197
218
|
name?: string;
|
|
198
219
|
/** The channel to join */
|
|
199
220
|
channel: string;
|
|
@@ -69,7 +69,8 @@ export interface AkoolAvatarOptions {
|
|
|
69
69
|
* sampleRate: 16000, // Required for Akool
|
|
70
70
|
* });
|
|
71
71
|
*
|
|
72
|
-
* const
|
|
72
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
73
|
+
* const agent = new Agent({ client })
|
|
73
74
|
* .withTts(tts)
|
|
74
75
|
* .withAvatar(avatar);
|
|
75
76
|
* ```
|
|
@@ -110,7 +111,8 @@ export declare class AkoolAvatar extends BaseAvatar<AkoolSampleRate> {
|
|
|
110
111
|
* sampleRate: 24000, // Required for LiveAvatar
|
|
111
112
|
* });
|
|
112
113
|
*
|
|
113
|
-
* const
|
|
114
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
115
|
+
* const agent = new Agent({ client })
|
|
114
116
|
* .withTts(tts)
|
|
115
117
|
* .withAvatar(avatar);
|
|
116
118
|
* ```
|
|
@@ -168,7 +170,8 @@ export interface AnamAvatarOptions {
|
|
|
168
170
|
* personaId: 'persona-id',
|
|
169
171
|
* });
|
|
170
172
|
*
|
|
171
|
-
* const
|
|
173
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
174
|
+
* const agent = new Agent({ client })
|
|
172
175
|
* .withAvatar(avatar);
|
|
173
176
|
* ```
|
|
174
177
|
*
|
|
@@ -32,7 +32,8 @@ const base_js_1 = require("./base.js");
|
|
|
32
32
|
* sampleRate: 16000, // Required for Akool
|
|
33
33
|
* });
|
|
34
34
|
*
|
|
35
|
-
* const
|
|
35
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
36
|
+
* const agent = new Agent({ client })
|
|
36
37
|
* .withTts(tts)
|
|
37
38
|
* .withAvatar(avatar);
|
|
38
39
|
* ```
|
|
@@ -91,7 +92,8 @@ exports.AkoolAvatar = AkoolAvatar;
|
|
|
91
92
|
* sampleRate: 24000, // Required for LiveAvatar
|
|
92
93
|
* });
|
|
93
94
|
*
|
|
94
|
-
* const
|
|
95
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
96
|
+
* const agent = new Agent({ client })
|
|
95
97
|
* .withTts(tts)
|
|
96
98
|
* .withAvatar(avatar);
|
|
97
99
|
* ```
|
|
@@ -172,7 +174,8 @@ exports.HeyGenAvatar = HeyGenAvatar;
|
|
|
172
174
|
* personaId: 'persona-id',
|
|
173
175
|
* });
|
|
174
176
|
*
|
|
175
|
-
* const
|
|
177
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
178
|
+
* const agent = new Agent({ client })
|
|
176
179
|
* .withAvatar(avatar);
|
|
177
180
|
* ```
|
|
178
181
|
*
|
|
@@ -43,6 +43,7 @@ export interface BaseLlmOptions {
|
|
|
43
43
|
/** MCP server configurations enabling the agent to call tools from external services */
|
|
44
44
|
mcpServers?: McpServersItem[];
|
|
45
45
|
}
|
|
46
|
+
type VendorScope = "global" | "cn";
|
|
46
47
|
/**
|
|
47
48
|
* Standard audio sample rates supported by Agora platform.
|
|
48
49
|
* Different vendors support different subsets of these rates.
|
|
@@ -82,13 +83,14 @@ export type AkoolSampleRate = 16000;
|
|
|
82
83
|
/**
|
|
83
84
|
* Base class for LLM (Large Language Model) vendors.
|
|
84
85
|
*/
|
|
85
|
-
|
|
86
|
+
declare abstract class ScopedBaseLLM<TScope extends VendorScope> {
|
|
87
|
+
readonly areaScope: TScope;
|
|
86
88
|
private readonly _outputModalities?;
|
|
87
89
|
private readonly _greetingConfigs?;
|
|
88
90
|
private readonly _templateVariables?;
|
|
89
91
|
private readonly _vendor?;
|
|
90
92
|
private readonly _mcpServers?;
|
|
91
|
-
constructor(options?: BaseLlmOptions);
|
|
93
|
+
constructor(areaScope: TScope, options?: BaseLlmOptions);
|
|
92
94
|
protected get outputModalities(): string[] | undefined;
|
|
93
95
|
protected get greetingConfigs(): LlmGreetingConfigs | undefined;
|
|
94
96
|
protected get templateVariables(): Record<string, string> | undefined;
|
|
@@ -100,6 +102,12 @@ export declare abstract class BaseLLM {
|
|
|
100
102
|
*/
|
|
101
103
|
abstract toConfig(): LlmConfig;
|
|
102
104
|
}
|
|
105
|
+
export declare abstract class BaseLLM extends ScopedBaseLLM<"global"> {
|
|
106
|
+
constructor(options?: BaseLlmOptions);
|
|
107
|
+
}
|
|
108
|
+
export declare abstract class BaseCNLLM extends ScopedBaseLLM<"cn"> {
|
|
109
|
+
constructor(options?: BaseLlmOptions);
|
|
110
|
+
}
|
|
103
111
|
/**
|
|
104
112
|
* Base class for TTS (Text-to-Speech) vendors with sample rate tracking.
|
|
105
113
|
*
|
|
@@ -117,21 +125,37 @@ export declare abstract class BaseLLM {
|
|
|
117
125
|
*
|
|
118
126
|
* @template SR - Sample rate literal type (e.g., 24000, 16000)
|
|
119
127
|
*/
|
|
120
|
-
|
|
128
|
+
declare abstract class ScopedBaseTTS<TScope extends VendorScope, _SR extends number = number> {
|
|
129
|
+
readonly areaScope: TScope;
|
|
130
|
+
constructor(areaScope: TScope);
|
|
121
131
|
/**
|
|
122
132
|
* Converts the vendor configuration to the Agora API format.
|
|
123
133
|
*/
|
|
124
134
|
abstract toConfig(): TtsConfig;
|
|
125
135
|
}
|
|
136
|
+
export declare abstract class BaseTTS<_SR extends number = number> extends ScopedBaseTTS<"global", _SR> {
|
|
137
|
+
constructor();
|
|
138
|
+
}
|
|
139
|
+
export declare abstract class BaseCNTTS<_SR extends number = number> extends ScopedBaseTTS<"cn", _SR> {
|
|
140
|
+
constructor();
|
|
141
|
+
}
|
|
126
142
|
/**
|
|
127
143
|
* Base class for STT (Speech-to-Text) vendors.
|
|
128
144
|
*/
|
|
129
|
-
|
|
145
|
+
declare abstract class ScopedBaseSTT<TScope extends VendorScope> {
|
|
146
|
+
readonly areaScope: TScope;
|
|
147
|
+
constructor(areaScope: TScope);
|
|
130
148
|
/**
|
|
131
149
|
* Converts the vendor configuration to the Agora API format.
|
|
132
150
|
*/
|
|
133
151
|
abstract toConfig(): SttConfig;
|
|
134
152
|
}
|
|
153
|
+
export declare abstract class BaseSTT extends ScopedBaseSTT<"global"> {
|
|
154
|
+
constructor();
|
|
155
|
+
}
|
|
156
|
+
export declare abstract class BaseCNSTT extends ScopedBaseSTT<"cn"> {
|
|
157
|
+
constructor();
|
|
158
|
+
}
|
|
135
159
|
/**
|
|
136
160
|
* Base class for MLLM (Multimodal Large Language Model) vendors.
|
|
137
161
|
*/
|
|
@@ -145,7 +169,9 @@ export declare abstract class BaseMLLM {
|
|
|
145
169
|
* Base class for Avatar vendors with required sample rate.
|
|
146
170
|
* @template RequiredSR - Required sample rate literal type
|
|
147
171
|
*/
|
|
148
|
-
|
|
172
|
+
declare abstract class ScopedBaseAvatar<TScope extends VendorScope, RequiredSR extends number = number> {
|
|
173
|
+
readonly areaScope: TScope;
|
|
174
|
+
constructor(areaScope: TScope);
|
|
149
175
|
/**
|
|
150
176
|
* Converts the vendor configuration to the Agora API format.
|
|
151
177
|
*/
|
|
@@ -155,3 +181,10 @@ export declare abstract class BaseAvatar<RequiredSR extends number = number> {
|
|
|
155
181
|
*/
|
|
156
182
|
abstract readonly requiredSampleRate: RequiredSR;
|
|
157
183
|
}
|
|
184
|
+
export declare abstract class BaseAvatar<RequiredSR extends number = number> extends ScopedBaseAvatar<"global", RequiredSR> {
|
|
185
|
+
constructor();
|
|
186
|
+
}
|
|
187
|
+
export declare abstract class BaseCNAvatar<RequiredSR extends number = number> extends ScopedBaseAvatar<"cn", RequiredSR> {
|
|
188
|
+
constructor();
|
|
189
|
+
}
|
|
190
|
+
export {};
|
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
* Agora API format (snake_case).
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.BaseAvatar = exports.BaseMLLM = exports.BaseSTT = exports.BaseTTS = exports.BaseLLM = void 0;
|
|
10
|
+
exports.BaseCNAvatar = exports.BaseAvatar = exports.BaseMLLM = exports.BaseCNSTT = exports.BaseSTT = exports.BaseCNTTS = exports.BaseTTS = exports.BaseCNLLM = exports.BaseLLM = void 0;
|
|
11
11
|
/**
|
|
12
12
|
* Base class for LLM (Large Language Model) vendors.
|
|
13
13
|
*/
|
|
14
|
-
class
|
|
15
|
-
constructor(options) {
|
|
14
|
+
class ScopedBaseLLM {
|
|
15
|
+
constructor(areaScope, options) {
|
|
16
|
+
this.areaScope = areaScope;
|
|
16
17
|
this._outputModalities = options === null || options === void 0 ? void 0 : options.outputModalities;
|
|
17
18
|
this._greetingConfigs = options === null || options === void 0 ? void 0 : options.greetingConfigs;
|
|
18
19
|
this._templateVariables = options === null || options === void 0 ? void 0 : options.templateVariables;
|
|
@@ -39,7 +40,18 @@ class BaseLLM {
|
|
|
39
40
|
return this._mcpServers.map((s) => (s.transport ? s : Object.assign(Object.assign({}, s), { transport: "streamable_http" })));
|
|
40
41
|
}
|
|
41
42
|
}
|
|
43
|
+
class BaseLLM extends ScopedBaseLLM {
|
|
44
|
+
constructor(options) {
|
|
45
|
+
super("global", options);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
42
48
|
exports.BaseLLM = BaseLLM;
|
|
49
|
+
class BaseCNLLM extends ScopedBaseLLM {
|
|
50
|
+
constructor(options) {
|
|
51
|
+
super("cn", options);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.BaseCNLLM = BaseCNLLM;
|
|
43
55
|
/**
|
|
44
56
|
* Base class for TTS (Text-to-Speech) vendors with sample rate tracking.
|
|
45
57
|
*
|
|
@@ -57,15 +69,43 @@ exports.BaseLLM = BaseLLM;
|
|
|
57
69
|
*
|
|
58
70
|
* @template SR - Sample rate literal type (e.g., 24000, 16000)
|
|
59
71
|
*/
|
|
60
|
-
class
|
|
72
|
+
class ScopedBaseTTS {
|
|
73
|
+
constructor(areaScope) {
|
|
74
|
+
this.areaScope = areaScope;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
class BaseTTS extends ScopedBaseTTS {
|
|
78
|
+
constructor() {
|
|
79
|
+
super("global");
|
|
80
|
+
}
|
|
61
81
|
}
|
|
62
82
|
exports.BaseTTS = BaseTTS;
|
|
83
|
+
class BaseCNTTS extends ScopedBaseTTS {
|
|
84
|
+
constructor() {
|
|
85
|
+
super("cn");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.BaseCNTTS = BaseCNTTS;
|
|
63
89
|
/**
|
|
64
90
|
* Base class for STT (Speech-to-Text) vendors.
|
|
65
91
|
*/
|
|
66
|
-
class
|
|
92
|
+
class ScopedBaseSTT {
|
|
93
|
+
constructor(areaScope) {
|
|
94
|
+
this.areaScope = areaScope;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
class BaseSTT extends ScopedBaseSTT {
|
|
98
|
+
constructor() {
|
|
99
|
+
super("global");
|
|
100
|
+
}
|
|
67
101
|
}
|
|
68
102
|
exports.BaseSTT = BaseSTT;
|
|
103
|
+
class BaseCNSTT extends ScopedBaseSTT {
|
|
104
|
+
constructor() {
|
|
105
|
+
super("cn");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.BaseCNSTT = BaseCNSTT;
|
|
69
109
|
/**
|
|
70
110
|
* Base class for MLLM (Multimodal Large Language Model) vendors.
|
|
71
111
|
*/
|
|
@@ -76,6 +116,20 @@ exports.BaseMLLM = BaseMLLM;
|
|
|
76
116
|
* Base class for Avatar vendors with required sample rate.
|
|
77
117
|
* @template RequiredSR - Required sample rate literal type
|
|
78
118
|
*/
|
|
79
|
-
class
|
|
119
|
+
class ScopedBaseAvatar {
|
|
120
|
+
constructor(areaScope) {
|
|
121
|
+
this.areaScope = areaScope;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
class BaseAvatar extends ScopedBaseAvatar {
|
|
125
|
+
constructor() {
|
|
126
|
+
super("global");
|
|
127
|
+
}
|
|
80
128
|
}
|
|
81
129
|
exports.BaseAvatar = BaseAvatar;
|
|
130
|
+
class BaseCNAvatar extends ScopedBaseAvatar {
|
|
131
|
+
constructor() {
|
|
132
|
+
super("cn");
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
exports.BaseCNAvatar = BaseCNAvatar;
|