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/BaseClient.js
CHANGED
|
@@ -41,8 +41,8 @@ function normalizeClientOptions(options) {
|
|
|
41
41
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
42
42
|
"X-Fern-Language": "JavaScript",
|
|
43
43
|
"X-Fern-SDK-Name": "agora-agents",
|
|
44
|
-
"X-Fern-SDK-Version": "v2.
|
|
45
|
-
"User-Agent": "agora-agents/v2.
|
|
44
|
+
"X-Fern-SDK-Version": "v2.5.0",
|
|
45
|
+
"User-Agent": "agora-agents/v2.5.0",
|
|
46
46
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
47
47
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
48
48
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/cjs/Client.js
CHANGED
|
@@ -12,28 +12,20 @@ class AgoraClient {
|
|
|
12
12
|
this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
|
|
13
13
|
}
|
|
14
14
|
get agents() {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
return this._agents;
|
|
15
|
+
var _a;
|
|
16
|
+
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Client_js_2.AgentsClient(this._options)));
|
|
19
17
|
}
|
|
20
18
|
get agentManagement() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return this._agentManagement;
|
|
19
|
+
var _a;
|
|
20
|
+
return ((_a = this._agentManagement) !== null && _a !== void 0 ? _a : (this._agentManagement = new Client_js_1.AgentManagementClient(this._options)));
|
|
25
21
|
}
|
|
26
22
|
get telephony() {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
return this._telephony;
|
|
23
|
+
var _a;
|
|
24
|
+
return ((_a = this._telephony) !== null && _a !== void 0 ? _a : (this._telephony = new Client_js_4.TelephonyClient(this._options)));
|
|
31
25
|
}
|
|
32
26
|
get phoneNumbers() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
return this._phoneNumbers;
|
|
27
|
+
var _a;
|
|
28
|
+
return ((_a = this._phoneNumbers) !== null && _a !== void 0 ? _a : (this._phoneNumbers = new Client_js_3.PhoneNumbersClient(this._options)));
|
|
37
29
|
}
|
|
38
30
|
}
|
|
39
31
|
exports.AgoraClient = AgoraClient;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.Agent = void 0;
|
|
11
|
+
const index_js_1 = require("../core/domain/index.js");
|
|
11
12
|
const AgentSession_js_1 = require("./AgentSession.js");
|
|
12
13
|
const constants_js_1 = require("./constants.js");
|
|
13
14
|
const token_js_1 = require("./token.js");
|
|
@@ -717,11 +718,11 @@ class Agent {
|
|
|
717
718
|
return newAgent;
|
|
718
719
|
}
|
|
719
720
|
_resolveAsrConfig(turnDetectionConfig) {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
721
|
+
const asrConfig = this._stt !== undefined
|
|
722
|
+
? Object.assign({}, this._stt)
|
|
723
|
+
: {
|
|
724
|
+
vendor: this._client.area === index_js_1.Area.CN ? "fengming" : "ares",
|
|
725
|
+
};
|
|
725
726
|
asrConfig.language = turnDetectionConfig.language;
|
|
726
727
|
return Object.keys(asrConfig).length > 0 ? asrConfig : undefined;
|
|
727
728
|
}
|
|
@@ -195,6 +195,7 @@ class AgentSession {
|
|
|
195
195
|
if ((0, avatar_types_js_1.isHeyGenAvatar)(strictAvatar) ||
|
|
196
196
|
(0, avatar_types_js_1.isLiveAvatarAvatar)(strictAvatar) ||
|
|
197
197
|
(0, avatar_types_js_1.isSensetimeAvatar)(strictAvatar) ||
|
|
198
|
+
(0, avatar_types_js_1.isSpatiusAvatar)(strictAvatar) ||
|
|
198
199
|
(0, avatar_types_js_1.isAkoolAvatar)(strictAvatar) ||
|
|
199
200
|
(0, avatar_types_js_1.isAnamAvatar)(strictAvatar) ||
|
|
200
201
|
(0, avatar_types_js_1.isGenericAvatar)(strictAvatar)) {
|
|
@@ -282,6 +283,7 @@ class AgentSession {
|
|
|
282
283
|
if ((0, avatar_types_js_1.isHeyGenAvatar)(strictAvatar) ||
|
|
283
284
|
(0, avatar_types_js_1.isLiveAvatarAvatar)(strictAvatar) ||
|
|
284
285
|
(0, avatar_types_js_1.isSensetimeAvatar)(strictAvatar) ||
|
|
286
|
+
(0, avatar_types_js_1.isSpatiusAvatar)(strictAvatar) ||
|
|
285
287
|
(0, avatar_types_js_1.isAkoolAvatar)(strictAvatar) ||
|
|
286
288
|
(0, avatar_types_js_1.isAnamAvatar)(strictAvatar) ||
|
|
287
289
|
(0, avatar_types_js_1.isGenericAvatar)(strictAvatar)) {
|
|
@@ -26,6 +26,8 @@ new Agent_js_1.Agent({ client, turnDetection: { language: "en-US" } })
|
|
|
26
26
|
new Agent_js_1.Agent({ client }).withStt(new cn_js_1.FengmingSTT());
|
|
27
27
|
new Agent_js_1.Agent({ client }).withLlm(new cn_js_1.AliyunLLM({ url: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", model: "qwen-plus" }));
|
|
28
28
|
new Agent_js_1.Agent({ client }).withTts(new cn_js_1.MiniMaxCNTTS({ key: "minimax-key", model: "speech-01-turbo", voiceSetting: { voice_id: "female-shaonv" } }));
|
|
29
|
+
const globalGenericTts = new tts_js_1.GenericTTS({ url: "https://tts.example.com/v1/audio/speech" });
|
|
30
|
+
new Agent_js_1.Agent({ client }).withTts(globalGenericTts);
|
|
29
31
|
{
|
|
30
32
|
const client = new AgoraPoolClient_js_1.AgoraClient({
|
|
31
33
|
area: index_js_1.Area.CN,
|
|
@@ -53,5 +55,7 @@ new Agent_js_1.Agent({ client }).withTts(new cn_js_1.MiniMaxCNTTS({ key: "minima
|
|
|
53
55
|
new Agent_js_1.Agent({ client }).withStt(new stt_js_1.DeepgramSTT({ model: "nova-3", language: "en-US" }));
|
|
54
56
|
new Agent_js_1.Agent({ client }).withLlm(new llm_js_1.OpenAI({ model: "gpt-5-mini" }));
|
|
55
57
|
new Agent_js_1.Agent({ client }).withTts(new tts_js_1.MiniMaxTTS({ model: "speech-2.6-turbo", voiceId: "English_captivating_female1" }));
|
|
58
|
+
const cnGenericTts = new tts_js_1.GenericTTS({ url: "https://tts.example.cn/v1/audio/speech" });
|
|
59
|
+
new Agent_js_1.Agent({ client }).withTts(cnGenericTts);
|
|
56
60
|
}
|
|
57
61
|
new Agent_js_1.Agent({ client }).withStt(new stt_js_1.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.js";
|
|
8
|
+
import type { SpatiusAvatarParams } from "../api/types/SpatiusAvatarParams.js";
|
|
8
9
|
import type { AvatarConfig as BaseAvatarConfig } from "./types.js";
|
|
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).
|
|
@@ -12,6 +12,7 @@ exports.isAkoolAvatar = isAkoolAvatar;
|
|
|
12
12
|
exports.isAnamAvatar = isAnamAvatar;
|
|
13
13
|
exports.isGenericAvatar = isGenericAvatar;
|
|
14
14
|
exports.isSensetimeAvatar = isSensetimeAvatar;
|
|
15
|
+
exports.isSpatiusAvatar = isSpatiusAvatar;
|
|
15
16
|
exports.isAvatarTokenManaged = isAvatarTokenManaged;
|
|
16
17
|
exports.validateAvatarConfig = validateAvatarConfig;
|
|
17
18
|
exports.validateTtsSampleRate = validateTtsSampleRate;
|
|
@@ -52,6 +53,12 @@ function isGenericAvatar(config) {
|
|
|
52
53
|
function isSensetimeAvatar(config) {
|
|
53
54
|
return config.vendor === "sensetime";
|
|
54
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Helper type guard to check if an avatar config is for Spatius.
|
|
58
|
+
*/
|
|
59
|
+
function isSpatiusAvatar(config) {
|
|
60
|
+
return config.vendor === "spatius";
|
|
61
|
+
}
|
|
55
62
|
/**
|
|
56
63
|
* Returns true when AgentKit manages the avatar's RTC publisher identity
|
|
57
64
|
* (i.e. fills `agora_token`, validates uniqueness against the agent UID).
|
|
@@ -59,7 +66,11 @@ function isSensetimeAvatar(config) {
|
|
|
59
66
|
* Mirrors the Go and Python SDK gate so all language SDKs behave identically.
|
|
60
67
|
*/
|
|
61
68
|
function isAvatarTokenManaged(config) {
|
|
62
|
-
return isHeyGenAvatar(config) ||
|
|
69
|
+
return (isHeyGenAvatar(config) ||
|
|
70
|
+
isLiveAvatarAvatar(config) ||
|
|
71
|
+
isGenericAvatar(config) ||
|
|
72
|
+
isSensetimeAvatar(config) ||
|
|
73
|
+
isSpatiusAvatar(config));
|
|
63
74
|
}
|
|
64
75
|
/**
|
|
65
76
|
* Validates avatar configuration at runtime.
|
|
@@ -134,8 +145,25 @@ function validateAvatarConfig(config, options = {}) {
|
|
|
134
145
|
if (!config.params.app_key) {
|
|
135
146
|
throw new Error("SenseTime avatar requires app_key");
|
|
136
147
|
}
|
|
137
|
-
if (
|
|
138
|
-
throw new Error("SenseTime avatar
|
|
148
|
+
if (config.params.sceneList !== undefined && !Array.isArray(config.params.sceneList)) {
|
|
149
|
+
throw new Error("SenseTime avatar sceneList must be an array when provided");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else if (isSpatiusAvatar(config)) {
|
|
153
|
+
if (!config.params.agora_uid) {
|
|
154
|
+
throw new Error("Spatius avatar requires agora_uid");
|
|
155
|
+
}
|
|
156
|
+
if (!config.params.spatius_api_key) {
|
|
157
|
+
throw new Error("Spatius avatar requires spatius_api_key");
|
|
158
|
+
}
|
|
159
|
+
if (!config.params.spatius_app_id) {
|
|
160
|
+
throw new Error("Spatius avatar requires spatius_app_id");
|
|
161
|
+
}
|
|
162
|
+
if (!config.params.spatius_avatar_id) {
|
|
163
|
+
throw new Error("Spatius avatar requires spatius_avatar_id");
|
|
164
|
+
}
|
|
165
|
+
if (options.requireSessionFields && !config.params.agora_token) {
|
|
166
|
+
throw new Error("Spatius avatar requires agora_token after session enrichment");
|
|
139
167
|
}
|
|
140
168
|
}
|
|
141
169
|
}
|
|
@@ -6,6 +6,12 @@ import { AgentThinkAgentManagementRequest as AgentThinkRequestNS } from "../api/
|
|
|
6
6
|
import { SpeakAgentsRequest as SpeakAgentsRequestNS } from "../api/resources/agents/client/requests/SpeakAgentsRequest.js";
|
|
7
7
|
import { StartAgentsRequest as StartAgentsRequestNS } from "../api/resources/agents/client/requests/StartAgentsRequest.js";
|
|
8
8
|
import { MllmTurnDetection as MllmTurnDetectionNS } from "../api/types/MllmTurnDetection.js";
|
|
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"` */
|
|
@@ -4,12 +4,17 @@
|
|
|
4
4
|
* Use these instead of raw strings to avoid typos and get IDE autocomplete.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnListeningActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeAgoraVad = exports.MllmTurnDetectionModeValues = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SpeakPriorityInterrupt = exports.SpeakPriorityValues = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.InterruptionModeKeywords = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeValues = exports.TurnDetectionTypeValues = exports.FillerWordsSelectionRule = exports.Geofence = exports.SalModeValues = exports.SilenceActionValues = exports.AudioScenario = exports.DataChannel = void 0;
|
|
7
|
+
exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnListeningActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeAgoraVad = exports.MllmTurnDetectionModeValues = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SpeakPriorityInterrupt = exports.SpeakPriorityValues = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.InterruptionModeKeywords = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeValues = exports.TurnDetectionTypeValues = exports.FillerWordsSelectionRule = exports.Geofence = exports.SalModeValues = exports.SilenceActionValues = exports.AudioScenario = exports.DataChannel = exports.CredentialMode = void 0;
|
|
8
8
|
// Import namespace as value from source (api index uses export type)
|
|
9
9
|
const AgentThinkAgentManagementRequest_js_1 = require("../api/resources/agentManagement/client/requests/AgentThinkAgentManagementRequest.js");
|
|
10
10
|
const SpeakAgentsRequest_js_1 = require("../api/resources/agents/client/requests/SpeakAgentsRequest.js");
|
|
11
11
|
const StartAgentsRequest_js_1 = require("../api/resources/agents/client/requests/StartAgentsRequest.js");
|
|
12
12
|
const MllmTurnDetection_js_1 = require("../api/types/MllmTurnDetection.js");
|
|
13
|
+
/** Credential source for vendors that support Agora-managed credentials and BYOK. */
|
|
14
|
+
exports.CredentialMode = {
|
|
15
|
+
Managed: "managed",
|
|
16
|
+
Byok: "byok",
|
|
17
|
+
};
|
|
13
18
|
/** Data channel: `"rtm"` | `"datastream"` */
|
|
14
19
|
exports.DataChannel = StartAgentsRequest_js_1.StartAgentsRequest.Properties.Parameters.DataChannel;
|
|
15
20
|
/** RTC audio scenario: `"default"` | `"chorus"` | `"aiserver"` */
|
|
@@ -23,26 +23,26 @@ export type { AgentOptions } from "./Agent.js";
|
|
|
23
23
|
export { Agent } from "./Agent.js";
|
|
24
24
|
export type { AgentSessionEvent, AgentSessionEventHandler, AgentSessionOptions, } from "./AgentSession.js";
|
|
25
25
|
export { AgentSession } from "./AgentSession.js";
|
|
26
|
-
export type { AkoolAvatarConfig, AnamAvatarConfig, GenericAvatarConfig, HeyGenAvatarConfig, LiveAvatarAvatarConfig, SensetimeAvatarConfig, StrictAvatarConfig, } from "./avatar-types.js";
|
|
27
|
-
export { isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, toBaseAvatarConfig, validateAvatarConfig, validateTtsSampleRate, } from "./avatar-types.js";
|
|
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.js";
|
|
26
|
+
export type { AkoolAvatarConfig, AnamAvatarConfig, GenericAvatarConfig, HeyGenAvatarConfig, LiveAvatarAvatarConfig, SensetimeAvatarConfig, SpatiusAvatarConfig, StrictAvatarConfig, } from "./avatar-types.js";
|
|
27
|
+
export { isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, toBaseAvatarConfig, validateAvatarConfig, validateTtsSampleRate, } from "./avatar-types.js";
|
|
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.js";
|
|
29
29
|
export type { AgentPreset, AsrPreset, DeepgramPresetModel, LlmPreset, MiniMaxPresetModel, OpenAIPresetModel, OpenAITtsPresetModel, PresetCategory, PresetInput, TtsPreset, } from "./presets.js";
|
|
30
30
|
export { AgentPresets, normalizePresetInput } from "./presets.js";
|
|
31
31
|
export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.js";
|
|
32
32
|
export type { GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.js";
|
|
33
33
|
export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.js";
|
|
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.js";
|
|
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.js";
|
|
35
35
|
export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LiveAvatarAvatarOptions, } from "./vendors/avatar.js";
|
|
36
36
|
export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LiveAvatarAvatar, } from "./vendors/avatar.js";
|
|
37
37
|
export type { AkoolSampleRate, CartesiaSampleRate, ElevenLabsSampleRate, HeyGenSampleRate, LiveAvatarSampleRate, MicrosoftSampleRate, SampleRate, } from "./vendors/base.js";
|
|
38
38
|
export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, BaseLLM, type BaseLlmOptions, BaseMLLM, BaseSTT, BaseTTS, type GoogleTTSSampleRate, } from "./vendors/base.js";
|
|
39
|
-
export type { AliyunLLMOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CosyVoiceTTSOptions, DeepSeekLLMOptions, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MiniMaxCNTTSOptions, SensetimeAvatarOptions, StepFunTTSOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./vendors/cn.js";
|
|
40
|
-
export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS, DeepSeekLLM, FengmingSTT, MicrosoftCNSTT, MicrosoftCNTTS, MiniMaxCNTTS, SensetimeAvatar, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./vendors/cn.js";
|
|
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.js";
|
|
40
|
+
export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS, DeepSeekLLM, FengmingSTT, MicrosoftCNSTT, MicrosoftCNTTS, MiniMaxCNTTS, SensetimeAvatar, SpatiusAvatar, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./vendors/cn.js";
|
|
41
41
|
export type { AmazonBedrockOptions, AnthropicOptions, AzureOpenAIOptions, CustomLLMOptions, DifyOptions, GeminiOptions, GroqOptions, OpenAIOptions, VertexAILLMOptions, } from "./vendors/llm.js";
|
|
42
42
|
export { AmazonBedrock, Anthropic, AzureOpenAI, CustomLLM, Dify, Gemini, Groq, OpenAI, VertexAILLM, } from "./vendors/llm.js";
|
|
43
43
|
export type { GeminiLiveOptions, OpenAIRealtimeOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.js";
|
|
44
44
|
export { GeminiLive, OpenAIRealtime, VertexAI, XaiGrok, } from "./vendors/mllm.js";
|
|
45
|
-
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SpeechmaticsSTTOptions, } from "./vendors/stt.js";
|
|
46
|
-
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, } from "./vendors/stt.js";
|
|
47
|
-
export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GoogleTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, } from "./vendors/tts.js";
|
|
48
|
-
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GoogleTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, } from "./vendors/tts.js";
|
|
45
|
+
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
|
|
46
|
+
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.js";
|
|
47
|
+
export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
|
|
48
|
+
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, XAiTTS, } from "./vendors/tts.js";
|
|
@@ -20,9 +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.
|
|
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;
|
|
23
|
+
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.CredentialMode = exports.AudioScenario = exports.validateTtsSampleRate = exports.validateAvatarConfig = exports.toBaseAvatarConfig = exports.isSpatiusAvatar = exports.isSensetimeAvatar = exports.isLiveAvatarAvatar = exports.isHeyGenAvatar = exports.isGenericAvatar = exports.isAvatarTokenManaged = exports.isAnamAvatar = exports.isAkoolAvatar = exports.AgentSession = exports.Agent = void 0;
|
|
24
|
+
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.SpatiusAvatar = 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 = exports.HeyGenAvatar = exports.GenericAvatar = void 0;
|
|
25
|
+
exports.XAiTTS = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MistralTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GradiumTTS = exports.GoogleTTS = exports.GenericTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SarvamSTT = exports.OpenAISTT = void 0;
|
|
26
26
|
// Core classes
|
|
27
27
|
var Agent_js_1 = require("./Agent.js");
|
|
28
28
|
Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return Agent_js_1.Agent; } });
|
|
@@ -36,12 +36,14 @@ Object.defineProperty(exports, "isGenericAvatar", { enumerable: true, get: funct
|
|
|
36
36
|
Object.defineProperty(exports, "isHeyGenAvatar", { enumerable: true, get: function () { return avatar_types_js_1.isHeyGenAvatar; } });
|
|
37
37
|
Object.defineProperty(exports, "isLiveAvatarAvatar", { enumerable: true, get: function () { return avatar_types_js_1.isLiveAvatarAvatar; } });
|
|
38
38
|
Object.defineProperty(exports, "isSensetimeAvatar", { enumerable: true, get: function () { return avatar_types_js_1.isSensetimeAvatar; } });
|
|
39
|
+
Object.defineProperty(exports, "isSpatiusAvatar", { enumerable: true, get: function () { return avatar_types_js_1.isSpatiusAvatar; } });
|
|
39
40
|
Object.defineProperty(exports, "toBaseAvatarConfig", { enumerable: true, get: function () { return avatar_types_js_1.toBaseAvatarConfig; } });
|
|
40
41
|
Object.defineProperty(exports, "validateAvatarConfig", { enumerable: true, get: function () { return avatar_types_js_1.validateAvatarConfig; } });
|
|
41
42
|
Object.defineProperty(exports, "validateTtsSampleRate", { enumerable: true, get: function () { return avatar_types_js_1.validateTtsSampleRate; } });
|
|
42
43
|
// Type-safe constants
|
|
43
44
|
var constants_js_1 = require("./constants.js");
|
|
44
45
|
Object.defineProperty(exports, "AudioScenario", { enumerable: true, get: function () { return constants_js_1.AudioScenario; } });
|
|
46
|
+
Object.defineProperty(exports, "CredentialMode", { enumerable: true, get: function () { return constants_js_1.CredentialMode; } });
|
|
45
47
|
Object.defineProperty(exports, "DataChannel", { enumerable: true, get: function () { return constants_js_1.DataChannel; } });
|
|
46
48
|
Object.defineProperty(exports, "FillerWordsSelectionRule", { enumerable: true, get: function () { return constants_js_1.FillerWordsSelectionRule; } });
|
|
47
49
|
Object.defineProperty(exports, "Geofence", { enumerable: true, get: function () { return constants_js_1.Geofence; } });
|
|
@@ -108,6 +110,7 @@ Object.defineProperty(exports, "MicrosoftCNSTT", { enumerable: true, get: functi
|
|
|
108
110
|
Object.defineProperty(exports, "MicrosoftCNTTS", { enumerable: true, get: function () { return cn_js_1.MicrosoftCNTTS; } });
|
|
109
111
|
Object.defineProperty(exports, "MiniMaxCNTTS", { enumerable: true, get: function () { return cn_js_1.MiniMaxCNTTS; } });
|
|
110
112
|
Object.defineProperty(exports, "SensetimeAvatar", { enumerable: true, get: function () { return cn_js_1.SensetimeAvatar; } });
|
|
113
|
+
Object.defineProperty(exports, "SpatiusAvatar", { enumerable: true, get: function () { return cn_js_1.SpatiusAvatar; } });
|
|
111
114
|
Object.defineProperty(exports, "StepFunTTS", { enumerable: true, get: function () { return cn_js_1.StepFunTTS; } });
|
|
112
115
|
Object.defineProperty(exports, "TencentLLM", { enumerable: true, get: function () { return cn_js_1.TencentLLM; } });
|
|
113
116
|
Object.defineProperty(exports, "TencentSTT", { enumerable: true, get: function () { return cn_js_1.TencentSTT; } });
|
|
@@ -143,6 +146,7 @@ Object.defineProperty(exports, "MicrosoftSTT", { enumerable: true, get: function
|
|
|
143
146
|
Object.defineProperty(exports, "OpenAISTT", { enumerable: true, get: function () { return stt_js_1.OpenAISTT; } });
|
|
144
147
|
Object.defineProperty(exports, "SarvamSTT", { enumerable: true, get: function () { return stt_js_1.SarvamSTT; } });
|
|
145
148
|
Object.defineProperty(exports, "SpeechmaticsSTT", { enumerable: true, get: function () { return stt_js_1.SpeechmaticsSTT; } });
|
|
149
|
+
Object.defineProperty(exports, "XAiSTT", { enumerable: true, get: function () { return stt_js_1.XAiSTT; } });
|
|
146
150
|
// TTS vendor classes
|
|
147
151
|
var tts_js_1 = require("./vendors/tts.js");
|
|
148
152
|
Object.defineProperty(exports, "AmazonTTS", { enumerable: true, get: function () { return tts_js_1.AmazonTTS; } });
|
|
@@ -150,11 +154,15 @@ Object.defineProperty(exports, "CartesiaTTS", { enumerable: true, get: function
|
|
|
150
154
|
Object.defineProperty(exports, "DeepgramTTS", { enumerable: true, get: function () { return tts_js_1.DeepgramTTS; } });
|
|
151
155
|
Object.defineProperty(exports, "ElevenLabsTTS", { enumerable: true, get: function () { return tts_js_1.ElevenLabsTTS; } });
|
|
152
156
|
Object.defineProperty(exports, "FishAudioTTS", { enumerable: true, get: function () { return tts_js_1.FishAudioTTS; } });
|
|
157
|
+
Object.defineProperty(exports, "GenericTTS", { enumerable: true, get: function () { return tts_js_1.GenericTTS; } });
|
|
153
158
|
Object.defineProperty(exports, "GoogleTTS", { enumerable: true, get: function () { return tts_js_1.GoogleTTS; } });
|
|
159
|
+
Object.defineProperty(exports, "GradiumTTS", { enumerable: true, get: function () { return tts_js_1.GradiumTTS; } });
|
|
154
160
|
Object.defineProperty(exports, "HumeAITTS", { enumerable: true, get: function () { return tts_js_1.HumeAITTS; } });
|
|
155
161
|
Object.defineProperty(exports, "MicrosoftTTS", { enumerable: true, get: function () { return tts_js_1.MicrosoftTTS; } });
|
|
156
162
|
Object.defineProperty(exports, "MiniMaxTTS", { enumerable: true, get: function () { return tts_js_1.MiniMaxTTS; } });
|
|
163
|
+
Object.defineProperty(exports, "MistralTTS", { enumerable: true, get: function () { return tts_js_1.MistralTTS; } });
|
|
157
164
|
Object.defineProperty(exports, "MurfTTS", { enumerable: true, get: function () { return tts_js_1.MurfTTS; } });
|
|
158
165
|
Object.defineProperty(exports, "OpenAITTS", { enumerable: true, get: function () { return tts_js_1.OpenAITTS; } });
|
|
159
166
|
Object.defineProperty(exports, "RimeTTS", { enumerable: true, get: function () { return tts_js_1.RimeTTS; } });
|
|
160
167
|
Object.defineProperty(exports, "SarvamTTS", { enumerable: true, get: function () { return tts_js_1.SarvamTTS; } });
|
|
168
|
+
Object.defineProperty(exports, "XAiTTS", { enumerable: true, get: function () { return tts_js_1.XAiTTS; } });
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseSTT, BaseTTS } from "./vendors/base.js";
|
|
2
2
|
import type { MicrosoftCNSampleRate, MicrosoftCNSTT, MicrosoftCNTTS } from "./vendors/cn.js";
|
|
3
3
|
import type { CustomLLM } from "./vendors/llm.js";
|
|
4
|
+
import type { GenericTTS } from "./vendors/tts.js";
|
|
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.js";
|
|
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.js";
|
|
6
6
|
import type { AgentThinkAgentManagementRequest } from "../api/resources/agentManagement/client/requests/AgentThinkAgentManagementRequest.js";
|
|
7
7
|
import type { PresetInput } from "./presets.js";
|
|
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 {};
|
|
@@ -151,8 +151,8 @@ export declare class HeyGenAvatar extends BaseAvatar<HeyGenSampleRate> {
|
|
|
151
151
|
export interface AnamAvatarOptions {
|
|
152
152
|
/** Anam API key */
|
|
153
153
|
apiKey: string;
|
|
154
|
-
/** Anam
|
|
155
|
-
|
|
154
|
+
/** Anam avatar ID */
|
|
155
|
+
avatarId?: string;
|
|
156
156
|
/** Enable avatar (default: true) */
|
|
157
157
|
enable?: boolean;
|
|
158
158
|
/** Additional vendor-specific parameters */
|
|
@@ -167,7 +167,7 @@ export interface AnamAvatarOptions {
|
|
|
167
167
|
*
|
|
168
168
|
* const avatar = new AnamAvatar({
|
|
169
169
|
* apiKey: process.env.ANAM_API_KEY,
|
|
170
|
-
*
|
|
170
|
+
* avatarId: 'avatar-id',
|
|
171
171
|
* });
|
|
172
172
|
*
|
|
173
173
|
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
@@ -171,7 +171,7 @@ exports.HeyGenAvatar = HeyGenAvatar;
|
|
|
171
171
|
*
|
|
172
172
|
* const avatar = new AnamAvatar({
|
|
173
173
|
* apiKey: process.env.ANAM_API_KEY,
|
|
174
|
-
*
|
|
174
|
+
* avatarId: 'avatar-id',
|
|
175
175
|
* });
|
|
176
176
|
*
|
|
177
177
|
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
@@ -195,11 +195,11 @@ class AnamAvatar extends base_js_1.BaseAvatar {
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
toConfig() {
|
|
198
|
-
const { apiKey,
|
|
198
|
+
const { apiKey, avatarId, enable = true, additionalParams } = this.options;
|
|
199
199
|
return {
|
|
200
200
|
enable,
|
|
201
201
|
vendor: "anam",
|
|
202
|
-
params: Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey }), (
|
|
202
|
+
params: Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey }), (avatarId && { avatar_id: avatarId })),
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
205
|
}
|
|
@@ -25,6 +25,8 @@ export interface BaseLlmOptions {
|
|
|
25
25
|
* - `"single_first"`: Broadcasts a greeting only once to the first user.
|
|
26
26
|
*/
|
|
27
27
|
greetingConfigs?: LlmGreetingConfigs;
|
|
28
|
+
/** Publicly accessible greeting audio URL played when the session starts. */
|
|
29
|
+
greetingAudioUrl?: string;
|
|
28
30
|
/**
|
|
29
31
|
* Key-value pairs injected into `system_messages`, `greeting_message`, and
|
|
30
32
|
* `failure_message` via `{{variable_name}}` syntax. Useful for per-session
|
|
@@ -87,12 +89,14 @@ declare abstract class ScopedBaseLLM<TScope extends VendorScope> {
|
|
|
87
89
|
readonly areaScope: TScope;
|
|
88
90
|
private readonly _outputModalities?;
|
|
89
91
|
private readonly _greetingConfigs?;
|
|
92
|
+
private readonly _greetingAudioUrl?;
|
|
90
93
|
private readonly _templateVariables?;
|
|
91
94
|
private readonly _vendor?;
|
|
92
95
|
private readonly _mcpServers?;
|
|
93
96
|
constructor(areaScope: TScope, options?: BaseLlmOptions);
|
|
94
97
|
protected get outputModalities(): string[] | undefined;
|
|
95
98
|
protected get greetingConfigs(): LlmGreetingConfigs | undefined;
|
|
99
|
+
protected get greetingAudioUrl(): string | undefined;
|
|
96
100
|
protected get templateVariables(): Record<string, string> | undefined;
|
|
97
101
|
protected get vendor(): string | undefined;
|
|
98
102
|
/** MCP servers with transport defaulted to streamable_http (API requires it; only option). */
|
|
@@ -16,6 +16,7 @@ class ScopedBaseLLM {
|
|
|
16
16
|
this.areaScope = areaScope;
|
|
17
17
|
this._outputModalities = options === null || options === void 0 ? void 0 : options.outputModalities;
|
|
18
18
|
this._greetingConfigs = options === null || options === void 0 ? void 0 : options.greetingConfigs;
|
|
19
|
+
this._greetingAudioUrl = options === null || options === void 0 ? void 0 : options.greetingAudioUrl;
|
|
19
20
|
this._templateVariables = options === null || options === void 0 ? void 0 : options.templateVariables;
|
|
20
21
|
this._vendor = options === null || options === void 0 ? void 0 : options.vendor;
|
|
21
22
|
this._mcpServers = options === null || options === void 0 ? void 0 : options.mcpServers;
|
|
@@ -26,6 +27,9 @@ class ScopedBaseLLM {
|
|
|
26
27
|
get greetingConfigs() {
|
|
27
28
|
return this._greetingConfigs;
|
|
28
29
|
}
|
|
30
|
+
get greetingAudioUrl() {
|
|
31
|
+
return this._greetingAudioUrl;
|
|
32
|
+
}
|
|
29
33
|
get templateVariables() {
|
|
30
34
|
return this._templateVariables;
|
|
31
35
|
}
|
|
@@ -238,7 +238,7 @@ export interface SensetimeAvatarOptions {
|
|
|
238
238
|
agoraToken?: string;
|
|
239
239
|
appId: string;
|
|
240
240
|
appKey: string;
|
|
241
|
-
sceneList
|
|
241
|
+
sceneList?: Record<string, unknown>[];
|
|
242
242
|
enable?: boolean;
|
|
243
243
|
additionalParams?: Record<string, unknown>;
|
|
244
244
|
}
|
|
@@ -248,4 +248,22 @@ export declare class SensetimeAvatar extends BaseCNAvatar<number> {
|
|
|
248
248
|
constructor(options: SensetimeAvatarOptions);
|
|
249
249
|
toConfig(): AvatarConfig;
|
|
250
250
|
}
|
|
251
|
+
export interface SpatiusAvatarOptions {
|
|
252
|
+
spatiusApiKey: string;
|
|
253
|
+
spatiusAppId: string;
|
|
254
|
+
spatiusAvatarId: string;
|
|
255
|
+
agoraUid: string;
|
|
256
|
+
agoraToken?: string;
|
|
257
|
+
region?: string;
|
|
258
|
+
sampleRate?: 16000 | 24000;
|
|
259
|
+
sessionExpireMinutes?: number;
|
|
260
|
+
enable?: boolean;
|
|
261
|
+
additionalParams?: Record<string, unknown>;
|
|
262
|
+
}
|
|
263
|
+
export declare class SpatiusAvatar extends BaseCNAvatar<number> {
|
|
264
|
+
private readonly options;
|
|
265
|
+
readonly requiredSampleRate: number;
|
|
266
|
+
constructor(options: SpatiusAvatarOptions);
|
|
267
|
+
toConfig(): AvatarConfig;
|
|
268
|
+
}
|
|
251
269
|
export {};
|