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
|
@@ -9,16 +9,23 @@ export * from "./Asr.js";
|
|
|
9
9
|
export * from "./AsrLanguage.js";
|
|
10
10
|
export * from "./AssemblyAiAsr.js";
|
|
11
11
|
export * from "./AssemblyAiAsrParams.js";
|
|
12
|
+
export * from "./BytedanceDuplexTts.js";
|
|
13
|
+
export * from "./BytedanceDuplexTtsParams.js";
|
|
14
|
+
export * from "./BytedanceTts.js";
|
|
15
|
+
export * from "./BytedanceTtsParams.js";
|
|
12
16
|
export * from "./CartesiaTts.js";
|
|
13
17
|
export * from "./CartesiaTtsOutputFormat.js";
|
|
14
18
|
export * from "./CartesiaTtsParams.js";
|
|
15
19
|
export * from "./CartesiaTtsVoice.js";
|
|
20
|
+
export * from "./CosyvoiceTts.js";
|
|
21
|
+
export * from "./CosyvoiceTtsParams.js";
|
|
16
22
|
export * from "./DeepgramAsr.js";
|
|
17
23
|
export * from "./DeepgramAsrParams.js";
|
|
18
24
|
export * from "./DeepgramTts.js";
|
|
19
25
|
export * from "./DeepgramTtsParams.js";
|
|
20
26
|
export * from "./ElevenLabsTts.js";
|
|
21
27
|
export * from "./ElevenLabsTtsParams.js";
|
|
28
|
+
export * from "./FengmingAsr.js";
|
|
22
29
|
export * from "./FishAudioTts.js";
|
|
23
30
|
export * from "./FishAudioTtsParams.js";
|
|
24
31
|
export * from "./GoogleAsr.js";
|
|
@@ -55,7 +62,20 @@ export * from "./SarvamAsr.js";
|
|
|
55
62
|
export * from "./SarvamAsrParams.js";
|
|
56
63
|
export * from "./SarvamTts.js";
|
|
57
64
|
export * from "./SarvamTtsParams.js";
|
|
65
|
+
export * from "./SensetimeAvatarParams.js";
|
|
58
66
|
export * from "./SpeechmaticsAsr.js";
|
|
59
67
|
export * from "./SpeechmaticsAsrParams.js";
|
|
68
|
+
export * from "./StepfunTts.js";
|
|
69
|
+
export * from "./StepfunTtsParams.js";
|
|
60
70
|
export * from "./TelephonyErrorResponse.js";
|
|
71
|
+
export * from "./TencentAsr.js";
|
|
72
|
+
export * from "./TencentAsrParams.js";
|
|
73
|
+
export * from "./TencentTts.js";
|
|
74
|
+
export * from "./TencentTtsParams.js";
|
|
61
75
|
export * from "./Tts.js";
|
|
76
|
+
export * from "./XfyunAsr.js";
|
|
77
|
+
export * from "./XfyunAsrParams.js";
|
|
78
|
+
export * from "./XfyunBigmodelAsr.js";
|
|
79
|
+
export * from "./XfyunBigmodelAsrParams.js";
|
|
80
|
+
export * from "./XfyunDialectAsr.js";
|
|
81
|
+
export * from "./XfyunDialectAsrParams.js";
|
|
@@ -25,16 +25,23 @@ __exportStar(require("./Asr.js"), exports);
|
|
|
25
25
|
__exportStar(require("./AsrLanguage.js"), exports);
|
|
26
26
|
__exportStar(require("./AssemblyAiAsr.js"), exports);
|
|
27
27
|
__exportStar(require("./AssemblyAiAsrParams.js"), exports);
|
|
28
|
+
__exportStar(require("./BytedanceDuplexTts.js"), exports);
|
|
29
|
+
__exportStar(require("./BytedanceDuplexTtsParams.js"), exports);
|
|
30
|
+
__exportStar(require("./BytedanceTts.js"), exports);
|
|
31
|
+
__exportStar(require("./BytedanceTtsParams.js"), exports);
|
|
28
32
|
__exportStar(require("./CartesiaTts.js"), exports);
|
|
29
33
|
__exportStar(require("./CartesiaTtsOutputFormat.js"), exports);
|
|
30
34
|
__exportStar(require("./CartesiaTtsParams.js"), exports);
|
|
31
35
|
__exportStar(require("./CartesiaTtsVoice.js"), exports);
|
|
36
|
+
__exportStar(require("./CosyvoiceTts.js"), exports);
|
|
37
|
+
__exportStar(require("./CosyvoiceTtsParams.js"), exports);
|
|
32
38
|
__exportStar(require("./DeepgramAsr.js"), exports);
|
|
33
39
|
__exportStar(require("./DeepgramAsrParams.js"), exports);
|
|
34
40
|
__exportStar(require("./DeepgramTts.js"), exports);
|
|
35
41
|
__exportStar(require("./DeepgramTtsParams.js"), exports);
|
|
36
42
|
__exportStar(require("./ElevenLabsTts.js"), exports);
|
|
37
43
|
__exportStar(require("./ElevenLabsTtsParams.js"), exports);
|
|
44
|
+
__exportStar(require("./FengmingAsr.js"), exports);
|
|
38
45
|
__exportStar(require("./FishAudioTts.js"), exports);
|
|
39
46
|
__exportStar(require("./FishAudioTtsParams.js"), exports);
|
|
40
47
|
__exportStar(require("./GoogleAsr.js"), exports);
|
|
@@ -71,7 +78,20 @@ __exportStar(require("./SarvamAsr.js"), exports);
|
|
|
71
78
|
__exportStar(require("./SarvamAsrParams.js"), exports);
|
|
72
79
|
__exportStar(require("./SarvamTts.js"), exports);
|
|
73
80
|
__exportStar(require("./SarvamTtsParams.js"), exports);
|
|
81
|
+
__exportStar(require("./SensetimeAvatarParams.js"), exports);
|
|
74
82
|
__exportStar(require("./SpeechmaticsAsr.js"), exports);
|
|
75
83
|
__exportStar(require("./SpeechmaticsAsrParams.js"), exports);
|
|
84
|
+
__exportStar(require("./StepfunTts.js"), exports);
|
|
85
|
+
__exportStar(require("./StepfunTtsParams.js"), exports);
|
|
76
86
|
__exportStar(require("./TelephonyErrorResponse.js"), exports);
|
|
87
|
+
__exportStar(require("./TencentAsr.js"), exports);
|
|
88
|
+
__exportStar(require("./TencentAsrParams.js"), exports);
|
|
89
|
+
__exportStar(require("./TencentTts.js"), exports);
|
|
90
|
+
__exportStar(require("./TencentTtsParams.js"), exports);
|
|
77
91
|
__exportStar(require("./Tts.js"), exports);
|
|
92
|
+
__exportStar(require("./XfyunAsr.js"), exports);
|
|
93
|
+
__exportStar(require("./XfyunAsrParams.js"), exports);
|
|
94
|
+
__exportStar(require("./XfyunBigmodelAsr.js"), exports);
|
|
95
|
+
__exportStar(require("./XfyunBigmodelAsrParams.js"), exports);
|
|
96
|
+
__exportStar(require("./XfyunDialectAsr.js"), exports);
|
|
97
|
+
__exportStar(require("./XfyunDialectAsrParams.js"), exports);
|
|
@@ -23,7 +23,8 @@ export declare const EUWestRegionDomainPrefix = "api-eu-west-1";
|
|
|
23
23
|
export declare const EUCentralRegionDomainPrefix = "api-eu-central-1";
|
|
24
24
|
export declare const CNEastRegionDomainPrefix = "api-cn-east-1";
|
|
25
25
|
export declare const CNNorthRegionDomainPrefix = "api-cn-north-1";
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const GlobalAPIPath = "/api/conversational-ai-agent";
|
|
27
|
+
export declare const CNAPIPath = "/cn/api/conversational-ai-agent";
|
|
27
28
|
/**
|
|
28
29
|
* Domain contains the regional prefixes and domain suffixes for an area
|
|
29
30
|
*/
|
|
@@ -43,7 +43,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.Pool = exports.RegionDomain = exports.
|
|
46
|
+
exports.Pool = exports.RegionDomain = exports.CNAPIPath = exports.GlobalAPIPath = exports.CNNorthRegionDomainPrefix = exports.CNEastRegionDomainPrefix = exports.EUCentralRegionDomainPrefix = exports.EUWestRegionDomainPrefix = exports.APNortheastRegionDomainPrefix = exports.APSoutheastRegionDomainPrefix = exports.USEastRegionDomainPrefix = exports.USWestRegionDomainPrefix = exports.GlobalDomainPrefix = exports.OverseaMajorDomain = exports.ChineseMainlandMajorDomain = exports.Area = void 0;
|
|
47
47
|
exports.createPool = createPool;
|
|
48
48
|
const dns = __importStar(require("dns"));
|
|
49
49
|
const util_1 = require("util");
|
|
@@ -74,7 +74,8 @@ exports.EUWestRegionDomainPrefix = "api-eu-west-1";
|
|
|
74
74
|
exports.EUCentralRegionDomainPrefix = "api-eu-central-1";
|
|
75
75
|
exports.CNEastRegionDomainPrefix = "api-cn-east-1";
|
|
76
76
|
exports.CNNorthRegionDomainPrefix = "api-cn-north-1";
|
|
77
|
-
exports.
|
|
77
|
+
exports.GlobalAPIPath = "/api/conversational-ai-agent";
|
|
78
|
+
exports.CNAPIPath = "/cn/api/conversational-ai-agent";
|
|
78
79
|
/**
|
|
79
80
|
* RegionDomain maps areas to their domain configurations
|
|
80
81
|
*/
|
|
@@ -177,7 +178,8 @@ class Pool {
|
|
|
177
178
|
getCurrentURL() {
|
|
178
179
|
const currentRegion = this.currentRegionPrefixes[0];
|
|
179
180
|
const currentDomain = this.currentDomain;
|
|
180
|
-
|
|
181
|
+
const apiPath = this.domainArea === Area.CN ? exports.CNAPIPath : exports.GlobalAPIPath;
|
|
182
|
+
return `https://${currentRegion}.${currentDomain}${apiPath}`;
|
|
181
183
|
}
|
|
182
184
|
/**
|
|
183
185
|
* Get the current area
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export type { AgoraAuthMode } from "./AgoraPoolClient.js";
|
|
2
2
|
export { AgoraClient } from "./AgoraPoolClient.js";
|
|
3
|
-
export type {
|
|
4
|
-
export {
|
|
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";
|
|
5
6
|
export * as Agora from "./api/index.js";
|
|
6
7
|
export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
7
8
|
export { Area } from "./core/domain/index.js";
|
package/dist/cjs/index.js
CHANGED
|
@@ -36,8 +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.
|
|
39
|
+
exports.HeyGenAvatar = exports.generateRtcToken = exports.generateConvoAIToken = exports.Groq = exports.GoogleTTS = exports.GoogleSTT = exports.Geofence = 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.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.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.ThinkOnListeningActionIgnore = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SpeechmaticsSTT = exports.SpeakPriorityValues = exports.SpeakPriorityInterrupt = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = 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.MiniMaxTTS = exports.MiniMaxCNTTS = exports.MicrosoftTTS = exports.MicrosoftSTT = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.MAX_EXPIRY_SECONDS = exports.LiveAvatarAvatar = 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 = void 0;
|
|
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;
|
|
41
42
|
var AgoraPoolClient_js_1 = require("./AgoraPoolClient.js");
|
|
42
43
|
Object.defineProperty(exports, "AgoraClient", { enumerable: true, get: function () { return AgoraPoolClient_js_1.AgoraClient; } });
|
|
43
44
|
// Agentkit layer exports - clean, ergonomic API
|
|
@@ -46,6 +47,7 @@ Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { r
|
|
|
46
47
|
Object.defineProperty(exports, "AgentPresets", { enumerable: true, get: function () { return index_js_1.AgentPresets; } });
|
|
47
48
|
Object.defineProperty(exports, "AgentSession", { enumerable: true, get: function () { return index_js_1.AgentSession; } });
|
|
48
49
|
Object.defineProperty(exports, "AkoolAvatar", { enumerable: true, get: function () { return index_js_1.AkoolAvatar; } });
|
|
50
|
+
Object.defineProperty(exports, "AliyunLLM", { enumerable: true, get: function () { return index_js_1.AliyunLLM; } });
|
|
49
51
|
Object.defineProperty(exports, "AmazonBedrock", { enumerable: true, get: function () { return index_js_1.AmazonBedrock; } });
|
|
50
52
|
Object.defineProperty(exports, "AmazonSTT", { enumerable: true, get: function () { return index_js_1.AmazonSTT; } });
|
|
51
53
|
Object.defineProperty(exports, "AmazonTTS", { enumerable: true, get: function () { return index_js_1.AmazonTTS; } });
|
|
@@ -56,20 +58,30 @@ Object.defineProperty(exports, "AssemblyAISTT", { enumerable: true, get: functio
|
|
|
56
58
|
Object.defineProperty(exports, "AudioScenario", { enumerable: true, get: function () { return index_js_1.AudioScenario; } });
|
|
57
59
|
Object.defineProperty(exports, "AzureOpenAI", { enumerable: true, get: function () { return index_js_1.AzureOpenAI; } });
|
|
58
60
|
Object.defineProperty(exports, "BaseAvatar", { enumerable: true, get: function () { return index_js_1.BaseAvatar; } });
|
|
61
|
+
Object.defineProperty(exports, "BaseCNAvatar", { enumerable: true, get: function () { return index_js_1.BaseCNAvatar; } });
|
|
62
|
+
Object.defineProperty(exports, "BaseCNLLM", { enumerable: true, get: function () { return index_js_1.BaseCNLLM; } });
|
|
63
|
+
Object.defineProperty(exports, "BaseCNSTT", { enumerable: true, get: function () { return index_js_1.BaseCNSTT; } });
|
|
64
|
+
Object.defineProperty(exports, "BaseCNTTS", { enumerable: true, get: function () { return index_js_1.BaseCNTTS; } });
|
|
59
65
|
// Base vendor classes
|
|
60
66
|
Object.defineProperty(exports, "BaseLLM", { enumerable: true, get: function () { return index_js_1.BaseLLM; } });
|
|
61
67
|
Object.defineProperty(exports, "BaseMLLM", { enumerable: true, get: function () { return index_js_1.BaseMLLM; } });
|
|
62
68
|
Object.defineProperty(exports, "BaseSTT", { enumerable: true, get: function () { return index_js_1.BaseSTT; } });
|
|
63
69
|
Object.defineProperty(exports, "BaseTTS", { enumerable: true, get: function () { return index_js_1.BaseTTS; } });
|
|
70
|
+
Object.defineProperty(exports, "BytedanceDuplexTTS", { enumerable: true, get: function () { return index_js_1.BytedanceDuplexTTS; } });
|
|
71
|
+
Object.defineProperty(exports, "BytedanceLLM", { enumerable: true, get: function () { return index_js_1.BytedanceLLM; } });
|
|
72
|
+
Object.defineProperty(exports, "BytedanceTTS", { enumerable: true, get: function () { return index_js_1.BytedanceTTS; } });
|
|
64
73
|
Object.defineProperty(exports, "CartesiaTTS", { enumerable: true, get: function () { return index_js_1.CartesiaTTS; } });
|
|
74
|
+
Object.defineProperty(exports, "CosyVoiceTTS", { enumerable: true, get: function () { return index_js_1.CosyVoiceTTS; } });
|
|
65
75
|
Object.defineProperty(exports, "CustomLLM", { enumerable: true, get: function () { return index_js_1.CustomLLM; } });
|
|
66
76
|
Object.defineProperty(exports, "DataChannel", { enumerable: true, get: function () { return index_js_1.DataChannel; } });
|
|
67
77
|
Object.defineProperty(exports, "DeepgramSTT", { enumerable: true, get: function () { return index_js_1.DeepgramSTT; } });
|
|
68
78
|
Object.defineProperty(exports, "DeepgramTTS", { enumerable: true, get: function () { return index_js_1.DeepgramTTS; } });
|
|
79
|
+
Object.defineProperty(exports, "DeepSeekLLM", { enumerable: true, get: function () { return index_js_1.DeepSeekLLM; } });
|
|
69
80
|
Object.defineProperty(exports, "Dify", { enumerable: true, get: function () { return index_js_1.Dify; } });
|
|
70
81
|
// TTS vendors
|
|
71
82
|
Object.defineProperty(exports, "ElevenLabsTTS", { enumerable: true, get: function () { return index_js_1.ElevenLabsTTS; } });
|
|
72
83
|
Object.defineProperty(exports, "ExpiresIn", { enumerable: true, get: function () { return index_js_1.ExpiresIn; } });
|
|
84
|
+
Object.defineProperty(exports, "FengmingSTT", { enumerable: true, get: function () { return index_js_1.FengmingSTT; } });
|
|
73
85
|
Object.defineProperty(exports, "FillerWordsSelectionRule", { enumerable: true, get: function () { return index_js_1.FillerWordsSelectionRule; } });
|
|
74
86
|
Object.defineProperty(exports, "FishAudioTTS", { enumerable: true, get: function () { return index_js_1.FishAudioTTS; } });
|
|
75
87
|
Object.defineProperty(exports, "Gemini", { enumerable: true, get: function () { return index_js_1.Gemini; } });
|
|
@@ -96,10 +108,14 @@ Object.defineProperty(exports, "isAvatarTokenManaged", { enumerable: true, get:
|
|
|
96
108
|
Object.defineProperty(exports, "isGenericAvatar", { enumerable: true, get: function () { return index_js_1.isGenericAvatar; } });
|
|
97
109
|
Object.defineProperty(exports, "isHeyGenAvatar", { enumerable: true, get: function () { return index_js_1.isHeyGenAvatar; } });
|
|
98
110
|
Object.defineProperty(exports, "isLiveAvatarAvatar", { enumerable: true, get: function () { return index_js_1.isLiveAvatarAvatar; } });
|
|
111
|
+
Object.defineProperty(exports, "isSensetimeAvatar", { enumerable: true, get: function () { return index_js_1.isSensetimeAvatar; } });
|
|
99
112
|
Object.defineProperty(exports, "LiveAvatarAvatar", { enumerable: true, get: function () { return index_js_1.LiveAvatarAvatar; } });
|
|
100
113
|
Object.defineProperty(exports, "MAX_EXPIRY_SECONDS", { enumerable: true, get: function () { return index_js_1.MAX_EXPIRY_SECONDS; } });
|
|
114
|
+
Object.defineProperty(exports, "MicrosoftCNSTT", { enumerable: true, get: function () { return index_js_1.MicrosoftCNSTT; } });
|
|
115
|
+
Object.defineProperty(exports, "MicrosoftCNTTS", { enumerable: true, get: function () { return index_js_1.MicrosoftCNTTS; } });
|
|
101
116
|
Object.defineProperty(exports, "MicrosoftSTT", { enumerable: true, get: function () { return index_js_1.MicrosoftSTT; } });
|
|
102
117
|
Object.defineProperty(exports, "MicrosoftTTS", { enumerable: true, get: function () { return index_js_1.MicrosoftTTS; } });
|
|
118
|
+
Object.defineProperty(exports, "MiniMaxCNTTS", { enumerable: true, get: function () { return index_js_1.MiniMaxCNTTS; } });
|
|
103
119
|
Object.defineProperty(exports, "MiniMaxTTS", { enumerable: true, get: function () { return index_js_1.MiniMaxTTS; } });
|
|
104
120
|
Object.defineProperty(exports, "MllmTurnDetectionModeAgoraVad", { enumerable: true, get: function () { return index_js_1.MllmTurnDetectionModeAgoraVad; } });
|
|
105
121
|
Object.defineProperty(exports, "MllmTurnDetectionModeSemanticVad", { enumerable: true, get: function () { return index_js_1.MllmTurnDetectionModeSemanticVad; } });
|
|
@@ -117,6 +133,7 @@ Object.defineProperty(exports, "RimeTTS", { enumerable: true, get: function () {
|
|
|
117
133
|
Object.defineProperty(exports, "SalModeValues", { enumerable: true, get: function () { return index_js_1.SalModeValues; } });
|
|
118
134
|
Object.defineProperty(exports, "SarvamSTT", { enumerable: true, get: function () { return index_js_1.SarvamSTT; } });
|
|
119
135
|
Object.defineProperty(exports, "SarvamTTS", { enumerable: true, get: function () { return index_js_1.SarvamTTS; } });
|
|
136
|
+
Object.defineProperty(exports, "SensetimeAvatar", { enumerable: true, get: function () { return index_js_1.SensetimeAvatar; } });
|
|
120
137
|
Object.defineProperty(exports, "SilenceActionValues", { enumerable: true, get: function () { return index_js_1.SilenceActionValues; } });
|
|
121
138
|
Object.defineProperty(exports, "SpeakPriorityAppend", { enumerable: true, get: function () { return index_js_1.SpeakPriorityAppend; } });
|
|
122
139
|
Object.defineProperty(exports, "SpeakPriorityIgnore", { enumerable: true, get: function () { return index_js_1.SpeakPriorityIgnore; } });
|
|
@@ -124,6 +141,10 @@ Object.defineProperty(exports, "SpeakPriorityInterrupt", { enumerable: true, get
|
|
|
124
141
|
Object.defineProperty(exports, "SpeakPriorityValues", { enumerable: true, get: function () { return index_js_1.SpeakPriorityValues; } });
|
|
125
142
|
// STT vendors
|
|
126
143
|
Object.defineProperty(exports, "SpeechmaticsSTT", { enumerable: true, get: function () { return index_js_1.SpeechmaticsSTT; } });
|
|
144
|
+
Object.defineProperty(exports, "StepFunTTS", { enumerable: true, get: function () { return index_js_1.StepFunTTS; } });
|
|
145
|
+
Object.defineProperty(exports, "TencentLLM", { enumerable: true, get: function () { return index_js_1.TencentLLM; } });
|
|
146
|
+
Object.defineProperty(exports, "TencentSTT", { enumerable: true, get: function () { return index_js_1.TencentSTT; } });
|
|
147
|
+
Object.defineProperty(exports, "TencentTTS", { enumerable: true, get: function () { return index_js_1.TencentTTS; } });
|
|
127
148
|
Object.defineProperty(exports, "ThinkOnListeningActionIgnore", { enumerable: true, get: function () { return index_js_1.ThinkOnListeningActionIgnore; } });
|
|
128
149
|
Object.defineProperty(exports, "ThinkOnListeningActionInject", { enumerable: true, get: function () { return index_js_1.ThinkOnListeningActionInject; } });
|
|
129
150
|
Object.defineProperty(exports, "ThinkOnListeningActionInterrupt", { enumerable: true, get: function () { return index_js_1.ThinkOnListeningActionInterrupt; } });
|
|
@@ -138,6 +159,9 @@ Object.defineProperty(exports, "VertexAILLM", { enumerable: true, get: function
|
|
|
138
159
|
Object.defineProperty(exports, "validateAvatarConfig", { enumerable: true, get: function () { return index_js_1.validateAvatarConfig; } });
|
|
139
160
|
Object.defineProperty(exports, "validateTtsSampleRate", { enumerable: true, get: function () { return index_js_1.validateTtsSampleRate; } });
|
|
140
161
|
Object.defineProperty(exports, "XaiGrok", { enumerable: true, get: function () { return index_js_1.XaiGrok; } });
|
|
162
|
+
Object.defineProperty(exports, "XfyunBigModelSTT", { enumerable: true, get: function () { return index_js_1.XfyunBigModelSTT; } });
|
|
163
|
+
Object.defineProperty(exports, "XfyunDialectSTT", { enumerable: true, get: function () { return index_js_1.XfyunDialectSTT; } });
|
|
164
|
+
Object.defineProperty(exports, "XfyunSTT", { enumerable: true, get: function () { return index_js_1.XfyunSTT; } });
|
|
141
165
|
exports.Agora = __importStar(require("./api/index.js"));
|
|
142
166
|
var index_js_2 = require("./core/domain/index.js");
|
|
143
167
|
Object.defineProperty(exports, "Area", { enumerable: true, get: function () { return index_js_2.Area; } });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { AgoraArea } from "./agentkit/area.mjs";
|
|
1
2
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
2
3
|
import { AgoraClient as BaseAgoraClient } from "./Client.mjs";
|
|
3
|
-
import {
|
|
4
|
+
import { Pool } from "./core/domain/index.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* Auth mode for the client:
|
|
6
7
|
* - `basic`: Customer ID + Secret for REST API (HTTP Basic Auth)
|
|
@@ -10,10 +11,10 @@ import { type Area, Pool } from "./core/domain/index.mjs";
|
|
|
10
11
|
*/
|
|
11
12
|
export type AgoraAuthMode = "basic" | "token" | "app-credentials";
|
|
12
13
|
export declare namespace AgoraClient {
|
|
13
|
-
type Options = BaseOptions & AuthOptions;
|
|
14
|
-
interface BaseOptions extends Omit<BaseClientOptions, "baseUrl" | "environment" | "username" | "password" | "authorization"> {
|
|
14
|
+
type Options<TArea extends AgoraArea = AgoraArea> = BaseOptions<TArea> & AuthOptions;
|
|
15
|
+
interface BaseOptions<TArea extends AgoraArea = AgoraArea> extends Omit<BaseClientOptions, "baseUrl" | "environment" | "username" | "password" | "authorization"> {
|
|
15
16
|
/** The area to use for regional URL selection */
|
|
16
|
-
area:
|
|
17
|
+
area: TArea;
|
|
17
18
|
/** Agora App ID — used as the `appid` path parameter and for RTC token generation */
|
|
18
19
|
appId: string;
|
|
19
20
|
/** Agora App Certificate — used to sign RTC tokens. Keep this secret. */
|
|
@@ -81,7 +82,7 @@ export declare namespace AgoraClient {
|
|
|
81
82
|
* });
|
|
82
83
|
* ```
|
|
83
84
|
*/
|
|
84
|
-
export declare class AgoraClient extends BaseAgoraClient {
|
|
85
|
+
export declare class AgoraClient<TArea extends AgoraArea = AgoraArea> extends BaseAgoraClient {
|
|
85
86
|
protected readonly _pool: Pool;
|
|
86
87
|
/** Agora App ID */
|
|
87
88
|
readonly appId: string;
|
|
@@ -89,7 +90,9 @@ export declare class AgoraClient extends BaseAgoraClient {
|
|
|
89
90
|
readonly appCertificate: string;
|
|
90
91
|
/** The active authentication mode */
|
|
91
92
|
readonly authMode: AgoraAuthMode;
|
|
92
|
-
|
|
93
|
+
/** The configured routing area */
|
|
94
|
+
readonly area: TArea;
|
|
95
|
+
constructor(options: AgoraClient.Options<TArea>);
|
|
93
96
|
/**
|
|
94
97
|
* Get the underlying domain pool for advanced usage.
|
|
95
98
|
* You can use this to manually cycle regions or select the best domain.
|
|
@@ -102,6 +102,7 @@ export class AgoraClient extends BaseAgoraClient {
|
|
|
102
102
|
this.appId = options.appId;
|
|
103
103
|
this.appCertificate = options.appCertificate;
|
|
104
104
|
this.authMode = authMode;
|
|
105
|
+
this.area = options.area;
|
|
105
106
|
}
|
|
106
107
|
/**
|
|
107
108
|
* Get the underlying domain pool for advanced usage.
|
|
@@ -2,22 +2,25 @@
|
|
|
2
2
|
* Agent class - A reusable agent definition.
|
|
3
3
|
*
|
|
4
4
|
* This class represents an agent configuration that can be used to create
|
|
5
|
-
* multiple sessions.
|
|
5
|
+
* multiple sessions. Set the unique agent instance `name` in
|
|
6
|
+
* {@link Agent.createSession}, not on the Agent itself.
|
|
6
7
|
*/
|
|
8
|
+
import type { AgoraClient } from "../AgoraPoolClient.mjs";
|
|
7
9
|
import type * as Agora from "../api/index.mjs";
|
|
8
|
-
import type { AgoraClient } from "../Client.mjs";
|
|
9
10
|
import { AgentSession } from "./AgentSession.mjs";
|
|
11
|
+
import type { AgoraArea } from "./area.mjs";
|
|
12
|
+
import type { AvatarVendor, LlmVendor, SttVendor, TtsVendor } from "./region-vendors.mjs";
|
|
10
13
|
import type { AdvancedFeatures, AvatarConfig, FillerWordsConfig, GeofenceConfig, InterruptionConfig, Labels, LlmConfig, LlmGreetingConfigs, MllmConfig, ParametersAudioScenario, RtcConfig, SalConfig, SessionOptions, SessionParamsInput, SttConfig, TtsConfig, TurnDetectionConfig } from "./types.mjs";
|
|
11
|
-
import type {
|
|
14
|
+
import type { BaseMLLM } from "./vendors/base.mjs";
|
|
12
15
|
/**
|
|
13
16
|
* Configuration options for creating an Agent.
|
|
14
17
|
*
|
|
15
18
|
* Use the fluent builder methods (.withLlm(), .withTts(), .withStt(), .withMllm())
|
|
16
19
|
* to configure vendor settings after construction.
|
|
17
20
|
*/
|
|
18
|
-
export interface AgentOptions {
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
+
export interface AgentOptions<TArea extends AgoraArea = AgoraArea> {
|
|
22
|
+
/** Agora client bound to this agent. Required for `createSession()`. */
|
|
23
|
+
client: AgoraClient<TArea>;
|
|
21
24
|
/**
|
|
22
25
|
* Published AI Studio pipeline ID to use as this agent's base configuration.
|
|
23
26
|
* Explicit Agent config such as .withLlm(), .withTts(), .withStt(),
|
|
@@ -81,14 +84,21 @@ export interface AgentOptions {
|
|
|
81
84
|
* import { Agent, OpenAI, MicrosoftTTS, DeepgramSTT } from 'agora-agents';
|
|
82
85
|
*
|
|
83
86
|
* // Use the fluent builder pattern to configure vendors
|
|
84
|
-
* const agent = new Agent({ instructions: 'You are helpful.' })
|
|
87
|
+
* const agent = new Agent({ client, instructions: 'You are helpful.' })
|
|
85
88
|
* .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4', url: 'https://api.openai.com/v1/chat/completions' }))
|
|
86
89
|
* .withTts(new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', baseUrl: 'wss://api.elevenlabs.io/v1', sampleRate: 24000 }))
|
|
87
90
|
* .withStt(new DeepgramSTT({ apiKey: '...', model: 'nova-2' }));
|
|
91
|
+
*
|
|
92
|
+
* const session = agent.createSession({
|
|
93
|
+
* name: `conversation-${Date.now()}`,
|
|
94
|
+
* channel: `demo-channel-${Date.now()}`,
|
|
95
|
+
* agentUid: '1',
|
|
96
|
+
* remoteUids: ['100'],
|
|
97
|
+
* });
|
|
88
98
|
* ```
|
|
89
99
|
*/
|
|
90
|
-
export declare class Agent<TTSSampleRate extends number = number> {
|
|
91
|
-
private
|
|
100
|
+
export declare class Agent<TTSSampleRate extends number = number, TArea extends AgoraArea = AgoraArea> {
|
|
101
|
+
private _client;
|
|
92
102
|
private _pipelineId?;
|
|
93
103
|
private _llm?;
|
|
94
104
|
private _tts?;
|
|
@@ -109,13 +119,13 @@ export declare class Agent<TTSSampleRate extends number = number> {
|
|
|
109
119
|
private _rtc?;
|
|
110
120
|
private _fillerWords?;
|
|
111
121
|
private _greetingConfigs?;
|
|
112
|
-
constructor(options
|
|
122
|
+
constructor(options: AgentOptions<TArea>);
|
|
113
123
|
/**
|
|
114
124
|
* Returns a new Agent with the specified LLM vendor.
|
|
115
125
|
*
|
|
116
126
|
* @param vendor - LLM vendor instance (e.g., new OpenAI({ apiKey: '...', model: 'gpt-4', url: 'https://api.openai.com/v1/chat/completions' }))
|
|
117
127
|
*/
|
|
118
|
-
withLlm(vendor:
|
|
128
|
+
withLlm(vendor: LlmVendor): Agent<TTSSampleRate, TArea>;
|
|
119
129
|
/**
|
|
120
130
|
* Returns a new Agent with the specified TTS vendor.
|
|
121
131
|
*
|
|
@@ -125,7 +135,7 @@ export declare class Agent<TTSSampleRate extends number = number> {
|
|
|
125
135
|
* @param vendor - TTS vendor instance (e.g., new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', baseUrl: 'wss://api.elevenlabs.io/v1', sampleRate: 24000 }))
|
|
126
136
|
* @returns Agent with tracked sample rate type
|
|
127
137
|
*/
|
|
128
|
-
withTts<SR extends number>(vendor:
|
|
138
|
+
withTts<SR extends number>(vendor: TtsVendor<SR>): Agent<SR, TArea>;
|
|
129
139
|
/**
|
|
130
140
|
* Returns a new Agent with the specified STT vendor.
|
|
131
141
|
*
|
|
@@ -141,7 +151,7 @@ export declare class Agent<TTSSampleRate extends number = number> {
|
|
|
141
151
|
* }));
|
|
142
152
|
* ```
|
|
143
153
|
*/
|
|
144
|
-
withStt(vendor:
|
|
154
|
+
withStt(vendor: SttVendor): Agent<TTSSampleRate, TArea>;
|
|
145
155
|
/**
|
|
146
156
|
* Returns a new Agent with the specified MLLM vendor.
|
|
147
157
|
*
|
|
@@ -156,7 +166,7 @@ export declare class Agent<TTSSampleRate extends number = number> {
|
|
|
156
166
|
*
|
|
157
167
|
* @param vendor - MLLM vendor instance (e.g., new VertexAI({ model: '...', projectId: '...', ... }))
|
|
158
168
|
*/
|
|
159
|
-
withMllm(vendor: BaseMLLM): Agent<TTSSampleRate>;
|
|
169
|
+
withMllm(vendor: BaseMLLM): Agent<TTSSampleRate, TArea>;
|
|
160
170
|
/**
|
|
161
171
|
* Returns a new Agent with the specified Avatar vendor.
|
|
162
172
|
*
|
|
@@ -180,7 +190,8 @@ export declare class Agent<TTSSampleRate extends number = number> {
|
|
|
180
190
|
* ```typescript
|
|
181
191
|
* import { HeyGenAvatar, ElevenLabsTTS } from 'agora-agents';
|
|
182
192
|
*
|
|
183
|
-
* const
|
|
193
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
194
|
+
* const agent = new Agent({ client })
|
|
184
195
|
* .withTts(new ElevenLabsTTS({
|
|
185
196
|
* key: '...',
|
|
186
197
|
* modelId: '...',
|
|
@@ -195,27 +206,27 @@ export declare class Agent<TTSSampleRate extends number = number> {
|
|
|
195
206
|
* }));
|
|
196
207
|
* ```
|
|
197
208
|
*/
|
|
198
|
-
withAvatar<RequiredSR extends number>(this: Agent<RequiredSR>, vendor:
|
|
209
|
+
withAvatar<RequiredSR extends number>(this: Agent<RequiredSR, TArea>, vendor: AvatarVendor<RequiredSR>): Agent<RequiredSR, TArea>;
|
|
199
210
|
/**
|
|
200
211
|
* Returns a new Agent with the specified turn detection configuration.
|
|
201
212
|
*/
|
|
202
|
-
withTurnDetection(config: TurnDetectionConfig): Agent<TTSSampleRate>;
|
|
213
|
+
withTurnDetection(config: TurnDetectionConfig): Agent<TTSSampleRate, TArea>;
|
|
203
214
|
/**
|
|
204
215
|
* Returns a new Agent with unified interruption control configured.
|
|
205
216
|
*/
|
|
206
|
-
withInterruption(config: InterruptionConfig): Agent<TTSSampleRate>;
|
|
217
|
+
withInterruption(config: InterruptionConfig): Agent<TTSSampleRate, TArea>;
|
|
207
218
|
/**
|
|
208
219
|
* Returns a new Agent with the specified instructions.
|
|
209
220
|
*
|
|
210
221
|
* @deprecated Configure system messages on the LLM vendor instead.
|
|
211
222
|
*/
|
|
212
|
-
withInstructions(instructions: string): Agent<TTSSampleRate>;
|
|
223
|
+
withInstructions(instructions: string): Agent<TTSSampleRate, TArea>;
|
|
213
224
|
/**
|
|
214
225
|
* Returns a new Agent with the specified greeting message.
|
|
215
226
|
*
|
|
216
227
|
* @deprecated Configure the greeting on the LLM or MLLM vendor instead.
|
|
217
228
|
*/
|
|
218
|
-
withGreeting(greeting: string): Agent<TTSSampleRate>;
|
|
229
|
+
withGreeting(greeting: string): Agent<TTSSampleRate, TArea>;
|
|
219
230
|
/**
|
|
220
231
|
* Returns a new Agent with the specified greeting playback configuration.
|
|
221
232
|
*
|
|
@@ -224,35 +235,31 @@ export declare class Agent<TTSSampleRate extends number = number> {
|
|
|
224
235
|
*
|
|
225
236
|
* @deprecated Configure greeting playback on the LLM vendor instead.
|
|
226
237
|
*/
|
|
227
|
-
withGreetingConfigs(configs: LlmGreetingConfigs): Agent<TTSSampleRate>;
|
|
228
|
-
/**
|
|
229
|
-
* Returns a new Agent with the specified name.
|
|
230
|
-
*/
|
|
231
|
-
withName(name: string): Agent<TTSSampleRate>;
|
|
238
|
+
withGreetingConfigs(configs: LlmGreetingConfigs): Agent<TTSSampleRate, TArea>;
|
|
232
239
|
/**
|
|
233
240
|
* Returns a new Agent with the specified SAL (Selective Attention Locking) configuration.
|
|
234
241
|
*/
|
|
235
|
-
withSal(config: SalConfig): Agent<TTSSampleRate>;
|
|
242
|
+
withSal(config: SalConfig): Agent<TTSSampleRate, TArea>;
|
|
236
243
|
/**
|
|
237
244
|
* Returns a new Agent with the specified advanced features configuration.
|
|
238
245
|
*
|
|
239
246
|
* Use this to enable features like RTM and others.
|
|
240
247
|
*/
|
|
241
|
-
withAdvancedFeatures(features: AdvancedFeatures): Agent<TTSSampleRate>;
|
|
248
|
+
withAdvancedFeatures(features: AdvancedFeatures): Agent<TTSSampleRate, TArea>;
|
|
242
249
|
/**
|
|
243
250
|
* Returns a new Agent with MCP tool invocation enabled or disabled.
|
|
244
251
|
*/
|
|
245
|
-
withTools(enabled?: boolean): Agent<TTSSampleRate>;
|
|
252
|
+
withTools(enabled?: boolean): Agent<TTSSampleRate, TArea>;
|
|
246
253
|
/**
|
|
247
254
|
* Returns a new Agent with the specified session parameters.
|
|
248
255
|
*
|
|
249
256
|
* Use this to configure silence behaviour, graceful hang-up, data channel, and more.
|
|
250
257
|
*/
|
|
251
|
-
withParameters(parameters: SessionParamsInput): Agent<TTSSampleRate>;
|
|
258
|
+
withParameters(parameters: SessionParamsInput): Agent<TTSSampleRate, TArea>;
|
|
252
259
|
/**
|
|
253
260
|
* Returns a new Agent with the specified RTC audio scenario.
|
|
254
261
|
*/
|
|
255
|
-
withAudioScenario(audioScenario: ParametersAudioScenario): Agent<TTSSampleRate>;
|
|
262
|
+
withAudioScenario(audioScenario: ParametersAudioScenario): Agent<TTSSampleRate, TArea>;
|
|
256
263
|
/**
|
|
257
264
|
* Returns a new Agent with the specified failure message.
|
|
258
265
|
*
|
|
@@ -260,40 +267,36 @@ export declare class Agent<TTSSampleRate extends number = number> {
|
|
|
260
267
|
*
|
|
261
268
|
* @deprecated Configure the failure message on the LLM or MLLM vendor instead.
|
|
262
269
|
*/
|
|
263
|
-
withFailureMessage(message: string): Agent<TTSSampleRate>;
|
|
270
|
+
withFailureMessage(message: string): Agent<TTSSampleRate, TArea>;
|
|
264
271
|
/**
|
|
265
272
|
* Returns a new Agent with the specified maximum conversation history length.
|
|
266
273
|
* Applies to the standard LLM pipeline only; the v2.7 MLLM core schema has no max_history field.
|
|
267
274
|
*
|
|
268
275
|
* @deprecated Configure max history on the LLM vendor instead.
|
|
269
276
|
*/
|
|
270
|
-
withMaxHistory(maxHistory: number): Agent<TTSSampleRate>;
|
|
277
|
+
withMaxHistory(maxHistory: number): Agent<TTSSampleRate, TArea>;
|
|
271
278
|
/**
|
|
272
279
|
* Returns a new Agent with the specified geofence configuration.
|
|
273
280
|
*
|
|
274
281
|
* Restricts which geographic regions the agent's backend servers may run in.
|
|
275
282
|
*/
|
|
276
|
-
withGeofence(geofence: GeofenceConfig): Agent<TTSSampleRate>;
|
|
283
|
+
withGeofence(geofence: GeofenceConfig): Agent<TTSSampleRate, TArea>;
|
|
277
284
|
/**
|
|
278
285
|
* Returns a new Agent with the specified custom labels.
|
|
279
286
|
*
|
|
280
287
|
* Labels are key-value pairs attached to the agent and returned in notification callbacks.
|
|
281
288
|
*/
|
|
282
|
-
withLabels(labels: Labels): Agent<TTSSampleRate>;
|
|
289
|
+
withLabels(labels: Labels): Agent<TTSSampleRate, TArea>;
|
|
283
290
|
/**
|
|
284
291
|
* Returns a new Agent with the specified RTC configuration.
|
|
285
292
|
*/
|
|
286
|
-
withRtc(rtc: RtcConfig): Agent<TTSSampleRate>;
|
|
293
|
+
withRtc(rtc: RtcConfig): Agent<TTSSampleRate, TArea>;
|
|
287
294
|
/**
|
|
288
295
|
* Returns a new Agent with the specified filler words configuration.
|
|
289
296
|
*
|
|
290
297
|
* Filler words are played while the agent waits for the LLM to respond.
|
|
291
298
|
*/
|
|
292
|
-
withFillerWords(fillerWords: FillerWordsConfig): Agent<TTSSampleRate>;
|
|
293
|
-
/**
|
|
294
|
-
* Get the agent name.
|
|
295
|
-
*/
|
|
296
|
-
get name(): string | undefined;
|
|
299
|
+
withFillerWords(fillerWords: FillerWordsConfig): Agent<TTSSampleRate, TArea>;
|
|
297
300
|
/**
|
|
298
301
|
* Get the AI Studio pipeline ID used as this agent's base configuration.
|
|
299
302
|
*/
|
|
@@ -388,18 +391,19 @@ export declare class Agent<TTSSampleRate extends number = number> {
|
|
|
388
391
|
/**
|
|
389
392
|
* Creates a new session from this agent configuration.
|
|
390
393
|
*
|
|
391
|
-
* @param client - The Agora client instance (must have appId and appCertificate properties)
|
|
392
394
|
* @param options - Session connection options
|
|
393
395
|
* @returns A new AgentSession instance ready to start
|
|
394
396
|
*
|
|
395
397
|
* @example
|
|
396
398
|
* ```typescript
|
|
397
|
-
* const
|
|
398
|
-
*
|
|
399
|
-
* .
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
399
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
400
|
+
* const agent = new Agent({ client })
|
|
401
|
+
* .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4o-mini', url: 'https://api.openai.com/v1/chat/completions' }))
|
|
402
|
+
* .withTts(new MiniMaxTTS({ model: 'speech_2_6_turbo', voiceId: 'English_captivating_female1' }));
|
|
403
|
+
*
|
|
404
|
+
* const session = agent.createSession({
|
|
405
|
+
* name: `conversation-${Date.now()}`,
|
|
406
|
+
* channel: `demo-channel-${Date.now()}`,
|
|
403
407
|
* agentUid: '1',
|
|
404
408
|
* remoteUids: ['100'],
|
|
405
409
|
* idleTimeout: 120,
|
|
@@ -408,10 +412,7 @@ export declare class Agent<TTSSampleRate extends number = number> {
|
|
|
408
412
|
* const agentId = await session.start();
|
|
409
413
|
* ```
|
|
410
414
|
*/
|
|
411
|
-
createSession(
|
|
412
|
-
readonly appId: string;
|
|
413
|
-
readonly appCertificate?: string;
|
|
414
|
-
}, options: SessionOptions): AgentSession;
|
|
415
|
+
createSession(options: SessionOptions): AgentSession;
|
|
415
416
|
/**
|
|
416
417
|
* Converts the Agent configuration to the Fern request properties format.
|
|
417
418
|
*
|