agora-agents 2.3.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.js +8 -16
  3. package/dist/cjs/agentkit/Agent.js +6 -5
  4. package/dist/cjs/agentkit/AgentSession.js +2 -0
  5. package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.js +4 -0
  6. package/dist/cjs/agentkit/avatar-types.d.ts +18 -5
  7. package/dist/cjs/agentkit/avatar-types.js +31 -3
  8. package/dist/cjs/agentkit/constants.d.ts +6 -0
  9. package/dist/cjs/agentkit/constants.js +6 -1
  10. package/dist/cjs/agentkit/index.d.ts +10 -10
  11. package/dist/cjs/agentkit/index.js +11 -3
  12. package/dist/cjs/agentkit/region-vendors.d.ts +2 -1
  13. package/dist/cjs/agentkit/types.d.ts +26 -5
  14. package/dist/cjs/agentkit/vendors/avatar.d.ts +3 -3
  15. package/dist/cjs/agentkit/vendors/avatar.js +3 -3
  16. package/dist/cjs/agentkit/vendors/base.d.ts +4 -0
  17. package/dist/cjs/agentkit/vendors/base.js +4 -0
  18. package/dist/cjs/agentkit/vendors/cn.d.ts +19 -1
  19. package/dist/cjs/agentkit/vendors/cn.js +23 -3
  20. package/dist/cjs/agentkit/vendors/llm.d.ts +1 -1
  21. package/dist/cjs/agentkit/vendors/llm.js +13 -3
  22. package/dist/cjs/agentkit/vendors/mllm.d.ts +1 -1
  23. package/dist/cjs/agentkit/vendors/mllm.js +3 -3
  24. package/dist/cjs/agentkit/vendors/stt.d.ts +31 -0
  25. package/dist/cjs/agentkit/vendors/stt.js +26 -1
  26. package/dist/cjs/agentkit/vendors/tts.d.ts +137 -5
  27. package/dist/cjs/agentkit/vendors/tts.js +104 -5
  28. package/dist/cjs/api/resources/agents/client/requests/ListAgentsRequest.d.ts +2 -3
  29. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +18 -1
  30. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +8 -0
  31. package/dist/cjs/api/resources/agents/types/GetHistoryAgentsResponse.d.ts +6 -0
  32. package/dist/cjs/api/resources/agents/types/index.d.ts +0 -1
  33. package/dist/cjs/api/resources/agents/types/index.js +0 -1
  34. package/dist/cjs/api/types/Asr.d.ts +4 -1
  35. package/dist/cjs/api/types/GenericHttpTts.d.ts +13 -0
  36. package/dist/cjs/api/types/GenericHttpTts.js +3 -0
  37. package/dist/cjs/api/types/GenericHttpTtsParams.d.ts +21 -0
  38. package/dist/cjs/api/types/GenericHttpTtsParams.js +3 -0
  39. package/dist/cjs/api/types/GradiumTts.d.ts +9 -0
  40. package/dist/cjs/api/types/GradiumTts.js +3 -0
  41. package/dist/cjs/api/types/GradiumTtsParams.d.ts +17 -0
  42. package/dist/cjs/api/types/GradiumTtsParams.js +3 -0
  43. package/dist/cjs/api/types/Llm.d.ts +24 -1
  44. package/dist/cjs/api/types/Llm.js +8 -0
  45. package/dist/cjs/api/types/MistralTts.d.ts +9 -0
  46. package/dist/cjs/api/types/MistralTts.js +3 -0
  47. package/dist/cjs/api/types/MistralTtsParams.d.ts +13 -0
  48. package/dist/cjs/api/types/MistralTtsParams.js +3 -0
  49. package/dist/cjs/api/types/RimeTts.d.ts +10 -0
  50. package/dist/cjs/api/types/RimeTts.js +9 -0
  51. package/dist/cjs/api/types/RimeTtsParams.d.ts +2 -2
  52. package/dist/cjs/api/types/SpatiusAvatarParams.d.ts +23 -0
  53. package/dist/cjs/api/types/SpatiusAvatarParams.js +3 -0
  54. package/dist/cjs/api/types/Tts.d.ts +13 -1
  55. package/dist/cjs/api/types/XAiAsr.d.ts +10 -0
  56. package/dist/cjs/api/types/XAiAsr.js +3 -0
  57. package/dist/cjs/api/types/XAiAsrParams.d.ts +15 -0
  58. package/dist/cjs/api/types/XAiAsrParams.js +3 -0
  59. package/dist/cjs/api/types/XAiTts.d.ts +9 -0
  60. package/dist/cjs/api/types/XAiTts.js +3 -0
  61. package/dist/cjs/api/types/XAiTtsParams.d.ts +15 -0
  62. package/dist/cjs/api/types/XAiTtsParams.js +3 -0
  63. package/dist/cjs/api/types/index.d.ts +11 -0
  64. package/dist/cjs/api/types/index.js +11 -0
  65. package/dist/cjs/core/base64.js +1 -5
  66. package/dist/cjs/index.d.ts +2 -2
  67. package/dist/cjs/index.js +11 -3
  68. package/dist/cjs/version.d.ts +1 -1
  69. package/dist/cjs/version.js +1 -1
  70. package/dist/esm/BaseClient.mjs +2 -2
  71. package/dist/esm/Client.mjs +8 -16
  72. package/dist/esm/agentkit/Agent.mjs +6 -5
  73. package/dist/esm/agentkit/AgentSession.mjs +3 -1
  74. package/dist/esm/agentkit/__tests__/area-aware-vendors.test.mjs +5 -1
  75. package/dist/esm/agentkit/avatar-types.d.mts +18 -5
  76. package/dist/esm/agentkit/avatar-types.mjs +30 -3
  77. package/dist/esm/agentkit/constants.d.mts +6 -0
  78. package/dist/esm/agentkit/constants.mjs +5 -0
  79. package/dist/esm/agentkit/index.d.mts +10 -10
  80. package/dist/esm/agentkit/index.mjs +5 -5
  81. package/dist/esm/agentkit/region-vendors.d.mts +2 -1
  82. package/dist/esm/agentkit/types.d.mts +26 -5
  83. package/dist/esm/agentkit/vendors/avatar.d.mts +3 -3
  84. package/dist/esm/agentkit/vendors/avatar.mjs +3 -3
  85. package/dist/esm/agentkit/vendors/base.d.mts +4 -0
  86. package/dist/esm/agentkit/vendors/base.mjs +4 -0
  87. package/dist/esm/agentkit/vendors/cn.d.mts +19 -1
  88. package/dist/esm/agentkit/vendors/cn.mjs +21 -2
  89. package/dist/esm/agentkit/vendors/llm.d.mts +1 -1
  90. package/dist/esm/agentkit/vendors/llm.mjs +13 -3
  91. package/dist/esm/agentkit/vendors/mllm.d.mts +1 -1
  92. package/dist/esm/agentkit/vendors/mllm.mjs +3 -3
  93. package/dist/esm/agentkit/vendors/stt.d.mts +31 -0
  94. package/dist/esm/agentkit/vendors/stt.mjs +24 -0
  95. package/dist/esm/agentkit/vendors/tts.d.mts +137 -5
  96. package/dist/esm/agentkit/vendors/tts.mjs +99 -4
  97. package/dist/esm/api/resources/agents/client/requests/ListAgentsRequest.d.mts +2 -3
  98. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +18 -1
  99. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +8 -0
  100. package/dist/esm/api/resources/agents/types/GetHistoryAgentsResponse.d.mts +6 -0
  101. package/dist/esm/api/resources/agents/types/index.d.mts +0 -1
  102. package/dist/esm/api/resources/agents/types/index.mjs +0 -1
  103. package/dist/esm/api/types/Asr.d.mts +4 -1
  104. package/dist/esm/api/types/GenericHttpTts.d.mts +13 -0
  105. package/dist/esm/api/types/GenericHttpTts.mjs +2 -0
  106. package/dist/esm/api/types/GenericHttpTtsParams.d.mts +21 -0
  107. package/dist/esm/api/types/GenericHttpTtsParams.mjs +2 -0
  108. package/dist/esm/api/types/GradiumTts.d.mts +9 -0
  109. package/dist/esm/api/types/GradiumTts.mjs +2 -0
  110. package/dist/esm/api/types/GradiumTtsParams.d.mts +17 -0
  111. package/dist/esm/api/types/GradiumTtsParams.mjs +2 -0
  112. package/dist/esm/api/types/Llm.d.mts +24 -1
  113. package/dist/esm/api/types/Llm.mjs +8 -0
  114. package/dist/esm/api/types/MistralTts.d.mts +9 -0
  115. package/dist/esm/api/types/MistralTts.mjs +2 -0
  116. package/dist/esm/api/types/MistralTtsParams.d.mts +13 -0
  117. package/dist/esm/api/types/MistralTtsParams.mjs +2 -0
  118. package/dist/esm/api/types/RimeTts.d.mts +10 -0
  119. package/dist/esm/api/types/RimeTts.mjs +8 -1
  120. package/dist/esm/api/types/RimeTtsParams.d.mts +2 -2
  121. package/dist/esm/api/types/SpatiusAvatarParams.d.mts +23 -0
  122. package/dist/esm/api/types/SpatiusAvatarParams.mjs +2 -0
  123. package/dist/esm/api/types/Tts.d.mts +13 -1
  124. package/dist/esm/api/types/XAiAsr.d.mts +10 -0
  125. package/dist/esm/api/types/XAiAsr.mjs +2 -0
  126. package/dist/esm/api/types/XAiAsrParams.d.mts +15 -0
  127. package/dist/esm/api/types/XAiAsrParams.mjs +2 -0
  128. package/dist/esm/api/types/XAiTts.d.mts +9 -0
  129. package/dist/esm/api/types/XAiTts.mjs +2 -0
  130. package/dist/esm/api/types/XAiTtsParams.d.mts +15 -0
  131. package/dist/esm/api/types/XAiTtsParams.mjs +2 -0
  132. package/dist/esm/api/types/index.d.mts +11 -0
  133. package/dist/esm/api/types/index.mjs +11 -0
  134. package/dist/esm/core/base64.mjs +1 -5
  135. package/dist/esm/index.d.mts +2 -2
  136. package/dist/esm/index.mjs +5 -5
  137. package/dist/esm/version.d.mts +1 -1
  138. package/dist/esm/version.mjs +1 -1
  139. package/package.json +1 -1
  140. package/dist/cjs/api/resources/agents/types/ListAgentsRequestState.d.ts +0 -10
  141. package/dist/cjs/api/resources/agents/types/ListAgentsRequestState.js +0 -13
  142. package/dist/esm/api/resources/agents/types/ListAgentsRequestState.d.mts +0 -10
  143. package/dist/esm/api/resources/agents/types/ListAgentsRequestState.mjs +0 -10
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Type-safe TTS (Text-to-Speech) vendor classes.
3
3
  */
