agora-agents 2.2.0 → 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/README.md +48 -26
- package/dist/cjs/AgoraPoolClient.d.ts +9 -6
- package/dist/cjs/AgoraPoolClient.js +1 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.js +8 -16
- package/dist/cjs/agentkit/Agent.d.ts +52 -51
- package/dist/cjs/agentkit/Agent.js +46 -44
- package/dist/cjs/agentkit/AgentSession.d.ts +11 -10
- package/dist/cjs/agentkit/AgentSession.js +12 -6
- package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.d.ts +1 -0
- package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.js +57 -0
- package/dist/cjs/agentkit/__tests__/readme-examples.test.d.ts +1 -0
- package/dist/cjs/agentkit/__tests__/readme-examples.test.js +126 -0
- package/dist/cjs/agentkit/__tests__/type-safety.test.js +24 -17
- package/dist/cjs/agentkit/area.d.ts +4 -0
- package/dist/cjs/agentkit/area.js +2 -0
- package/dist/cjs/agentkit/avatar-types.d.ts +43 -4
- package/dist/cjs/agentkit/avatar-types.js +52 -2
- package/dist/cjs/agentkit/index.d.ts +12 -9
- package/dist/cjs/agentkit/index.js +32 -2
- package/dist/cjs/agentkit/region-vendors.d.ts +15 -0
- package/dist/cjs/agentkit/region-vendors.js +2 -0
- package/dist/cjs/agentkit/token.d.ts +3 -2
- package/dist/cjs/agentkit/token.js +3 -2
- package/dist/cjs/agentkit/types.d.ts +47 -9
- package/dist/cjs/agentkit/vendors/avatar.d.ts +9 -6
- package/dist/cjs/agentkit/vendors/avatar.js +9 -6
- package/dist/cjs/agentkit/vendors/base.d.ts +42 -5
- package/dist/cjs/agentkit/vendors/base.js +64 -6
- package/dist/cjs/agentkit/vendors/cn.d.ts +269 -0
- package/dist/cjs/agentkit/vendors/cn.js +313 -0
- 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 +8 -4
- package/dist/cjs/agentkit/vendors/mllm.js +10 -6
- package/dist/cjs/agentkit/vendors/stt.d.ts +31 -0
- package/dist/cjs/agentkit/vendors/stt.js +31 -1
- package/dist/cjs/agentkit/vendors/tts.d.ts +63 -3
- 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 +23 -3
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +12 -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 +19 -1
- package/dist/cjs/api/types/BytedanceDuplexTts.d.ts +9 -0
- package/dist/cjs/api/types/BytedanceDuplexTts.js +3 -0
- package/dist/cjs/api/types/BytedanceDuplexTtsParams.d.ts +13 -0
- package/dist/cjs/api/types/BytedanceDuplexTtsParams.js +3 -0
- package/dist/cjs/api/types/BytedanceTts.d.ts +9 -0
- package/dist/cjs/api/types/BytedanceTts.js +3 -0
- package/dist/cjs/api/types/BytedanceTtsParams.d.ts +23 -0
- package/dist/cjs/api/types/BytedanceTtsParams.js +3 -0
- package/dist/cjs/api/types/CosyvoiceTts.d.ts +9 -0
- package/dist/cjs/api/types/CosyvoiceTts.js +3 -0
- package/dist/cjs/api/types/CosyvoiceTtsParams.d.ts +15 -0
- package/dist/cjs/api/types/CosyvoiceTtsParams.js +3 -0
- package/dist/cjs/api/types/FengmingAsr.d.ts +11 -0
- package/dist/cjs/api/types/FengmingAsr.js +3 -0
- package/dist/cjs/api/types/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/MinimaxTtsParams.d.ts +52 -3
- package/dist/cjs/api/types/OpenAiTtsParams.d.ts +1 -1
- package/dist/cjs/api/types/SensetimeAvatarParams.d.ts +48 -0
- package/dist/cjs/api/types/SensetimeAvatarParams.js +3 -0
- package/dist/cjs/api/types/SpatiusAvatarParams.d.ts +23 -0
- package/dist/cjs/api/types/SpatiusAvatarParams.js +3 -0
- package/dist/cjs/api/types/StepfunTts.d.ts +9 -0
- package/dist/cjs/api/types/StepfunTts.js +3 -0
- package/dist/cjs/api/types/StepfunTtsParams.d.ts +13 -0
- package/dist/cjs/api/types/StepfunTtsParams.js +3 -0
- package/dist/cjs/api/types/TencentAsr.d.ts +10 -0
- package/dist/cjs/api/types/TencentAsr.js +3 -0
- package/dist/cjs/api/types/TencentAsrParams.d.ts +17 -0
- package/dist/cjs/api/types/TencentAsrParams.js +3 -0
- package/dist/cjs/api/types/TencentTts.d.ts +9 -0
- package/dist/cjs/api/types/TencentTts.js +3 -0
- package/dist/cjs/api/types/TencentTtsParams.d.ts +23 -0
- package/dist/cjs/api/types/TencentTtsParams.js +3 -0
- package/dist/cjs/api/types/Tts.d.ts +22 -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/XfyunAsr.d.ts +10 -0
- package/dist/cjs/api/types/XfyunAsr.js +3 -0
- package/dist/cjs/api/types/XfyunAsrParams.d.ts +15 -0
- package/dist/cjs/api/types/XfyunAsrParams.js +3 -0
- package/dist/cjs/api/types/XfyunBigmodelAsr.d.ts +10 -0
- package/dist/cjs/api/types/XfyunBigmodelAsr.js +3 -0
- package/dist/cjs/api/types/XfyunBigmodelAsrParams.d.ts +17 -0
- package/dist/cjs/api/types/XfyunBigmodelAsrParams.js +3 -0
- package/dist/cjs/api/types/XfyunDialectAsr.d.ts +10 -0
- package/dist/cjs/api/types/XfyunDialectAsr.js +3 -0
- package/dist/cjs/api/types/XfyunDialectAsrParams.d.ts +15 -0
- package/dist/cjs/api/types/XfyunDialectAsrParams.js +3 -0
- package/dist/cjs/api/types/index.d.ts +27 -0
- package/dist/cjs/api/types/index.js +27 -0
- package/dist/cjs/core/base64.js +1 -5
- package/dist/cjs/core/domain/index.d.ts +2 -1
- package/dist/cjs/core/domain/index.js +5 -3
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +31 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/AgoraPoolClient.d.mts +9 -6
- package/dist/esm/AgoraPoolClient.mjs +1 -0
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.mjs +8 -16
- package/dist/esm/agentkit/Agent.d.mts +52 -51
- package/dist/esm/agentkit/Agent.mjs +46 -44
- package/dist/esm/agentkit/AgentSession.d.mts +11 -10
- package/dist/esm/agentkit/AgentSession.mjs +13 -7
- package/dist/esm/agentkit/__tests__/area-aware-vendors.test.d.mts +1 -0
- package/dist/esm/agentkit/__tests__/area-aware-vendors.test.mjs +55 -0
- package/dist/esm/agentkit/__tests__/readme-examples.test.d.mts +1 -0
- package/dist/esm/agentkit/__tests__/readme-examples.test.mjs +124 -0
- package/dist/esm/agentkit/__tests__/type-safety.test.mjs +24 -17
- package/dist/esm/agentkit/area.d.mts +4 -0
- package/dist/esm/agentkit/area.mjs +1 -0
- package/dist/esm/agentkit/avatar-types.d.mts +43 -4
- package/dist/esm/agentkit/avatar-types.mjs +50 -2
- package/dist/esm/agentkit/index.d.mts +12 -9
- package/dist/esm/agentkit/index.mjs +5 -4
- package/dist/esm/agentkit/region-vendors.d.mts +15 -0
- package/dist/esm/agentkit/region-vendors.mjs +1 -0
- package/dist/esm/agentkit/token.d.mts +3 -2
- package/dist/esm/agentkit/token.mjs +3 -2
- package/dist/esm/agentkit/types.d.mts +47 -9
- package/dist/esm/agentkit/vendors/avatar.d.mts +9 -6
- package/dist/esm/agentkit/vendors/avatar.mjs +9 -6
- package/dist/esm/agentkit/vendors/base.d.mts +42 -5
- package/dist/esm/agentkit/vendors/base.mjs +59 -5
- package/dist/esm/agentkit/vendors/cn.d.mts +269 -0
- package/dist/esm/agentkit/vendors/cn.mjs +291 -0
- 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 +8 -4
- package/dist/esm/agentkit/vendors/mllm.mjs +10 -6
- package/dist/esm/agentkit/vendors/stt.d.mts +31 -0
- package/dist/esm/agentkit/vendors/stt.mjs +29 -0
- package/dist/esm/agentkit/vendors/tts.d.mts +63 -3
- 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 +23 -3
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +12 -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 +19 -1
- package/dist/esm/api/types/BytedanceDuplexTts.d.mts +9 -0
- package/dist/esm/api/types/BytedanceDuplexTts.mjs +2 -0
- package/dist/esm/api/types/BytedanceDuplexTtsParams.d.mts +13 -0
- package/dist/esm/api/types/BytedanceDuplexTtsParams.mjs +2 -0
- package/dist/esm/api/types/BytedanceTts.d.mts +9 -0
- package/dist/esm/api/types/BytedanceTts.mjs +2 -0
- package/dist/esm/api/types/BytedanceTtsParams.d.mts +23 -0
- package/dist/esm/api/types/BytedanceTtsParams.mjs +2 -0
- package/dist/esm/api/types/CosyvoiceTts.d.mts +9 -0
- package/dist/esm/api/types/CosyvoiceTts.mjs +2 -0
- package/dist/esm/api/types/CosyvoiceTtsParams.d.mts +15 -0
- package/dist/esm/api/types/CosyvoiceTtsParams.mjs +2 -0
- package/dist/esm/api/types/FengmingAsr.d.mts +11 -0
- package/dist/esm/api/types/FengmingAsr.mjs +2 -0
- package/dist/esm/api/types/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/MinimaxTtsParams.d.mts +52 -3
- package/dist/esm/api/types/OpenAiTtsParams.d.mts +1 -1
- package/dist/esm/api/types/SensetimeAvatarParams.d.mts +48 -0
- package/dist/esm/api/types/SensetimeAvatarParams.mjs +2 -0
- package/dist/esm/api/types/SpatiusAvatarParams.d.mts +23 -0
- package/dist/esm/api/types/SpatiusAvatarParams.mjs +2 -0
- package/dist/esm/api/types/StepfunTts.d.mts +9 -0
- package/dist/esm/api/types/StepfunTts.mjs +2 -0
- package/dist/esm/api/types/StepfunTtsParams.d.mts +13 -0
- package/dist/esm/api/types/StepfunTtsParams.mjs +2 -0
- package/dist/esm/api/types/TencentAsr.d.mts +10 -0
- package/dist/esm/api/types/TencentAsr.mjs +2 -0
- package/dist/esm/api/types/TencentAsrParams.d.mts +17 -0
- package/dist/esm/api/types/TencentAsrParams.mjs +2 -0
- package/dist/esm/api/types/TencentTts.d.mts +9 -0
- package/dist/esm/api/types/TencentTts.mjs +2 -0
- package/dist/esm/api/types/TencentTtsParams.d.mts +23 -0
- package/dist/esm/api/types/TencentTtsParams.mjs +2 -0
- package/dist/esm/api/types/Tts.d.mts +22 -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/XfyunAsr.d.mts +10 -0
- package/dist/esm/api/types/XfyunAsr.mjs +2 -0
- package/dist/esm/api/types/XfyunAsrParams.d.mts +15 -0
- package/dist/esm/api/types/XfyunAsrParams.mjs +2 -0
- package/dist/esm/api/types/XfyunBigmodelAsr.d.mts +10 -0
- package/dist/esm/api/types/XfyunBigmodelAsr.mjs +2 -0
- package/dist/esm/api/types/XfyunBigmodelAsrParams.d.mts +17 -0
- package/dist/esm/api/types/XfyunBigmodelAsrParams.mjs +2 -0
- package/dist/esm/api/types/XfyunDialectAsr.d.mts +10 -0
- package/dist/esm/api/types/XfyunDialectAsr.mjs +2 -0
- package/dist/esm/api/types/XfyunDialectAsrParams.d.mts +15 -0
- package/dist/esm/api/types/XfyunDialectAsrParams.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +27 -0
- package/dist/esm/api/types/index.mjs +27 -0
- package/dist/esm/core/base64.mjs +1 -5
- package/dist/esm/core/domain/index.d.mts +2 -1
- package/dist/esm/core/domain/index.mjs +4 -2
- package/dist/esm/index.d.mts +3 -2
- package/dist/esm/index.mjs +6 -6
- package/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
|
@@ -43,7 +43,8 @@ export interface OpenAIRealtimeOptions {
|
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
45
|
* ```typescript
|
|
46
|
-
* const
|
|
46
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
47
|
+
* const agent = new Agent({ client })
|
|
47
48
|
* .withMllm(new OpenAIRealtime({
|
|
48
49
|
* apiKey: process.env.OPENAI_API_KEY,
|
|
49
50
|
* greetingMessage: 'Hello! How can I help you?',
|
|
@@ -96,7 +97,8 @@ export interface GeminiLiveOptions {
|
|
|
96
97
|
*
|
|
97
98
|
* @example
|
|
98
99
|
* ```typescript
|
|
99
|
-
* const
|
|
100
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
101
|
+
* const agent = new Agent({ client })
|
|
100
102
|
* .withMllm(new GeminiLive({
|
|
101
103
|
* apiKey: process.env.GOOGLE_API_KEY,
|
|
102
104
|
* model: 'gemini-live-2.5-flash',
|
|
@@ -152,7 +154,8 @@ export interface VertexAIOptions {
|
|
|
152
154
|
*
|
|
153
155
|
* @example
|
|
154
156
|
* ```typescript
|
|
155
|
-
* const
|
|
157
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
158
|
+
* const agent = new Agent({ client })
|
|
156
159
|
* .withMllm(new VertexAI({
|
|
157
160
|
* model: 'gemini-live-2.5-flash-preview-native-audio-09-2025',
|
|
158
161
|
* projectId: process.env.GOOGLE_PROJECT_ID,
|
|
@@ -206,7 +209,8 @@ export interface XaiGrokOptions {
|
|
|
206
209
|
*
|
|
207
210
|
* @example
|
|
208
211
|
* ```typescript
|
|
209
|
-
* const
|
|
212
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
213
|
+
* const agent = new Agent({ client })
|
|
210
214
|
* .withMllm(new XaiGrok({
|
|
211
215
|
* apiKey: process.env.XAI_API_KEY,
|
|
212
216
|
* voice: 'eve',
|
|
@@ -14,7 +14,8 @@ const base_js_1 = require("./base.js");
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
|
-
* const
|
|
17
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
18
|
+
* const agent = new Agent({ client })
|
|
18
19
|
* .withMllm(new OpenAIRealtime({
|
|
19
20
|
* apiKey: process.env.OPENAI_API_KEY,
|
|
20
21
|
* greetingMessage: 'Hello! How can I help you?',
|
|
@@ -49,7 +50,8 @@ exports.OpenAIRealtime = OpenAIRealtime;
|
|
|
49
50
|
*
|
|
50
51
|
* @example
|
|
51
52
|
* ```typescript
|
|
52
|
-
* const
|
|
53
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
54
|
+
* const agent = new Agent({ client })
|
|
53
55
|
* .withMllm(new GeminiLive({
|
|
54
56
|
* apiKey: process.env.GOOGLE_API_KEY,
|
|
55
57
|
* model: 'gemini-live-2.5-flash',
|
|
@@ -64,7 +66,7 @@ class GeminiLive extends base_js_1.BaseMLLM {
|
|
|
64
66
|
}
|
|
65
67
|
toConfig() {
|
|
66
68
|
const { apiKey, model, url, instructions, voice, affectiveDialog, proactiveAudio, transcribeAgent, transcribeUser, httpOptions, greetingMessage, inputModalities, outputModalities, messages, additionalParams, turnDetection, } = this.options;
|
|
67
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
69
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "gemini", api_key: apiKey, url: url !== null && url !== void 0 ? url : "", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { model }), (instructions && { instructions })), (voice && { voice })), (affectiveDialog !== undefined && { affective_dialog: affectiveDialog })), (proactiveAudio !== undefined && { proactive_audio: proactiveAudio })), (transcribeAgent !== undefined && { transcribe_agent: transcribeAgent })), (transcribeUser !== undefined && { transcribe_user: transcribeUser })), (httpOptions && { http_options: httpOptions })) }, (messages && { messages })), (greetingMessage && { greeting_message: greetingMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (this.options.failureMessage && { failure_message: this.options.failureMessage })), (turnDetection && { turn_detection: turnDetection }));
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
exports.GeminiLive = GeminiLive;
|
|
@@ -73,7 +75,8 @@ exports.GeminiLive = GeminiLive;
|
|
|
73
75
|
*
|
|
74
76
|
* @example
|
|
75
77
|
* ```typescript
|
|
76
|
-
* const
|
|
78
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
79
|
+
* const agent = new Agent({ client })
|
|
77
80
|
* .withMllm(new VertexAI({
|
|
78
81
|
* model: 'gemini-live-2.5-flash-preview-native-audio-09-2025',
|
|
79
82
|
* projectId: process.env.GOOGLE_PROJECT_ID,
|
|
@@ -92,7 +95,7 @@ class VertexAI extends base_js_1.BaseMLLM {
|
|
|
92
95
|
}
|
|
93
96
|
toConfig() {
|
|
94
97
|
const { model, url, projectId, location, adcCredentialsString, instructions, voice, affectiveDialog, proactiveAudio, transcribeAgent, transcribeUser, httpOptions, greetingMessage, inputModalities, outputModalities, messages, additionalParams, turnDetection, } = this.options;
|
|
95
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
98
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "vertexai", url: url !== null && url !== void 0 ? url : "", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { model, project_id: projectId, location, adc_credentials_string: adcCredentialsString }), (instructions && { instructions })), (voice && { voice })), (affectiveDialog !== undefined && { affective_dialog: affectiveDialog })), (proactiveAudio !== undefined && { proactive_audio: proactiveAudio })), (transcribeAgent !== undefined && { transcribe_agent: transcribeAgent })), (transcribeUser !== undefined && { transcribe_user: transcribeUser })), (httpOptions && { http_options: httpOptions })) }, (messages && { messages })), (greetingMessage && { greeting_message: greetingMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (this.options.failureMessage && { failure_message: this.options.failureMessage })), (turnDetection && { turn_detection: turnDetection }));
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
exports.VertexAI = VertexAI;
|
|
@@ -104,7 +107,8 @@ exports.VertexAI = VertexAI;
|
|
|
104
107
|
*
|
|
105
108
|
* @example
|
|
106
109
|
* ```typescript
|
|
107
|
-
* const
|
|
110
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
111
|
+
* const agent = new Agent({ client })
|
|
108
112
|
* .withMllm(new XaiGrok({
|
|
109
113
|
* apiKey: process.env.XAI_API_KEY,
|
|
110
114
|
* voice: 'eve',
|
|
@@ -285,4 +285,35 @@ export declare class SarvamSTT extends BaseSTT {
|
|
|
285
285
|
constructor(options: SarvamSTTOptions);
|
|
286
286
|
toConfig(): SttConfig;
|
|
287
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Constructor options for xAI STT.
|
|
290
|
+
*/
|
|
291
|
+
export interface XAiSTTOptions {
|
|
292
|
+
/** xAI API key */
|
|
293
|
+
apiKey: string;
|
|
294
|
+
/** Language code for speech recognition */
|
|
295
|
+
language?: string;
|
|
296
|
+
/** WebSocket endpoint URL for the xAI streaming STT API */
|
|
297
|
+
baseUrl?: string;
|
|
298
|
+
/** Audio sample rate in Hz */
|
|
299
|
+
sampleRate?: number;
|
|
300
|
+
/** Additional vendor-specific parameters */
|
|
301
|
+
additionalParams?: Record<string, unknown>;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* xAI STT vendor.
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* ```typescript
|
|
308
|
+
* const stt = new XAiSTT({
|
|
309
|
+
* apiKey: process.env.XAI_API_KEY,
|
|
310
|
+
* language: 'en',
|
|
311
|
+
* });
|
|
312
|
+
* ```
|
|
313
|
+
*/
|
|
314
|
+
export declare class XAiSTT extends BaseSTT {
|
|
315
|
+
private readonly options;
|
|
316
|
+
constructor(options: XAiSTTOptions);
|
|
317
|
+
toConfig(): SttConfig;
|
|
318
|
+
}
|
|
288
319
|
export {};
|
|
@@ -3,9 +3,14 @@
|
|
|
3
3
|
* Type-safe STT (Speech-to-Text) vendor classes.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SarvamSTT = exports.AresSTT = exports.AssemblyAISTT = exports.AmazonSTT = exports.GoogleSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.DeepgramSTT = exports.SpeechmaticsSTT = void 0;
|
|
6
|
+
exports.XAiSTT = exports.SarvamSTT = exports.AresSTT = exports.AssemblyAISTT = exports.AmazonSTT = exports.GoogleSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.DeepgramSTT = exports.SpeechmaticsSTT = void 0;
|
|
7
7
|
const presets_js_1 = require("../presets.js");
|
|
8
8
|
const base_js_1 = require("./base.js");
|
|
9
|
+
function _requireString(value, field, vendor) {
|
|
10
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
11
|
+
throw new Error(`${vendor} requires ${field}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
9
14
|
function isDeepgramManagedModel(model) {
|
|
10
15
|
return model !== undefined && presets_js_1.DeepgramPresetModels.includes(model.trim().toLowerCase());
|
|
11
16
|
}
|
|
@@ -244,3 +249,28 @@ class SarvamSTT extends base_js_1.BaseSTT {
|
|
|
244
249
|
}
|
|
245
250
|
}
|
|
246
251
|
exports.SarvamSTT = SarvamSTT;
|
|
252
|
+
/**
|
|
253
|
+
* xAI STT vendor.
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* ```typescript
|
|
257
|
+
* const stt = new XAiSTT({
|
|
258
|
+
* apiKey: process.env.XAI_API_KEY,
|
|
259
|
+
* language: 'en',
|
|
260
|
+
* });
|
|
261
|
+
* ```
|
|
262
|
+
*/
|
|
263
|
+
class XAiSTT extends base_js_1.BaseSTT {
|
|
264
|
+
constructor(options) {
|
|
265
|
+
super();
|
|
266
|
+
this.options = options;
|
|
267
|
+
}
|
|
268
|
+
toConfig() {
|
|
269
|
+
const { apiKey, language, baseUrl, sampleRate, additionalParams } = this.options;
|
|
270
|
+
return {
|
|
271
|
+
vendor: "xai",
|
|
272
|
+
params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey }), (baseUrl !== undefined && { base_url: baseUrl })), (sampleRate !== undefined && { sample_rate: sampleRate })), (language !== undefined && { language })),
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
exports.XAiSTT = XAiSTT;
|
|
@@ -386,13 +386,13 @@ type MiniMaxTTSCommonOptions = {
|
|
|
386
386
|
/** MiniMax API key. Optional only for AgentKit-supported Agora-managed models. */
|
|
387
387
|
key?: string;
|
|
388
388
|
/** MiniMax group identifier */
|
|
389
|
-
groupId
|
|
389
|
+
groupId?: string;
|
|
390
390
|
/** TTS model (e.g., 'speech-02-turbo') */
|
|
391
391
|
model: string;
|
|
392
392
|
/** Voice style identifier (e.g., 'English_captivating_female1') */
|
|
393
|
-
voiceId
|
|
393
|
+
voiceId?: string;
|
|
394
394
|
/** WebSocket endpoint (e.g., 'wss://api-uw.minimax.io/ws/v1/t2a_v2') */
|
|
395
|
-
url
|
|
395
|
+
url?: string;
|
|
396
396
|
/** Skip patterns for bracketed content */
|
|
397
397
|
skipPatterns?: number[];
|
|
398
398
|
};
|
|
@@ -501,4 +501,64 @@ export declare class MurfTTS extends BaseTTS {
|
|
|
501
501
|
constructor(options: MurfTTSOptions);
|
|
502
502
|
toConfig(): TtsConfig;
|
|
503
503
|
}
|
|
504
|
+
/**
|
|
505
|
+
* Constructor options for Generic OpenAI-compatible TTS.
|
|
506
|
+
*/
|
|
507
|
+
export interface GenericTTSOptions {
|
|
508
|
+
/** Callback address of the generic TTS service */
|
|
509
|
+
url: string;
|
|
510
|
+
/** Custom headers to include in requests to the generic TTS service */
|
|
511
|
+
headers: Record<string, string>;
|
|
512
|
+
/** API key for the generic TTS service */
|
|
513
|
+
apiKey?: string;
|
|
514
|
+
/** TTS model name */
|
|
515
|
+
model: string;
|
|
516
|
+
/** Voice name */
|
|
517
|
+
voice: string;
|
|
518
|
+
/** Speech rate */
|
|
519
|
+
speed?: number;
|
|
520
|
+
/** Output audio sample rate in Hz */
|
|
521
|
+
sampleRate?: number;
|
|
522
|
+
/** Output audio format. ConvoAI currently supports `pcm` only. */
|
|
523
|
+
responseFormat?: "pcm";
|
|
524
|
+
/** Additional voice style control instruction */
|
|
525
|
+
instruction?: string;
|
|
526
|
+
/** Additional vendor-specific parameters */
|
|
527
|
+
additionalParams?: Record<string, unknown>;
|
|
528
|
+
/** Skip patterns for bracketed content */
|
|
529
|
+
skipPatterns?: number[];
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Generic OpenAI-compatible TTS vendor.
|
|
533
|
+
*/
|
|
534
|
+
export declare class GenericTTS extends BaseTTS {
|
|
535
|
+
private readonly options;
|
|
536
|
+
constructor(options: GenericTTSOptions);
|
|
537
|
+
toConfig(): TtsConfig;
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Constructor options for xAI TTS.
|
|
541
|
+
*/
|
|
542
|
+
export interface XAiTTSOptions {
|
|
543
|
+
/** xAI API key */
|
|
544
|
+
apiKey: string;
|
|
545
|
+
/** BCP-47 language code for speech synthesis */
|
|
546
|
+
language: string;
|
|
547
|
+
/** xAI voice identifier */
|
|
548
|
+
voiceId?: string;
|
|
549
|
+
/** Audio sample rate in Hz */
|
|
550
|
+
sampleRate?: number;
|
|
551
|
+
/** Additional vendor-specific parameters */
|
|
552
|
+
additionalParams?: Record<string, unknown>;
|
|
553
|
+
/** Skip patterns for bracketed content */
|
|
554
|
+
skipPatterns?: number[];
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* xAI TTS vendor.
|
|
558
|
+
*/
|
|
559
|
+
export declare class XAiTTS extends BaseTTS {
|
|
560
|
+
private readonly options;
|
|
561
|
+
constructor(options: XAiTTSOptions);
|
|
562
|
+
toConfig(): TtsConfig;
|
|
563
|
+
}
|
|
504
564
|
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Type-safe TTS (Text-to-Speech) vendor classes.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MurfTTS = exports.SarvamTTS = exports.MiniMaxTTS = exports.FishAudioTTS = exports.RimeTTS = exports.HumeAITTS = exports.DeepgramTTS = exports.AmazonTTS = exports.GoogleTTS = exports.CartesiaTTS = exports.OpenAITTS = exports.MicrosoftTTS = exports.ElevenLabsTTS = void 0;
|
|
6
|
+
exports.XAiTTS = exports.GenericTTS = exports.MurfTTS = exports.SarvamTTS = exports.MiniMaxTTS = exports.FishAudioTTS = exports.RimeTTS = exports.HumeAITTS = exports.DeepgramTTS = exports.AmazonTTS = exports.GoogleTTS = exports.CartesiaTTS = exports.OpenAITTS = exports.MicrosoftTTS = exports.ElevenLabsTTS = void 0;
|
|
7
7
|
const presets_js_1 = require("../presets.js");
|
|
8
8
|
const base_js_1 = require("./base.js");
|
|
9
9
|
function requireString(value, field, vendor) {
|
|
@@ -11,6 +11,11 @@ function requireString(value, field, vendor) {
|
|
|
11
11
|
throw new Error(`${vendor} requires ${field}`);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
function requireRecord(value, field, vendor) {
|
|
15
|
+
if (value == null || typeof value !== "object" || Array.isArray(value)) {
|
|
16
|
+
throw new Error(`${vendor} requires ${field}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
14
19
|
function isOpenAITtsManagedModel(model) {
|
|
15
20
|
return model === undefined || presets_js_1.OpenAITtsPresetModels.includes(model.trim().toLowerCase());
|
|
16
21
|
}
|
|
@@ -344,3 +349,39 @@ class MurfTTS extends base_js_1.BaseTTS {
|
|
|
344
349
|
}
|
|
345
350
|
}
|
|
346
351
|
exports.MurfTTS = MurfTTS;
|
|
352
|
+
/**
|
|
353
|
+
* Generic OpenAI-compatible TTS vendor.
|
|
354
|
+
*/
|
|
355
|
+
class GenericTTS extends base_js_1.BaseTTS {
|
|
356
|
+
constructor(options) {
|
|
357
|
+
super();
|
|
358
|
+
requireString(options.url, "url", "GenericTTS");
|
|
359
|
+
requireRecord(options.headers, "headers", "GenericTTS");
|
|
360
|
+
requireString(options.model, "model", "GenericTTS");
|
|
361
|
+
requireString(options.voice, "voice", "GenericTTS");
|
|
362
|
+
this.options = options;
|
|
363
|
+
}
|
|
364
|
+
toConfig() {
|
|
365
|
+
const { url, headers, apiKey, model, voice, speed, sampleRate, responseFormat, instruction, additionalParams, skipPatterns, } = this.options;
|
|
366
|
+
return Object.assign({ vendor: "generic", url,
|
|
367
|
+
headers, params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), (apiKey !== undefined && { api_key: apiKey })), { model,
|
|
368
|
+
voice }), (speed !== undefined && { speed })), (sampleRate !== undefined && { sample_rate: sampleRate })), (responseFormat !== undefined && { response_format: responseFormat })), (instruction !== undefined && { instruction })) }, (skipPatterns && { skip_patterns: skipPatterns }));
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
exports.GenericTTS = GenericTTS;
|
|
372
|
+
/**
|
|
373
|
+
* xAI TTS vendor.
|
|
374
|
+
*/
|
|
375
|
+
class XAiTTS extends base_js_1.BaseTTS {
|
|
376
|
+
constructor(options) {
|
|
377
|
+
super();
|
|
378
|
+
requireString(options.apiKey, "apiKey", "XAiTTS");
|
|
379
|
+
requireString(options.language, "language", "XAiTTS");
|
|
380
|
+
this.options = options;
|
|
381
|
+
}
|
|
382
|
+
toConfig() {
|
|
383
|
+
const { apiKey, language, voiceId, sampleRate, additionalParams, skipPatterns } = this.options;
|
|
384
|
+
return Object.assign({ vendor: "xai", params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey, language }), (voiceId !== undefined && { voice_id: voiceId })), (sampleRate !== undefined && { sample_rate: sampleRate })) }, (skipPatterns && { skip_patterns: skipPatterns }));
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
exports.XAiTTS = XAiTTS;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type * as Agora from "../../../../index.js";
|
|
2
1
|
/**
|
|
3
2
|
* @example
|
|
4
3
|
* {
|
|
@@ -15,7 +14,7 @@ export interface ListAgentsRequest {
|
|
|
15
14
|
/** The end timestamp (in seconds) for the query. Default is current time. */
|
|
16
15
|
to_time?: number;
|
|
17
16
|
/**
|
|
18
|
-
* The agent state
|
|
17
|
+
* The agent state filter. You can specify one or more agent states as a comma-separated list in a single request, for example `state=0,1,2`:
|
|
19
18
|
* - `IDLE` (0): Agent is idle.
|
|
20
19
|
* - `STARTING` (1): The agent is being started.
|
|
21
20
|
* - `RUNNING` (2): The agent is running.
|
|
@@ -23,7 +22,7 @@ export interface ListAgentsRequest {
|
|
|
23
22
|
* - `STOPPED` (4): The agent has exited.
|
|
24
23
|
* - `FAILED` (6): The agent failed to execute.
|
|
25
24
|
*/
|
|
26
|
-
state?:
|
|
25
|
+
state?: string;
|
|
27
26
|
/** The maximum number of entries returned per page. */
|
|
28
27
|
limit?: number;
|
|
29
28
|
/** The paging cursor, indicating the starting position (`agent_id`) of the next page of results. */
|
|
@@ -85,7 +85,7 @@ export declare namespace StartAgentsRequest {
|
|
|
85
85
|
* - `false`: Both agent and subscriber user IDs must be integers.
|
|
86
86
|
*/
|
|
87
87
|
enable_string_uid?: boolean;
|
|
88
|
-
/** Sets the timeout after all the users specified in `remote_rtc_uids` are detected to have left the channel. When the timeout value is exceeded, the agent automatically stops and exits the channel. A value of `0`
|
|
88
|
+
/** Sets the timeout after all the users specified in `remote_rtc_uids` are detected to have left the channel. When the timeout value is exceeded, the agent automatically stops and exits the channel. A value of `0` disables exit due to channel idle timeout only; it does not allow the agent to run indefinitely. Regardless of this value, the maximum runtime of a single task is 72 hours, after which the agent automatically exits. */
|
|
89
89
|
idle_timeout?: number;
|
|
90
90
|
/** Regional access restriction configuration. Use this to limit which Agora servers the Conversational AI Engine can access based on geographic regions. */
|
|
91
91
|
geofence?: Properties.Geofence;
|
|
@@ -172,6 +172,8 @@ export declare namespace StartAgentsRequest {
|
|
|
172
172
|
* - `liveavatar`: LiveAvatar (Beta)
|
|
173
173
|
* - `anam`: Anam (Beta)
|
|
174
174
|
* - `generic`: Generic (Beta)
|
|
175
|
+
* - `sensetime`: SenseTime Avatar
|
|
176
|
+
* - `spatius`: Spatius Avatar
|
|
175
177
|
*/
|
|
176
178
|
vendor?: Avatar.Vendor;
|
|
177
179
|
/** The configuration parameters for the avatar vendor. See [AI Avatar Overview](https://docs.agora.io/en/conversational-ai/models/avatar/overview) for details. */
|
|
@@ -184,6 +186,8 @@ export declare namespace StartAgentsRequest {
|
|
|
184
186
|
* - `liveavatar`: LiveAvatar (Beta)
|
|
185
187
|
* - `anam`: Anam (Beta)
|
|
186
188
|
* - `generic`: Generic (Beta)
|
|
189
|
+
* - `sensetime`: SenseTime Avatar
|
|
190
|
+
* - `spatius`: Spatius Avatar
|
|
187
191
|
*/
|
|
188
192
|
const Vendor: {
|
|
189
193
|
readonly Akool: "akool";
|
|
@@ -194,6 +198,12 @@ export declare namespace StartAgentsRequest {
|
|
|
194
198
|
/**
|
|
195
199
|
* Generic avatar (Beta) */
|
|
196
200
|
readonly Generic: "generic";
|
|
201
|
+
/**
|
|
202
|
+
* SenseTime Avatar */
|
|
203
|
+
readonly Sensetime: "sensetime";
|
|
204
|
+
/**
|
|
205
|
+
* Spatius Avatar */
|
|
206
|
+
readonly Spatius: "spatius";
|
|
197
207
|
/**
|
|
198
208
|
* Deprecated: HeyGen has renamed to LiveAvatar. Use `liveavatar` instead. */
|
|
199
209
|
readonly Heygen: "heygen";
|
|
@@ -204,8 +214,6 @@ export declare namespace StartAgentsRequest {
|
|
|
204
214
|
* Conversation turn detection settings. Controls the logic for voice activity detection and conversation turn determination. This object has no effect when `mllm.enable` is true; use `mllm.turn_detection` instead.
|
|
205
215
|
*/
|
|
206
216
|
interface TurnDetection {
|
|
207
|
-
/** BCP-47 language tag identifying the primary language used for agent interaction. */
|
|
208
|
-
language?: Agora.AsrLanguage;
|
|
209
217
|
/**
|
|
210
218
|
* Conversation turn detection mode:
|
|
211
219
|
* - `default`: Uses standard conversation turn detection configuration.
|
|
@@ -276,6 +284,7 @@ export declare namespace StartAgentsRequest {
|
|
|
276
284
|
* - `vad`: Based on VAD (Voice Activity Detection). Uses audio signal detection.
|
|
277
285
|
* - `keywords`: Deprecated. Use `interruption.mode = "keywords"` instead.
|
|
278
286
|
* - `disabled`: Deprecated. Use `interruption.enable = false` with `interruption.disabled_config.strategy` to configure the handling strategy.
|
|
287
|
+
* - `manual`: The client explicitly submits the start of the user turn through signaling.
|
|
279
288
|
*/
|
|
280
289
|
mode: StartOfSpeech.Mode;
|
|
281
290
|
/** VAD configuration. Used when `mode` is `vad`. */
|
|
@@ -291,11 +300,13 @@ export declare namespace StartAgentsRequest {
|
|
|
291
300
|
* - `vad`: Based on VAD (Voice Activity Detection). Uses audio signal detection.
|
|
292
301
|
* - `keywords`: Deprecated. Use `interruption.mode = "keywords"` instead.
|
|
293
302
|
* - `disabled`: Deprecated. Use `interruption.enable = false` with `interruption.disabled_config.strategy` to configure the handling strategy.
|
|
303
|
+
* - `manual`: The client explicitly submits the start of the user turn through signaling.
|
|
294
304
|
*/
|
|
295
305
|
const Mode: {
|
|
296
306
|
readonly Vad: "vad";
|
|
297
307
|
readonly Keywords: "keywords";
|
|
298
308
|
readonly Disabled: "disabled";
|
|
309
|
+
readonly Manual: "manual";
|
|
299
310
|
};
|
|
300
311
|
type Mode = (typeof Mode)[keyof typeof Mode];
|
|
301
312
|
/**
|
|
@@ -346,6 +357,7 @@ export declare namespace StartAgentsRequest {
|
|
|
346
357
|
* End of speech detection mode:
|
|
347
358
|
* - `vad`: Based on VAD (Voice Activity Detection). Detects silence duration.
|
|
348
359
|
* - `semantic`: Based on semantic triggering. Uses semantic understanding to determine when conversation ends.
|
|
360
|
+
* - `manual`: The client explicitly submits the end of the user turn through signaling.
|
|
349
361
|
*/
|
|
350
362
|
mode?: EndOfSpeech.Mode;
|
|
351
363
|
/** VAD configuration. Used when `mode` is `vad`. */
|
|
@@ -358,10 +370,12 @@ export declare namespace StartAgentsRequest {
|
|
|
358
370
|
* End of speech detection mode:
|
|
359
371
|
* - `vad`: Based on VAD (Voice Activity Detection). Detects silence duration.
|
|
360
372
|
* - `semantic`: Based on semantic triggering. Uses semantic understanding to determine when conversation ends.
|
|
373
|
+
* - `manual`: The client explicitly submits the end of the user turn through signaling.
|
|
361
374
|
*/
|
|
362
375
|
const Mode: {
|
|
363
376
|
readonly Vad: "vad";
|
|
364
377
|
readonly Semantic: "semantic";
|
|
378
|
+
readonly Manual: "manual";
|
|
365
379
|
};
|
|
366
380
|
type Mode = (typeof Mode)[keyof typeof Mode];
|
|
367
381
|
/**
|
|
@@ -652,6 +666,12 @@ export declare namespace StartAgentsRequest {
|
|
|
652
666
|
* - `aiserver`: Optimized for interactions between the user and the conversational AI agent in terms of latency and network resilience.
|
|
653
667
|
*/
|
|
654
668
|
audio_scenario?: Parameters.AudioScenario;
|
|
669
|
+
/**
|
|
670
|
+
* Whether to disable data retention for the current session:
|
|
671
|
+
* - `false`: Default. Session data retention remains enabled.
|
|
672
|
+
* - `true`: Disables session data retention. When disabled, historical session content cannot be used for troubleshooting, effectiveness review, or agent optimization.
|
|
673
|
+
*/
|
|
674
|
+
opt_out?: boolean;
|
|
655
675
|
}
|
|
656
676
|
namespace Parameters {
|
|
657
677
|
/**
|
|
@@ -34,6 +34,8 @@ var StartAgentsRequest;
|
|
|
34
34
|
* - `liveavatar`: LiveAvatar (Beta)
|
|
35
35
|
* - `anam`: Anam (Beta)
|
|
36
36
|
* - `generic`: Generic (Beta)
|
|
37
|
+
* - `sensetime`: SenseTime Avatar
|
|
38
|
+
* - `spatius`: Spatius Avatar
|
|
37
39
|
*/
|
|
38
40
|
Avatar.Vendor = {
|
|
39
41
|
Akool: "akool",
|
|
@@ -44,6 +46,12 @@ var StartAgentsRequest;
|
|
|
44
46
|
/**
|
|
45
47
|
* Generic avatar (Beta) */
|
|
46
48
|
Generic: "generic",
|
|
49
|
+
/**
|
|
50
|
+
* SenseTime Avatar */
|
|
51
|
+
Sensetime: "sensetime",
|
|
52
|
+
/**
|
|
53
|
+
* Spatius Avatar */
|
|
54
|
+
Spatius: "spatius",
|
|
47
55
|
/**
|
|
48
56
|
* Deprecated: HeyGen has renamed to LiveAvatar. Use `liveavatar` instead. */
|
|
49
57
|
Heygen: "heygen",
|
|
@@ -60,11 +68,13 @@ var StartAgentsRequest;
|
|
|
60
68
|
* - `vad`: Based on VAD (Voice Activity Detection). Uses audio signal detection.
|
|
61
69
|
* - `keywords`: Deprecated. Use `interruption.mode = "keywords"` instead.
|
|
62
70
|
* - `disabled`: Deprecated. Use `interruption.enable = false` with `interruption.disabled_config.strategy` to configure the handling strategy.
|
|
71
|
+
* - `manual`: The client explicitly submits the start of the user turn through signaling.
|
|
63
72
|
*/
|
|
64
73
|
StartOfSpeech.Mode = {
|
|
65
74
|
Vad: "vad",
|
|
66
75
|
Keywords: "keywords",
|
|
67
76
|
Disabled: "disabled",
|
|
77
|
+
Manual: "manual",
|
|
68
78
|
};
|
|
69
79
|
let DisabledConfig;
|
|
70
80
|
(function (DisabledConfig) {
|
|
@@ -85,10 +95,12 @@ var StartAgentsRequest;
|
|
|
85
95
|
* End of speech detection mode:
|
|
86
96
|
* - `vad`: Based on VAD (Voice Activity Detection). Detects silence duration.
|
|
87
97
|
* - `semantic`: Based on semantic triggering. Uses semantic understanding to determine when conversation ends.
|
|
98
|
+
* - `manual`: The client explicitly submits the end of the user turn through signaling.
|
|
88
99
|
*/
|
|
89
100
|
EndOfSpeech.Mode = {
|
|
90
101
|
Vad: "vad",
|
|
91
102
|
Semantic: "semantic",
|
|
103
|
+
Manual: "manual",
|
|
92
104
|
};
|
|
93
105
|
})(EndOfSpeech = Config.EndOfSpeech || (Config.EndOfSpeech = {}));
|
|
94
106
|
})(Config = TurnDetection.Config || (TurnDetection.Config = {}));
|
|
@@ -20,6 +20,12 @@ export declare namespace GetHistoryAgentsResponse {
|
|
|
20
20
|
role?: Item.Role;
|
|
21
21
|
/** Message content. */
|
|
22
22
|
content?: string;
|
|
23
|
+
/** The start timestamp of the speech segment in milliseconds, relative to the beginning of the current session. Returned only when `llm.vendor='custom'`. */
|
|
24
|
+
speech_start_ms?: number;
|
|
25
|
+
/** The end timestamp of the speech segment in milliseconds, relative to the beginning of the current session. Returned only when `llm.vendor='custom'`. */
|
|
26
|
+
speech_end_ms?: number;
|
|
27
|
+
/** The total delay in milliseconds introduced by audio processing algorithms, including noise reduction, background voice suppression, and voiceprint locking, after audio is captured from the user's microphone. Use this value to align timestamps with cloud recording audio. Returned only when `llm.vendor='custom'`, `contents[].role='user'`, and actual voice input is present. */
|
|
28
|
+
speech_algorithmic_delay?: number;
|
|
23
29
|
}
|
|
24
30
|
namespace Item {
|
|
25
31
|
/**
|
|
@@ -2,7 +2,6 @@ export * from "./GetAgentsResponse.js";
|
|
|
2
2
|
export * from "./GetHistoryAgentsResponse.js";
|
|
3
3
|
export * from "./GetTurnsAgentsResponse.js";
|
|
4
4
|
export * from "./InterruptAgentsResponse.js";
|
|
5
|
-
export * from "./ListAgentsRequestState.js";
|
|
6
5
|
export * from "./ListAgentsResponse.js";
|
|
7
6
|
export * from "./SpeakAgentsResponse.js";
|
|
8
7
|
export * from "./StartAgentsResponse.js";
|
|
@@ -18,7 +18,6 @@ __exportStar(require("./GetAgentsResponse.js"), exports);
|
|
|
18
18
|
__exportStar(require("./GetHistoryAgentsResponse.js"), exports);
|
|
19
19
|
__exportStar(require("./GetTurnsAgentsResponse.js"), exports);
|
|
20
20
|
__exportStar(require("./InterruptAgentsResponse.js"), exports);
|
|
21
|
-
__exportStar(require("./ListAgentsRequestState.js"), exports);
|
|
22
21
|
__exportStar(require("./ListAgentsResponse.js"), exports);
|
|
23
22
|
__exportStar(require("./SpeakAgentsResponse.js"), exports);
|
|
24
23
|
__exportStar(require("./StartAgentsResponse.js"), exports);
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type * as Agora from "../index.js";
|
|
2
|
-
export type Asr = Agora.Asr.Ares | Agora.Asr.Microsoft | Agora.Asr.Deepgram | Agora.Asr.Openai | Agora.Asr.Google | Agora.Asr.Amazon | Agora.Asr.Assemblyai | Agora.Asr.Speechmatics | Agora.Asr.Sarvam;
|
|
2
|
+
export type Asr = Agora.Asr.Ares | Agora.Asr.Fengming | Agora.Asr.Tencent | Agora.Asr.Microsoft | Agora.Asr.Deepgram | Agora.Asr.Openai | Agora.Asr.Google | Agora.Asr.Amazon | Agora.Asr.Assemblyai | Agora.Asr.Speechmatics | Agora.Asr.Sarvam | Agora.Asr.Xai | Agora.Asr.Xfyun | Agora.Asr.XfyunBigmodel | Agora.Asr.XfyunDialect;
|
|
3
3
|
export declare namespace Asr {
|
|
4
4
|
interface Ares extends Agora.AresAsr {
|
|
5
5
|
vendor: "ares";
|
|
6
6
|
}
|
|
7
|
+
interface Fengming extends Agora.FengmingAsr {
|
|
8
|
+
vendor: "fengming";
|
|
9
|
+
}
|
|
10
|
+
interface Tencent extends Agora.TencentAsr {
|
|
11
|
+
vendor: "tencent";
|
|
12
|
+
}
|
|
7
13
|
interface Microsoft extends Agora.MicrosoftAsr {
|
|
8
14
|
vendor: "microsoft";
|
|
9
15
|
}
|
|
@@ -28,4 +34,16 @@ export declare namespace Asr {
|
|
|
28
34
|
interface Sarvam extends Agora.SarvamAsr {
|
|
29
35
|
vendor: "sarvam";
|
|
30
36
|
}
|
|
37
|
+
interface Xai extends Agora.XAiAsr {
|
|
38
|
+
vendor: "xai";
|
|
39
|
+
}
|
|
40
|
+
interface Xfyun extends Agora.XfyunAsr {
|
|
41
|
+
vendor: "xfyun";
|
|
42
|
+
}
|
|
43
|
+
interface XfyunBigmodel extends Agora.XfyunBigmodelAsr {
|
|
44
|
+
vendor: "xfyun_bigmodel";
|
|
45
|
+
}
|
|
46
|
+
interface XfyunDialect extends Agora.XfyunDialectAsr {
|
|
47
|
+
vendor: "xfyun_dialect";
|
|
48
|
+
}
|
|
31
49
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as Agora from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Bytedance duplex streaming Text-to-Speech configuration.
|
|
4
|
+
*/
|
|
5
|
+
export interface BytedanceDuplexTts {
|
|
6
|
+
params: Agora.BytedanceDuplexTtsParams;
|
|
7
|
+
/** Controls whether the TTS module skips bracketed content when reading LLM response text. */
|
|
8
|
+
skip_patterns?: number[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bytedance duplex streaming TTS configuration parameters.
|
|
3
|
+
*/
|
|
4
|
+
export interface BytedanceDuplexTtsParams {
|
|
5
|
+
/** Bytedance application ID. */
|
|
6
|
+
app_id: string;
|
|
7
|
+
/** Bytedance API token. */
|
|
8
|
+
token: string;
|
|
9
|
+
/** Duplex TTS speaker identifier. */
|
|
10
|
+
speaker: string;
|
|
11
|
+
/** Accepts any additional properties */
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as Agora from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Bytedance Volcano Engine Text-to-Speech configuration.
|
|
4
|
+
*/
|
|
5
|
+
export interface BytedanceTts {
|
|
6
|
+
params: Agora.BytedanceTtsParams;
|
|
7
|
+
/** Controls whether the TTS module skips bracketed content when reading LLM response text. */
|
|
8
|
+
skip_patterns?: number[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bytedance Volcano Engine TTS configuration parameters.
|
|
3
|
+
*/
|
|
4
|
+
export interface BytedanceTtsParams {
|
|
5
|
+
/** Bytedance API token. */
|
|
6
|
+
token: string;
|
|
7
|
+
/** Bytedance application ID. */
|
|
8
|
+
app_id: string;
|
|
9
|
+
/** Bytedance cluster name. */
|
|
10
|
+
cluster: string;
|
|
11
|
+
/** Bytedance voice type. */
|
|
12
|
+
voice_type: string;
|
|
13
|
+
/** Speech speed ratio. */
|
|
14
|
+
speed_ratio?: number;
|
|
15
|
+
/** Volume ratio. */
|
|
16
|
+
volume_ratio?: number;
|
|
17
|
+
/** Pitch ratio. */
|
|
18
|
+
pitch_ratio?: number;
|
|
19
|
+
/** Emotion preset. */
|
|
20
|
+
emotion?: string;
|
|
21
|
+
/** Accepts any additional properties */
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|