agora-agents 2.3.1 → 2.4.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/avatar-types.d.ts +18 -5
- package/dist/cjs/agentkit/avatar-types.js +31 -3
- package/dist/cjs/agentkit/index.d.ts +9 -9
- package/dist/cjs/agentkit/index.js +8 -3
- package/dist/cjs/agentkit/types.d.ts +22 -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.js +2 -2
- 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 +60 -0
- package/dist/cjs/agentkit/vendors/tts.js +42 -1
- 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/GenericTts.d.ts +13 -0
- package/dist/cjs/api/types/GenericTts.js +3 -0
- package/dist/cjs/api/types/GenericTtsParams.d.ts +21 -0
- package/dist/cjs/api/types/GenericTtsParams.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/SpatiusAvatarParams.d.ts +23 -0
- package/dist/cjs/api/types/SpatiusAvatarParams.js +3 -0
- package/dist/cjs/api/types/Tts.d.ts +7 -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 +7 -0
- package/dist/cjs/api/types/index.js +7 -0
- package/dist/cjs/core/base64.js +1 -5
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +8 -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/avatar-types.d.mts +18 -5
- package/dist/esm/agentkit/avatar-types.mjs +30 -3
- package/dist/esm/agentkit/index.d.mts +9 -9
- package/dist/esm/agentkit/index.mjs +4 -4
- package/dist/esm/agentkit/types.d.mts +22 -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.mjs +2 -2
- 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 +60 -0
- package/dist/esm/agentkit/vendors/tts.mjs +39 -0
- 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/GenericTts.d.mts +13 -0
- package/dist/esm/api/types/GenericTts.mjs +2 -0
- package/dist/esm/api/types/GenericTtsParams.d.mts +21 -0
- package/dist/esm/api/types/GenericTtsParams.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/SpatiusAvatarParams.d.mts +23 -0
- package/dist/esm/api/types/SpatiusAvatarParams.mjs +2 -0
- package/dist/esm/api/types/Tts.d.mts +7 -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 +7 -0
- package/dist/esm/api/types/index.mjs +7 -0
- package/dist/esm/core/base64.mjs +1 -5
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +4 -4
- 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.2
|
|
45
|
-
"User-Agent": "agora-agents/v2.2
|
|
44
|
+
"X-Fern-SDK-Version": "v2.3.2",
|
|
45
|
+
"User-Agent": "agora-agents/v2.3.2",
|
|
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)) {
|
|
@@ -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
|
}
|
|
@@ -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";
|
|
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
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";
|
|
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, 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, 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, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
|
|
48
|
+
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, 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.GenericAvatar = exports.AnamAvatar = exports.AkoolAvatar = exports.MAX_EXPIRY_SECONDS = exports.generateRtcToken = exports.generateConvoAIToken = exports.ExpiresIn = exports.normalizePresetInput = exports.AgentPresets = exports.TurnDetectionTypeValues = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.ThinkOnListeningActionIgnore = exports.SpeakPriorityValues = exports.SpeakPriorityInterrupt = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SilenceActionValues = exports.SalModeValues = exports.MllmTurnDetectionModeValues = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeAgoraVad = exports.InterruptionModeValues = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeKeywords = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.Geofence = exports.FillerWordsSelectionRule = exports.DataChannel = exports.AudioScenario = exports.validateTtsSampleRate = exports.validateAvatarConfig = exports.toBaseAvatarConfig = exports.isSpatiusAvatar = exports.isSensetimeAvatar = exports.isLiveAvatarAvatar = exports.isHeyGenAvatar = exports.isGenericAvatar = exports.isAvatarTokenManaged = exports.isAnamAvatar = exports.isAkoolAvatar = exports.AgentSession = exports.Agent = void 0;
|
|
24
|
+
exports.OpenAISTT = exports.MicrosoftSTT = exports.GoogleSTT = exports.DeepgramSTT = exports.AssemblyAISTT = exports.AresSTT = exports.AmazonSTT = exports.XaiGrok = exports.VertexAI = exports.OpenAIRealtime = exports.GeminiLive = exports.VertexAILLM = exports.OpenAI = exports.Groq = exports.Gemini = exports.Dify = exports.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.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 = void 0;
|
|
25
|
+
exports.XAiTTS = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GoogleTTS = exports.GenericTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SarvamSTT = 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,6 +36,7 @@ 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; } });
|
|
@@ -108,6 +109,7 @@ Object.defineProperty(exports, "MicrosoftCNSTT", { enumerable: true, get: functi
|
|
|
108
109
|
Object.defineProperty(exports, "MicrosoftCNTTS", { enumerable: true, get: function () { return cn_js_1.MicrosoftCNTTS; } });
|
|
109
110
|
Object.defineProperty(exports, "MiniMaxCNTTS", { enumerable: true, get: function () { return cn_js_1.MiniMaxCNTTS; } });
|
|
110
111
|
Object.defineProperty(exports, "SensetimeAvatar", { enumerable: true, get: function () { return cn_js_1.SensetimeAvatar; } });
|
|
112
|
+
Object.defineProperty(exports, "SpatiusAvatar", { enumerable: true, get: function () { return cn_js_1.SpatiusAvatar; } });
|
|
111
113
|
Object.defineProperty(exports, "StepFunTTS", { enumerable: true, get: function () { return cn_js_1.StepFunTTS; } });
|
|
112
114
|
Object.defineProperty(exports, "TencentLLM", { enumerable: true, get: function () { return cn_js_1.TencentLLM; } });
|
|
113
115
|
Object.defineProperty(exports, "TencentSTT", { enumerable: true, get: function () { return cn_js_1.TencentSTT; } });
|
|
@@ -143,6 +145,7 @@ Object.defineProperty(exports, "MicrosoftSTT", { enumerable: true, get: function
|
|
|
143
145
|
Object.defineProperty(exports, "OpenAISTT", { enumerable: true, get: function () { return stt_js_1.OpenAISTT; } });
|
|
144
146
|
Object.defineProperty(exports, "SarvamSTT", { enumerable: true, get: function () { return stt_js_1.SarvamSTT; } });
|
|
145
147
|
Object.defineProperty(exports, "SpeechmaticsSTT", { enumerable: true, get: function () { return stt_js_1.SpeechmaticsSTT; } });
|
|
148
|
+
Object.defineProperty(exports, "XAiSTT", { enumerable: true, get: function () { return stt_js_1.XAiSTT; } });
|
|
146
149
|
// TTS vendor classes
|
|
147
150
|
var tts_js_1 = require("./vendors/tts.js");
|
|
148
151
|
Object.defineProperty(exports, "AmazonTTS", { enumerable: true, get: function () { return tts_js_1.AmazonTTS; } });
|
|
@@ -150,6 +153,7 @@ Object.defineProperty(exports, "CartesiaTTS", { enumerable: true, get: function
|
|
|
150
153
|
Object.defineProperty(exports, "DeepgramTTS", { enumerable: true, get: function () { return tts_js_1.DeepgramTTS; } });
|
|
151
154
|
Object.defineProperty(exports, "ElevenLabsTTS", { enumerable: true, get: function () { return tts_js_1.ElevenLabsTTS; } });
|
|
152
155
|
Object.defineProperty(exports, "FishAudioTTS", { enumerable: true, get: function () { return tts_js_1.FishAudioTTS; } });
|
|
156
|
+
Object.defineProperty(exports, "GenericTTS", { enumerable: true, get: function () { return tts_js_1.GenericTTS; } });
|
|
153
157
|
Object.defineProperty(exports, "GoogleTTS", { enumerable: true, get: function () { return tts_js_1.GoogleTTS; } });
|
|
154
158
|
Object.defineProperty(exports, "HumeAITTS", { enumerable: true, get: function () { return tts_js_1.HumeAITTS; } });
|
|
155
159
|
Object.defineProperty(exports, "MicrosoftTTS", { enumerable: true, get: function () { return tts_js_1.MicrosoftTTS; } });
|
|
@@ -158,3 +162,4 @@ Object.defineProperty(exports, "MurfTTS", { enumerable: true, get: function () {
|
|
|
158
162
|
Object.defineProperty(exports, "OpenAITTS", { enumerable: true, get: function () { return tts_js_1.OpenAITTS; } });
|
|
159
163
|
Object.defineProperty(exports, "RimeTTS", { enumerable: true, get: function () { return tts_js_1.RimeTTS; } });
|
|
160
164
|
Object.defineProperty(exports, "SarvamTTS", { enumerable: true, get: function () { return tts_js_1.SarvamTTS; } });
|
|
165
|
+
Object.defineProperty(exports, "XAiTTS", { enumerable: true, get: function () { return tts_js_1.XAiTTS; } });
|
|
@@ -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, GenericTtsParams as GenericTtsParamsType, GenericTts as GenericTtsType, 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, 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,6 +554,8 @@ 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;
|
|
547
561
|
export type AmazonTts = AmazonTtsType;
|
|
@@ -552,4 +566,7 @@ export type MurfTts = MurfTtsType;
|
|
|
552
566
|
export type MurfTtsParams = MurfTtsParamsType;
|
|
553
567
|
export type SarvamTts = SarvamTtsType;
|
|
554
568
|
export type SarvamTtsParams = SarvamTtsParamsType;
|
|
569
|
+
export type XAiTts = XAiTtsType;
|
|
570
|
+
export type XAiTtsParams = XAiTtsParamsType;
|
|
571
|
+
export type SpatiusAvatarParams = SpatiusAvatarParamsType;
|
|
555
572
|
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 {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SensetimeAvatar = exports.TencentLLM = exports.DeepSeekLLM = exports.BytedanceLLM = exports.AliyunLLM = exports.StepFunTTS = exports.BytedanceDuplexTTS = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.TencentTTS = exports.MicrosoftCNTTS = exports.MiniMaxCNTTS = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XfyunSTT = exports.TencentSTT = exports.MicrosoftCNSTT = exports.FengmingSTT = void 0;
|
|
3
|
+
exports.SpatiusAvatar = exports.SensetimeAvatar = exports.TencentLLM = exports.DeepSeekLLM = exports.BytedanceLLM = exports.AliyunLLM = exports.StepFunTTS = exports.BytedanceDuplexTTS = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.TencentTTS = exports.MicrosoftCNTTS = exports.MiniMaxCNTTS = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XfyunSTT = exports.TencentSTT = exports.MicrosoftCNSTT = exports.FengmingSTT = void 0;
|
|
4
4
|
const base_js_1 = require("./base.js");
|
|
5
5
|
function requireString(value, field, vendor) {
|
|
6
6
|
if (typeof value !== "string" || value.length === 0) {
|
|
@@ -222,7 +222,7 @@ class StepFunTTS extends base_js_1.BaseCNTTS {
|
|
|
222
222
|
exports.StepFunTTS = StepFunTTS;
|
|
223
223
|
function cnLlmConfig(options, vendor) {
|
|
224
224
|
var _a;
|
|
225
|
-
return Object.assign(Object.assign({ url: options.url }, (options.apiKey && { api_key: options.apiKey })), { params: Object.assign({ model: options.model }, options.params), headers: options.headers, max_history: options.maxHistory, system_messages: options.systemMessages, greeting_message: options.greetingMessage, failure_message: options.failureMessage, input_modalities: (_a = options.inputModalities) !== null && _a !== void 0 ? _a : ["text"], output_modalities: options.outputModalities, style: "openai", vendor, greeting_configs: options.greetingConfigs, template_variables: options.templateVariables, mcp_servers: options.mcpServers });
|
|
225
|
+
return Object.assign(Object.assign({ url: options.url }, (options.apiKey && { api_key: options.apiKey })), { params: Object.assign({ model: options.model }, options.params), headers: options.headers, max_history: options.maxHistory, system_messages: options.systemMessages, greeting_message: options.greetingMessage, greeting_audio_url: options.greetingAudioUrl, failure_message: options.failureMessage, input_modalities: (_a = options.inputModalities) !== null && _a !== void 0 ? _a : ["text"], output_modalities: options.outputModalities, style: "openai", vendor, greeting_configs: options.greetingConfigs, template_variables: options.templateVariables, mcp_servers: options.mcpServers });
|
|
226
226
|
}
|
|
227
227
|
class AliyunLLM extends base_js_1.BaseCNLLM {
|
|
228
228
|
constructor(options) {
|
|
@@ -286,8 +286,28 @@ class SensetimeAvatar extends base_js_1.BaseCNAvatar {
|
|
|
286
286
|
return {
|
|
287
287
|
enable,
|
|
288
288
|
vendor: "sensetime",
|
|
289
|
-
params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { agora_uid: agoraUid }), (agoraToken && { agora_token: agoraToken })), { appId, app_key: appKey, sceneList }),
|
|
289
|
+
params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { agora_uid: agoraUid }), (agoraToken && { agora_token: agoraToken })), { appId, app_key: appKey }), (sceneList !== undefined && { sceneList })),
|
|
290
290
|
};
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
exports.SensetimeAvatar = SensetimeAvatar;
|
|
294
|
+
class SpatiusAvatar extends base_js_1.BaseCNAvatar {
|
|
295
|
+
constructor(options) {
|
|
296
|
+
super();
|
|
297
|
+
this.options = options;
|
|
298
|
+
this.requiredSampleRate = 0;
|
|
299
|
+
requireString(options.spatiusApiKey, "spatiusApiKey", "SpatiusAvatar");
|
|
300
|
+
requireString(options.spatiusAppId, "spatiusAppId", "SpatiusAvatar");
|
|
301
|
+
requireString(options.spatiusAvatarId, "spatiusAvatarId", "SpatiusAvatar");
|
|
302
|
+
requireString(options.agoraUid, "agoraUid", "SpatiusAvatar");
|
|
303
|
+
}
|
|
304
|
+
toConfig() {
|
|
305
|
+
const { spatiusApiKey, spatiusAppId, spatiusAvatarId, agoraUid, agoraToken, region, sampleRate, sessionExpireMinutes, enable = true, additionalParams, } = this.options;
|
|
306
|
+
return {
|
|
307
|
+
enable,
|
|
308
|
+
vendor: "spatius",
|
|
309
|
+
params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { spatius_api_key: spatiusApiKey, spatius_app_id: spatiusAppId, spatius_avatar_id: spatiusAvatarId, agora_uid: agoraUid }), (agoraToken && { agora_token: agoraToken })), (region && { region })), (sampleRate !== undefined && { sample_rate: sampleRate })), (sessionExpireMinutes !== undefined && { session_expire_minutes: sessionExpireMinutes })),
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
exports.SpatiusAvatar = SpatiusAvatar;
|
|
@@ -174,7 +174,7 @@ export interface GeminiOptions extends BaseLlmOptions {
|
|
|
174
174
|
apiKey: string;
|
|
175
175
|
/** Model name (e.g., 'gemini-pro', 'gemini-pro-vision') */
|
|
176
176
|
model: string;
|
|
177
|
-
/** API endpoint URL
|
|
177
|
+
/** Optional full API endpoint URL override. When omitted, AgentKit builds the official Gemini stream URL. */
|
|
178
178
|
url?: string;
|
|
179
179
|
/** Maximum number of conversation history messages to cache */
|
|
180
180
|
maxHistory?: number;
|