4
+ import { CredentialMode } from "../constants.mjs";
4
5
  import { MiniMaxPresetModels, OpenAITtsPresetModels, } from "../presets.mjs";
5
6
  import { BaseTTS } from "./base.mjs";
6
7
  function requireString(value, field, vendor) {
@@ -8,6 +9,11 @@ function requireString(value, field, vendor) {
8
9
  throw new Error(`${vendor} requires ${field}`);
9
10
  }
10
11
  }
12
+ function requireRecord(value, field, vendor) {
13
+ if (value == null || typeof value !== "object" || Array.isArray(value)) {
14
+ throw new Error(`${vendor} requires ${field}`);
15
+ }
16
+ }
11
17
  function isOpenAITtsManagedModel(model) {
12
18
  return model === undefined || OpenAITtsPresetModels.includes(model.trim().toLowerCase());
13
19
  }
@@ -181,6 +187,30 @@ export class DeepgramTTS extends BaseTTS {
181
187
  return Object.assign({ vendor: "deepgram", params: Object.assign(Object.assign(Object.assign({ api_key: apiKey, model }, additionalParams), (baseUrl && { base_url: baseUrl })), (sampleRate !== undefined && { sample_rate: sampleRate })) }, (skipPatterns && { skip_patterns: skipPatterns }));
182
188
  }
183
189
  }
190
+ /** Gradium TTS vendor. */
191
+ export class GradiumTTS extends BaseTTS {
192
+ constructor(options) {
193
+ super();
194
+ requireString(options.apiKey, "apiKey", "GradiumTTS");
195
+ this.options = options;
196
+ }
197
+ toConfig() {
198
+ const { apiKey, url, modelName, voiceId, sampleRate, additionalParams, skipPatterns } = this.options;
199
+ return Object.assign({ vendor: "gradium", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey }), (url !== undefined && { url })), (modelName !== undefined && { model_name: modelName })), (voiceId !== undefined && { voice_id: voiceId })), (sampleRate !== undefined && { sample_rate: sampleRate })) }, (skipPatterns && { skip_patterns: skipPatterns }));
200
+ }
201
+ }
202
+ /** Mistral TTS vendor. */
203
+ export class MistralTTS extends BaseTTS {
204
+ constructor(options) {
205
+ super();
206
+ requireString(options.apiKey, "apiKey", "MistralTTS");
207
+ this.options = options;
208
+ }
209
+ toConfig() {
210
+ const { apiKey, model, voice, additionalParams, skipPatterns } = this.options;
211
+ return Object.assign({ vendor: "mistral", params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey }), (model !== undefined && { model })), (voice !== undefined && { voice })) }, (skipPatterns && { skip_patterns: skipPatterns }));
212
+ }
213
+ }
184
214
  /**
185
215
  * Hume AI TTS vendor.
186
216
  *
@@ -207,8 +237,19 @@ export class HumeAITTS extends BaseTTS {
207
237
  * Rime TTS vendor.
208
238
  *
209
239
  * @example
240
+ * Agora-managed credentials:
241
+ * ```typescript
242
+ * const managedTts = new RimeTTS({
243
+ * credentialMode: CredentialMode.Managed,
244
+ * baseUrl: 'wss://users.rime.ai/ws',
245
+ * modelId: 'mist',
246
+ * });
247
+ * ```
248
+ *
249
+ * @example
250
+ * Bring your own credentials (the default mode):
210
251
  * ```typescript
211
- * const tts = new RimeTTS({
252
+ * const byokTts = new RimeTTS({
212
253
  * key: process.env.RIME_API_KEY,
213
254
  * speaker: 'speaker-id',
214
255
  * modelId: 'mist',
@@ -218,12 +259,23 @@ export class HumeAITTS extends BaseTTS {
218
259
  export class RimeTTS extends BaseTTS {
219
260
  constructor(options) {
220
261
  super();
262
+ requireString(options.modelId, "modelId", "RimeTTS");
263
+ if (options.credentialMode === CredentialMode.Managed) {
264
+ requireString(options.baseUrl, "baseUrl", "RimeTTS");
265
+ }
266
+ else {
267
+ requireString(options.key, "key", "RimeTTS");
268
+ requireString(options.speaker, "speaker", "RimeTTS");
269
+ }
221
270
  this.options = options;
222
271
  }
223
272
  toConfig() {
224
- const { key, speaker, modelId, baseUrl, skipPatterns } = this.options;
225
- return Object.assign({ vendor: "rime", params: Object.assign({ api_key: key, speaker,
226
- modelId }, (baseUrl && { base_url: baseUrl })) }, (skipPatterns && { skip_patterns: skipPatterns }));
273
+ const { key, speaker, modelId, baseUrl, skipPatterns, credentialMode } = this.options;
274
+ if (credentialMode === CredentialMode.Managed) {
275
+ return Object.assign({ vendor: "rime", credential_mode: CredentialMode.Managed, params: Object.assign(Object.assign({ modelId, base_url: baseUrl }, (key !== undefined && { api_key: key })), (speaker !== undefined && { speaker })) }, (skipPatterns && { skip_patterns: skipPatterns }));
276
+ }
277
+ return Object.assign(Object.assign(Object.assign({ vendor: "rime" }, (credentialMode !== undefined && { credential_mode: credentialMode })), { params: Object.assign({ api_key: key, speaker,
278
+ modelId }, (baseUrl && { base_url: baseUrl })) }), (skipPatterns && { skip_patterns: skipPatterns }));
227
279
  }
228
280
  }
229
281
  /**
@@ -328,3 +380,46 @@ export class MurfTTS extends BaseTTS {
328
380
  return Object.assign({ vendor: "murf", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ api_key: key }, (baseUrl && { base_url: baseUrl })), (voiceId && { voiceId })), (locale && { locale })), (rate !== undefined && { rate })), (pitch !== undefined && { pitch })), (model && { model })), (sampleRate !== undefined && { sample_rate: sampleRate })) }, (skipPatterns && { skip_patterns: skipPatterns }));
329
381
  }
330
382
  }
383
+ function requireGenericTtsHttpUrl(url) {
384
+ requireString(url, "url", "GenericTTS");
385
+ let protocol;
386
+ try {
387
+ protocol = new URL(url).protocol;
388
+ }
389
+ catch (_a) {
390
+ throw new Error("GenericTTS requires url to be a valid absolute URL");
391
+ }
392
+ if (protocol === "http:" || protocol === "https:") {
393
+ return;
394
+ }
395
+ throw new Error(`GenericTTS does not support the ${protocol} protocol`);
396
+ }
397
+ /**
398
+ * Generic OpenAI-compatible TTS vendor.
399
+ */
400
+ export class GenericTTS extends BaseTTS {
401
+ constructor(options) {
402
+ super();
403
+ requireGenericTtsHttpUrl(options.url);
404
+ this.options = options;
405
+ }
406
+ toConfig() {
407
+ const { url, headers, apiKey, model, voice, speed, sampleRate, responseFormat, instruction, additionalParams, skipPatterns, } = this.options;
408
+ return Object.assign(Object.assign(Object.assign({ vendor: "generic_http", url }, (headers && { headers })), { params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), (apiKey !== undefined && { api_key: apiKey })), (model !== undefined && { model })), (voice !== undefined && { voice })), (speed !== undefined && { speed })), (sampleRate !== undefined && { sample_rate: sampleRate })), (responseFormat !== undefined && { response_format: responseFormat })), (instruction !== undefined && { instruction })) }), (skipPatterns && { skip_patterns: skipPatterns }));
409
+ }
410
+ }
411
+ /**
412
+ * xAI TTS vendor.
413
+ */
414
+ export class XAiTTS extends BaseTTS {
415
+ constructor(options) {
416
+ super();
417
+ requireString(options.apiKey, "apiKey", "XAiTTS");
418
+ requireString(options.language, "language", "XAiTTS");
419
+ this.options = options;
420
+ }
421
+ toConfig() {
422
+ const { apiKey, language, voiceId, sampleRate, additionalParams, skipPatterns } = this.options;
423
+ 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 }));
424
+ }
425
+ }
@@ -1,4 +1,3 @@
1
- import type * as Agora from "../../../../index.mjs";
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 to filter by. Only one state can be specified per query:
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?: Agora.ListAgentsRequestState;
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` means that the agent does not exit until it is stopped manually. */
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;
@@ -173,6 +173,7 @@ export declare namespace StartAgentsRequest {
173
173
  * - `anam`: Anam (Beta)
174
174
  * - `generic`: Generic (Beta)
175
175
  * - `sensetime`: SenseTime Avatar
176
+ * - `spatius`: Spatius Avatar
176
177
  */
177
178
  vendor?: Avatar.Vendor;
178
179
  /** The configuration parameters for the avatar vendor. See [AI Avatar Overview](https://docs.agora.io/en/conversational-ai/models/avatar/overview) for details. */
@@ -186,6 +187,7 @@ export declare namespace StartAgentsRequest {
186
187
  * - `anam`: Anam (Beta)
187
188
  * - `generic`: Generic (Beta)
188
189
  * - `sensetime`: SenseTime Avatar
190
+ * - `spatius`: Spatius Avatar
189
191
  */
190
192
  const Vendor: {
191
193
  readonly Akool: "akool";
@@ -199,6 +201,9 @@ export declare namespace StartAgentsRequest {
199
201
  /**
200
202
  * SenseTime Avatar */
201
203
  readonly Sensetime: "sensetime";
204
+ /**
205
+ * Spatius Avatar */
206
+ readonly Spatius: "spatius";
202
207
  /**
203
208
  * Deprecated: HeyGen has renamed to LiveAvatar. Use `liveavatar` instead. */
204
209
  readonly Heygen: "heygen";
@@ -279,6 +284,7 @@ export declare namespace StartAgentsRequest {
279
284
  * - `vad`: Based on VAD (Voice Activity Detection). Uses audio signal detection.
280
285
  * - `keywords`: Deprecated. Use `interruption.mode = "keywords"` instead.
281
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.
282
288
  */
283
289
  mode: StartOfSpeech.Mode;
284
290
  /** VAD configuration. Used when `mode` is `vad`. */
@@ -294,11 +300,13 @@ export declare namespace StartAgentsRequest {
294
300
  * - `vad`: Based on VAD (Voice Activity Detection). Uses audio signal detection.
295
301
  * - `keywords`: Deprecated. Use `interruption.mode = "keywords"` instead.
296
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.
297
304
  */
298
305
  const Mode: {
299
306
  readonly Vad: "vad";
300
307
  readonly Keywords: "keywords";
301
308
  readonly Disabled: "disabled";
309
+ readonly Manual: "manual";
302
310
  };
303
311
  type Mode = (typeof Mode)[keyof typeof Mode];
304
312
  /**
@@ -349,6 +357,7 @@ export declare namespace StartAgentsRequest {
349
357
  * End of speech detection mode:
350
358
  * - `vad`: Based on VAD (Voice Activity Detection). Detects silence duration.
351
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.
352
361
  */
353
362
  mode?: EndOfSpeech.Mode;
354
363
  /** VAD configuration. Used when `mode` is `vad`. */
@@ -361,10 +370,12 @@ export declare namespace StartAgentsRequest {
361
370
  * End of speech detection mode:
362
371
  * - `vad`: Based on VAD (Voice Activity Detection). Detects silence duration.
363
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.
364
374
  */
365
375
  const Mode: {
366
376
  readonly Vad: "vad";
367
377
  readonly Semantic: "semantic";
378
+ readonly Manual: "manual";
368
379
  };
369
380
  type Mode = (typeof Mode)[keyof typeof Mode];
370
381
  /**
@@ -655,6 +666,12 @@ export declare namespace StartAgentsRequest {
655
666
  * - `aiserver`: Optimized for interactions between the user and the conversational AI agent in terms of latency and network resilience.
656
667
  */
657
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;
658
675
  }
659
676
  namespace Parameters {
660
677
  /**
@@ -32,6 +32,7 @@ export var StartAgentsRequest;
32
32
  * - `anam`: Anam (Beta)
33
33
  * - `generic`: Generic (Beta)
34
34
  * - `sensetime`: SenseTime Avatar
35
+ * - `spatius`: Spatius Avatar
35
36
  */
36
37
  Avatar.Vendor = {
37
38
  Akool: "akool",
@@ -45,6 +46,9 @@ export var StartAgentsRequest;
45
46
  /**
46
47
  * SenseTime Avatar */
47
48
  Sensetime: "sensetime",
49
+ /**
50
+ * Spatius Avatar */
51
+ Spatius: "spatius",
48
52
  /**
49
53
  * Deprecated: HeyGen has renamed to LiveAvatar. Use `liveavatar` instead. */
50
54
  Heygen: "heygen",
@@ -61,11 +65,13 @@ export var StartAgentsRequest;
61
65
  * - `vad`: Based on VAD (Voice Activity Detection). Uses audio signal detection.
62
66
  * - `keywords`: Deprecated. Use `interruption.mode = "keywords"` instead.
63
67
  * - `disabled`: Deprecated. Use `interruption.enable = false` with `interruption.disabled_config.strategy` to configure the handling strategy.
68
+ * - `manual`: The client explicitly submits the start of the user turn through signaling.
64
69
  */
65
70
  StartOfSpeech.Mode = {
66
71
  Vad: "vad",
67
72
  Keywords: "keywords",
68
73
  Disabled: "disabled",
74
+ Manual: "manual",
69
75
  };
70
76
  let DisabledConfig;
71
77
  (function (DisabledConfig) {
@@ -86,10 +92,12 @@ export var StartAgentsRequest;
86
92
  * End of speech detection mode:
87
93
  * - `vad`: Based on VAD (Voice Activity Detection). Detects silence duration.
88
94
  * - `semantic`: Based on semantic triggering. Uses semantic understanding to determine when conversation ends.
95
+ * - `manual`: The client explicitly submits the end of the user turn through signaling.
89
96
  */
90
97
  EndOfSpeech.Mode = {
91
98
  Vad: "vad",
92
99
  Semantic: "semantic",
100
+ Manual: "manual",
93
101
  };
94
102
  })(EndOfSpeech = Config.EndOfSpeech || (Config.EndOfSpeech = {}));
95
103
  })(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.mjs";
2
2
  export * from "./GetHistoryAgentsResponse.mjs";
3
3
  export * from "./GetTurnsAgentsResponse.mjs";
4
4
  export * from "./InterruptAgentsResponse.mjs";
5
- export * from "./ListAgentsRequestState.mjs";
6
5
  export * from "./ListAgentsResponse.mjs";
7
6
  export * from "./SpeakAgentsResponse.mjs";
8
7
  export * from "./StartAgentsResponse.mjs";
@@ -2,7 +2,6 @@ export * from "./GetAgentsResponse.mjs";
2
2
  export * from "./GetHistoryAgentsResponse.mjs";
3
3
  export * from "./GetTurnsAgentsResponse.mjs";
4
4
  export * from "./InterruptAgentsResponse.mjs";
5
- export * from "./ListAgentsRequestState.mjs";
6
5
  export * from "./ListAgentsResponse.mjs";
7
6
  export * from "./SpeakAgentsResponse.mjs";
8
7
  export * from "./StartAgentsResponse.mjs";
@@ -1,5 +1,5 @@
1
1
  import type * as Agora from "../index.mjs";
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.Xfyun | Agora.Asr.XfyunBigmodel | Agora.Asr.XfyunDialect;
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";
@@ -34,6 +34,9 @@ export declare namespace Asr {
34
34
  interface Sarvam extends Agora.SarvamAsr {
35
35
  vendor: "sarvam";
36
36
  }
37
+ interface Xai extends Agora.XAiAsr {
38
+ vendor: "xai";
39
+ }
37
40
  interface Xfyun extends Agora.XfyunAsr {
38
41
  vendor: "xfyun";
39
42
  }
@@ -0,0 +1,13 @@
1
+ import type * as Agora from "../index.mjs";
2
+ /**
3
+ * Generic OpenAI-compatible Text-to-Speech configuration.
4
+ */
5
+ export interface GenericHttpTts {
6
+ /** Callback address of the generic TTS service. */
7
+ url: string;
8
+ /** Custom headers to include in requests to the generic TTS service. */
9
+ headers?: Record<string, string>;
10
+ params: Agora.GenericHttpTtsParams;
11
+ /** Controls whether the TTS module skips bracketed content when reading LLM response text. */
12
+ skip_patterns?: number[];
13
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Generic TTS configuration parameters.
3
+ */
4
+ export interface GenericHttpTtsParams {
5
+ /** API key for the generic TTS service. */
6
+ api_key?: string;
7
+ /** TTS model name. */
8
+ model?: string;
9
+ /** Voice name. */
10
+ voice?: string;
11
+ /** Speech rate. */
12
+ speed?: number;
13
+ /** Output audio sample rate in Hz. */
14
+ sample_rate?: number;
15
+ /** Output audio format. ConvoAI currently supports `pcm` only. */
16
+ response_format?: "pcm";
17
+ /** Additional voice style control instruction. */
18
+ instruction?: string;
19
+ /** Accepts any additional properties */
20
+ [key: string]: any;
21
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ import type * as Agora from "../index.mjs";
2
+ /**
3
+ * Gradium Text-to-Speech configuration.
4
+ */
5
+ export interface GradiumTts {
6
+ params: Agora.GradiumTtsParams;
7
+ /** Controls whether the TTS module skips bracketed content when reading LLM response text. */
8
+ skip_patterns?: number[];
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Gradium TTS configuration parameters.
3
+ */
4
+ export interface GradiumTtsParams {
5
+ /** Gradium API key. */
6
+ api_key: string;
7
+ /** WebSocket endpoint for streaming TTS output (for example, "wss://api.gradium.ai/api/speech/tts"). */
8
+ url?: string;
9
+ /** Gradium TTS model name (for example, "default"). */
10
+ model_name?: string;
11
+ /** Gradium voice identifier. */
12
+ voice_id?: string;
13
+ /** Audio sample rate in Hz (for example, 16000). */
14
+ sample_rate?: number;
15
+ /** Accepts any additional properties */
16
+ [key: string]: any;
17
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -26,6 +26,8 @@ export interface Llm {
26
26
  output_modalities?: string[];
27
27
  /** Agent greeting. */
28
28
  greeting_message?: string;
29
+ /** Publicly accessible greeting audio URL. */
30
+ greeting_audio_url?: string;
29
31
  /** Prompt for agent activation failure. */
30
32
  failure_message?: string;
31
33
  /** LLM provider identifier. */
@@ -35,7 +37,7 @@ export interface Llm {
35
37
  /** Whether to handle empty Gemini responses. */
36
38
  ignore_empty?: boolean | null;
37
39
  /** Agent greeting broadcast configuration. */
38
- greeting_configs?: Record<string, unknown>;
40
+ greeting_configs?: Llm.GreetingConfigs;
39
41
  /** Template parameter configuration. */
40
42
  template_variables?: Record<string, string>;
41
43
  /** MCP server configuration. */
@@ -55,4 +57,25 @@ export declare namespace Llm {
55
57
  readonly Bedrock: "bedrock";
56
58
  };
57
59
  type Style = (typeof Style)[keyof typeof Style];
60
+ /**
61
+ * Agent greeting broadcast configuration.
62
+ */
63
+ interface GreetingConfigs {
64
+ /** Timeout in milliseconds for downloading greeting audio. */
65
+ audio_download_timeout_ms?: number | null;
66
+ /** Sample rate in Hz for PCM greeting audio. */
67
+ audio_pcm_sample_rate?: number | null;
68
+ /** Policy for handling ASR text during uninterruptible greeting playback. */
69
+ uninterruptible_asr_policy?: GreetingConfigs.UninterruptibleAsrPolicy | null;
70
+ /** Accepts any additional properties */
71
+ [key: string]: any;
72
+ }
73
+ namespace GreetingConfigs {
74
+ /** Policy for handling ASR text during uninterruptible greeting playback. */
75
+ const UninterruptibleAsrPolicy: {
76
+ readonly MergeReply: "merge_reply";
77
+ readonly Context: "context";
78
+ };
79
+ type UninterruptibleAsrPolicy = (typeof UninterruptibleAsrPolicy)[keyof typeof UninterruptibleAsrPolicy];
80
+ }
58
81
  }
@@ -9,4 +9,12 @@ export var Llm;
9
9
  Dify: "dify",
10
10
  Bedrock: "bedrock",
11
11
  };
12
+ let GreetingConfigs;
13
+ (function (GreetingConfigs) {
14
+ /** Policy for handling ASR text during uninterruptible greeting playback. */
15
+ GreetingConfigs.UninterruptibleAsrPolicy = {
16
+ MergeReply: "merge_reply",
17
+ Context: "context",
18
+ };
19
+ })(GreetingConfigs = Llm.GreetingConfigs || (Llm.GreetingConfigs = {}));
12
20
  })(Llm || (Llm = {}));
@@ -0,0 +1,9 @@
1
+ import type * as Agora from "../index.mjs";
2
+ /**
3
+ * Mistral Text-to-Speech configuration.
4
+ */
5
+ export interface MistralTts {
6
+ params: Agora.MistralTtsParams;
7
+ /** Controls whether the TTS module skips bracketed content when reading LLM response text. */
8
+ skip_patterns?: number[];
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Mistral TTS configuration parameters.
3
+ */
4
+ export interface MistralTtsParams {
5
+ /** Mistral API key. */
6
+ api_key: string;
7
+ /** Mistral TTS model name (for example, "voxtral-mini-tts-2603"). */
8
+ model?: string;
9
+ /** Mistral voice identifier. */
10
+ voice?: string;
11
+ /** Accepts any additional properties */
12
+ [key: string]: any;
13
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -3,7 +3,17 @@ import type * as Agora from "../index.mjs";
3
3
  * Rime Text-to-Speech configuration (Beta).
4
4
  */
5
5
  export interface RimeTts {
6
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
7
+ credential_mode?: RimeTts.CredentialMode;
6
8
  params: Agora.RimeTtsParams;
7
9
  /** Controls whether the TTS module skips bracketed content when reading LLM response text. */
8
10
  skip_patterns?: number[];
9
11
  }
12
+ export declare namespace RimeTts {
13
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
14
+ const CredentialMode: {
15
+ readonly Managed: "managed";
16
+ readonly Byok: "byok";
17
+ };
18
+ type CredentialMode = (typeof CredentialMode)[keyof typeof CredentialMode];
19
+ }
@@ -1,2 +1,9 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ export var RimeTts;
3
+ (function (RimeTts) {
4
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
5
+ RimeTts.CredentialMode = {
6
+ Managed: "managed",
7
+ Byok: "byok",
8
+ };
9
+ })(RimeTts || (RimeTts = {}));
@@ -3,9 +3,9 @@
3
3
  */
4
4
  export interface RimeTtsParams {
5
5
  /** Rime API key */
6
- api_key: string;
6
+ api_key?: string;
7
7
  /** Rime speaker ID */
8
- speaker: string;
8
+ speaker?: string;
9
9
  /** Rime TTS model ID */
10
10
  modelId: string;
11
11
  /** WebSocket URL for the Rime streaming API */
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Spatius Avatar configuration parameters.
3
+ */
4
+ export interface SpatiusAvatarParams {
5
+ /** Spatius API key. */
6
+ spatius_api_key: string;
7
+ /** Spatius application ID. */
8
+ spatius_app_id: string;
9
+ /** Spatius avatar ID. */
10
+ spatius_avatar_id: string;
11
+ /** Agora UID used by the avatar service. */
12
+ agora_uid: string;
13
+ /** RTC token generated for `agora_uid` in the target channel. */
14
+ agora_token?: string | null;
15
+ /** Spatius service region, for example `cn-beijing`. */
16
+ region?: string | null;
17
+ /** Audio sample rate in Hz. Recommended to match the TTS sample rate. */
18
+ sample_rate?: number | null;
19
+ /** Spatius session validity duration in minutes. Defaults to 30. */
20
+ session_expire_minutes?: number | null;
21
+ /** Accepts any additional properties */
22
+ [key: string]: any;
23
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type * as Agora from "../index.mjs";
2
- export type Tts = Agora.Tts.Tencent | Agora.Tts.Bytedance | Agora.Tts.Microsoft | Agora.Tts.Elevenlabs | Agora.Tts.Minimax | Agora.Tts.Murf | Agora.Tts.Cartesia | Agora.Tts.Openai | Agora.Tts.Humeai | Agora.Tts.Rime | Agora.Tts.Fishaudio | Agora.Tts.Google | Agora.Tts.Amazon | Agora.Tts.Sarvam | Agora.Tts.Deepgram | Agora.Tts.Cosyvoice | Agora.Tts.BytedanceDuplex | Agora.Tts.Stepfun;
2
+ export type Tts = Agora.Tts.Tencent | Agora.Tts.Bytedance | Agora.Tts.Microsoft | Agora.Tts.Elevenlabs | Agora.Tts.Minimax | Agora.Tts.Murf | Agora.Tts.Cartesia | Agora.Tts.Openai | Agora.Tts.Humeai | Agora.Tts.Rime | Agora.Tts.Fishaudio | Agora.Tts.Google | Agora.Tts.Amazon | Agora.Tts.Sarvam | Agora.Tts.GenericHttp | Agora.Tts.Xai | Agora.Tts.Deepgram | Agora.Tts.Cosyvoice | Agora.Tts.BytedanceDuplex | Agora.Tts.Stepfun | Agora.Tts.Gradium | Agora.Tts.Mistral;
3
3
  export declare namespace Tts {
4
4
  interface Tencent extends Agora.TencentTts {
5
5
  vendor: "tencent";
@@ -43,6 +43,12 @@ export declare namespace Tts {
43
43
  interface Sarvam extends Agora.SarvamTts {
44
44
  vendor: "sarvam";
45
45
  }
46
+ interface GenericHttp extends Agora.GenericHttpTts {
47
+ vendor: "generic_http";
48
+ }
49
+ interface Xai extends Agora.XAiTts {
50
+ vendor: "xai";
51
+ }
46
52
  interface Deepgram extends Agora.DeepgramTts {
47
53
  vendor: "deepgram";
48
54
  }
@@ -55,4 +61,10 @@ export declare namespace Tts {
55
61
  interface Stepfun extends Agora.StepfunTts {
56
62
  vendor: "stepfun";
57
63
  }
64
+ interface Gradium extends Agora.GradiumTts {
65
+ vendor: "gradium";
66
+ }
67
+ interface Mistral extends Agora.MistralTts {
68
+ vendor: "mistral";
69
+ }
58
70
  }
@@ -0,0 +1,10 @@
1
+ import type * as Agora from "../index.mjs";
2
+ /**
3
+ * xAI ASR configuration.
4
+ */
5
+ export interface XAiAsr {
6
+ language?: Agora.AsrLanguage;
7
+ params: Agora.XAiAsrParams;
8
+ /** Accepts any additional properties */
9
+ [key: string]: any;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};